Jump to content

[REZOLVAT] Cateva intrebari ?


LastGuards
 Share

Recommended Posts

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.");

 

Edited by DiBlaine
Link to comment
Share on other sites

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.

Edited by DiBlaine
Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...