30.09.2017, 17:54
Ok, so I have this :
- ok, so this is when the player will request the vehicle.
- these are the fuctions for destroying the vehicle after 5 seconds if the player is not inside
But it's not working. What did I do wrong ?
- ok, so this is when the player will request the vehicle.
Код:
case 0:
{
GetPlayerFacingAngle(playerid, angle);
GetPlayerPos(playerid, x, y, z);
ticau_veh1 = CreateVehicle(481, x, y, z, angle, 144, 145, 125, 0);
PutPlayerInVehicle(playerid,ticau_veh1,0);
vehicleid = GetPlayerVehicleID(playerid);
i[playerid] = 1;
reset1(playerid);
delay(playerid, vehicleid);
return 1;
}
Код:
public delay(playerid, vehicleid)
{
SetTimerEx("destroy_veh", 5000, 1, "d");
}
public destroy_veh(playerid, vehicleid)
{
if(IsPlayerInVehicle(playerid, vehicleid)==1)
{
delay(playerid, vehicleid);
}
else
{
DestroyVehicle(vehicleid);
}
}

