07.07.2014, 14:08
try looping it
pawn Код:
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"));
}
}