Sari la conținut

Create an account on our board

or login and enjoy all the possibilities

Utilizator existent? Autentifică-te

Autentificare



Sau autentifică-te cu unul din aceste servicii

Înregistrare

Leaks.ro

Leaks România este o comunitate de discuții generale unde puteți găsi resurse de orice fel, puteți participa la discuții interactive, și rezolva orice tip de problemă.

LastGuards

[REZOLVAT] Cateva intrebari ?

Postări Recomandate

Username: LastGuards
Problema întălnită: Vreau sa fac optiunea de SpawnAll la /v
Detalii despre problemă: ???
Ce ai încercat să faci înainte să postezi?: Am incercat sa fac dar nu imi dau seama cum fac sa le
Cod sursă (recomandat pastebin.com) : https://pastebin.com/SXPj4aWp
Alte detalii: Vam lasat pastebin cum este normal 

Partajează acest post


Link spre post
Distribuie pe alte site-uri

Ti-am facut doar codul de la dialog, cu restul cred ca te descurci. Mai ai de facut sa afiseze acea optiune `Spawn All Vehicles`. Nu am testat, revino cu un reply dupa ce testezi sa stiu daca merge sau nu.

new respawntax = GetVehicles(playerid) * 1000;
format(string, sizeof(string), "Nu ai $%d.", respawntax);
if(GetPlayerCash(playerid) < respawntax) return SendClientMessage(playerid, COLOR_GREY, string);
for(new i = 0; i < 10; i++) {
	if(PlayerInfo[playerid][pCarKey][i] != 0) {
		new carid = PlayerInfo[playerid][pCarKey][i];
		if(CarInfo[carid][Spawned] != 0 && CarInfo[carid][Confiscated] != 1 && !IsAttached(CarInfo[carid][Spawned]) && !IsVehicleOccupied(CarInfo[carid][Spawned])) {
			SetVehicleToRespawn(CarInfo[carid][Spawned]);
			SetTunning(carid);
		}
		else SpawnPlayerCar(carid);
	}
}
GivePlayerCash(playerid, -respawntax);
BizzInfo[19][bBalance] += respawntax;
mysql_format(SQL, query, sizeof(query), "UPDATE bizz SET Till = %d WHERE ID = %d", BizzInfo[19][bBalance], 30);
mysql_tquery(SQL, query, "", "");
SCM(playerid, COLOR_GOLD, "[Manage vehicle] Your cars have been respawned.");

 

Editat de DiBlaine

Partajează acest post


Link spre post
Distribuie pe alte site-uri

Deasupra functiei:

ShowPlayerDialog(playerid, DIALOG_GARAGE, DIALOG_STYLE_LIST, szTitle, szDialog2, "Ok", "Exit");

 adaugi:

strcat(szDialog2, "Spawn All Vehicles");

Ar trebuii sa arate cam asa dupa ce faci ce ti-am zis eu:

strcat(szDialog2, "Spawn All Vehicles");
ShowPlayerDialog(playerid, DIALOG_GARAGE, DIALOG_STYLE_LIST, szTitle, szDialog2, "Ok", "Exit");

Apoi inlocuiesti case DIALOG_GARAGE cu asta:

