07.07.2014, 10:37
(
Последний раз редактировалось cnoopers; 07.07.2014 в 11:08.
)
should spawn car when bool value is true and if false, unspawn but vehicle always spawn
whats wrong
//edit
so if i add sendclientmessage after true or false such as 'vehicle spawned' or 'vehicle unspawned' it will be displayed correctly.
whats wrong
Код:
new bool:veh1spawned[MAX_PLAYERS]; //global new Float:x, Float:y, Float:z, Float:angle; new Float:x2, Float:y2; new vehid[MAX_PLAYERS]; //case in dialog response if(veh1spawned[playerid] == false) { veh1spawned[playerid] = true; GetXYInFrontOfPlayer(playerid, x, y, 10.0); GetPlayerPos(playerid, x2, y2, z); GetPlayerFacingAngle(playerid, angle); vehid[playerid] = CreateVehicle(Veh1[playerid], x, y, z, angle+90, 0, 0, -1); SetPVarInt(playerid, "veh1spawned", Veh1[playerid]); }else if(veh1spawned[playerid] == true) { veh1spawned[playerid] = false; DestroyVehicle(vehid[playerid]); } //opc if(veh1spawned[playerid] == true) { veh1spawned[playerid] = false; DestroyVehicle(GetPVarInt(playerid, "Veh1spawned")); } //opd if(veh1spawned[playerid] == true) { veh1spawned[playerid] = false; DestroyVehicle(GetPVarInt(playerid, "Veh1spawned")); }
so if i add sendclientmessage after true or false such as 'vehicle spawned' or 'vehicle unspawned' it will be displayed correctly.