23.04.2014, 00:09
So i am making a roleplay script and i can't figure out how to make a vehicle stay in the same place when a player left the server any hints or tips?
enum vehicles{
Float:vX,
Float:vY,
Float:vZ
}
new LastPos[MAX_VEHICLES][vehicles];
public OnPlayerDisconnect(playerid,reason)
{
new vid = GetPlayerVehicleID(playerid),
Float:x,
Float:y,
Float:z
;
GetPlayerPos(playerid,x,y,z);
if(vid != INVALID_VEHICLE_ID)
{
LastPos[vid][vX] = x;
LastPos[vid][vY] = y;
LastPos[vid][vZ] = z;
}
return 1;
}