case DIALOG_GARAGE: {
	if(!response) return 1;
	if(strfind(inputtext, "Spawn All Vehicles", true) != -1) {
		new respawntax = GetVehicles(playerid) * 1000;
		format(string, sizeof(string), "Nu ai $%d.", respawntax);
		if(GetPlayerCash(playerid) < respawntax) return SendClientMessage(playerid, COLOR_GREY, string);
		for(new i = 0; i < 10; i++) {
			if(PlayerInfo[playerid][pCarKey][i] != 0) {
				new carid = PlayerInfo[playerid][pCarKey][i];
				if(CarInfo[carid][Spawned] != 0 && CarInfo[carid][Confiscated] != 1 && !IsAttached(CarInfo[carid][Spawned]) && !IsVehicleOccupied(CarInfo[carid][Spawned])) {
					SetVehicleToRespawn(CarInfo[carid][Spawned]);
					SetTunning(carid);
				}
				else SpawnPlayerCar(carid);
			}
		}
		GivePlayerCash(playerid, -respawntax);
		BizzInfo[19][bBalance] += respawntax;
		mysql_format(SQL, query, sizeof(query), "UPDATE bizz SET Till = %d WHERE ID = %d", BizzInfo[19][bBalance], 30);
		mysql_tquery(SQL, query, "", "");
		SCM(playerid, COLOR_GOLD, "[Manage vehicle] Your cars have been respawned.");
	}
	new idd;
	if(PlayerInfo[playerid][pCarKey][listitem] == 0) return 1;
	else idd = PlayerInfo[playerid][pCarKey][listitem];	
	sVehicle[5][playerid] = idd;	
	SetPVarInt(playerid, "VehicleSlot", listitem);				
	if(CarInfo[idd][Spawned] != 0) strcat(string,      "Vehicle Info\nFind Vehicle\nTow Vehicle (/park)\nTow Vehicle (last known location)\nDespawn\nDebug\nSell Vehicle\nBuy Insurance\nUpgrade to VIP Vehicle - {FFFF00}1008 premium points{FFFFFF}\n{FF0000}Remove tuning");
	else if(CarInfo[idd][Spawned] == 0) strcat(string, "Vehicle Info\nFind Vehicle\nTow Vehicle (/park)\nTow Vehicle (last known location)\nSpawn vehicle\nDebug\nSell Vehicle\nBuy Insurance\nUpgrade to VIP Vehicle - {FFFF00}1008 premium points{FFFFFF}\n{FF0000}Remove tuning");
	if(CarInfo[idd][Confiscated] == 1) strcat(string, "\n{FFFFFF}Pay fine to TTC");
	ShowPlayerDialog(playerid, DIALOG_GARAGE1, DIALOG_STYLE_LIST, "Options", string, "Ok", "Back");
}

Lasa un reply dupa ce testezi.

Editat de DiBlaine

Partajează acest post


Link spre post
Distribuie pe alte site-uri
Acum 23 ore, DiBlaine a spus:

Deasupra functiei:


ShowPlayerDialog(playerid, DIALOG_GARAGE, DIALOG_STYLE_LIST, szTitle, szDialog2, "Ok", "Exit");

 adaugi:


strcat(szDialog2, "Spawn All Vehicles");

Ar trebuii sa arate cam asa dupa ce faci ce ti-am zis eu:


strcat(szDialog2, "Spawn All Vehicles");
ShowPlayerDialog(playerid, DIALOG_GARAGE, DIALOG_STYLE_LIST, szTitle, szDialog2, "Ok", "Exit");

Apoi inlocuiesti case DIALOG_GARAGE cu asta:


case DIALOG_GARAGE: {
	if(!response) return 1;
	if(strfind(inputtext, "Spawn All Vehicles", true) != -1) {
		new respawntax = GetVehicles(playerid) * 1000;
		format(string, sizeof(string), "Nu ai $%d.", respawntax);
		if(GetPlayerCash(playerid) < respawntax) return SendClientMessage(playerid, COLOR_GREY, string);
		for(new i = 0; i < 10; i++) {
			if(PlayerInfo[playerid][pCarKey][i] != 0) {
				new carid = PlayerInfo[playerid][pCarKey][i];
				if(CarInfo[carid][Spawned] != 0 && CarInfo[carid][Confiscated] != 1 && !IsAttached(CarInfo[carid][Spawned]) && !IsVehicleOccupied(CarInfo[carid][Spawned])) {
					SetVehicleToRespawn(CarInfo[carid][Spawned]);
					SetTunning(carid);
				}
				else SpawnPlayerCar(carid);
			}
		}
		GivePlayerCash(playerid, -respawntax);
		BizzInfo[19][bBalance] += respawntax;
		mysql_format(SQL, query, sizeof(query), "UPDATE bizz SET Till = %d WHERE ID = %d", BizzInfo[19][bBalance], 30);
		mysql_tquery(SQL, query, "", "");
		SCM(playerid, COLOR_GOLD, "[Manage vehicle] Your cars have been respawned.");
	}
	new idd;
	if(PlayerInfo[playerid][pCarKey][listitem] == 0) return 1;
	else idd = PlayerInfo[playerid][pCarKey][listitem];	
	sVehicle[5][playerid] = idd;	
	SetPVarInt(playerid, "VehicleSlot", listitem);				
	if(CarInfo[idd][Spawned] != 0) strcat(string,      "Vehicle Info\nFind Vehicle\nTow Vehicle (/park)\nTow Vehicle (last known location)\nDespawn\nDebug\nSell Vehicle\nBuy Insurance\nUpgrade to VIP Vehicle - {FFFF00}1008 premium points{FFFFFF}\n{FF0000}Remove tuning");
	else if(CarInfo[idd][Spawned] == 0) strcat(string, "Vehicle Info\nFind Vehicle\nTow Vehicle (/park)\nTow Vehicle (last known location)\nSpawn vehicle\nDebug\nSell Vehicle\nBuy Insurance\nUpgrade to VIP Vehicle - {FFFF00}1008 premium points{FFFFFF}\n{FF0000}Remove tuning");
	if(CarInfo[idd][Confiscated] == 1) strcat(string, "\n{FFFFFF}Pay fine to TTC");
	ShowPlayerDialog(playerid, DIALOG_GARAGE1, DIALOG_STYLE_LIST, "Options", string, "Ok", "Back");
}

Lasa un reply dupa ce testezi.

Primesc errorile astea : [16:34:18] Server vehicles: 170
[16:34:18] Safezones: 15
[16:34:18] Houses: 99
[16:34:18] Clans: 1
[16:34:18] Clan zones: 20
[16:34:18] Bussines: 29
[16:34:18] Turfs: 26
[16:34:18] Factions: 13
[16:34:18] Jobs: 13
[16:34:18] Furnitures: 15
[16:34:18] Stuff Loaded
[16:34:18] Safes: 13
[16:34:18] [debug] Run time error 4: "Array index out of bounds"
[16:34:18] [debug]  Accessing element at index 25 past array upper bound 24
[16:34:18] [debug] AMX backtrace:
[16:34:18] [debug] #0 002c0ba8 in public load_apartaments () from beta.amx
[16:34:18] [debug] #1 000a2c08 in ?? () from beta.amx
[16:34:18] [debug] #2 000286b8 in public L_AFK_OnGM () from beta.amx
[16:34:18] [debug] #3 native CallLocalFunction () from samp03svr
[16:34:18] [debug] #4 00018bf8 in public SSCANF_OnGameModeInit () from beta.amx
[16:34:18] [debug] #5 00012fa8 in public Itter_OnGameModeInit () from beta.amx
[16:34:18] [debug] #6 native CallLocalFunction () from samp03svr
[16:34:18] [debug] #7 000120cc in public ScriptInit_OnGameModeInit () from beta.amx
[16:34:18] [debug] #8 00011050 in public PZone_OnGameModeInit () from beta.amx
[16:34:18] [debug] #9 native CallLocalFunction () from samp03svr
[16:34:18] [debug] #10 00006cb4 in public OnGameModeInit () from beta.amx
[16:34:18] Number of vehicle models: 64
[16:34:18] [MySQL] Dealership models: 89

 

Partajează acest post


Link spre post
Distribuie pe alte site-uri
Acum 7 minute, DiBlaine a spus:

Esti sigur ca ai pus exact cum ti-am dat eu? Am testat, functioneaza si nu primesc nicio eroare/warning in consola.

Punel in pastebin cu taburile puse ca poate am gresit eu ceva dar nu cred

Partajează acest post


Link spre post
Distribuie pe alte site-uri
Vizitator
Acest topic este acum închis pentru alte răspunsuri.

  • Navigare recentă   0 membri

    Nici un utilizator înregistrat nu vede această pagină.

×