newstate == Foot can't respawn vehicle?
#1

i can't use SetVehicleToRespawn(GetplayerVehicleid(playerid); on onplayerstate how can i make it works
Reply
#2

Create a new global variable, something like
Код:
 new gCarID[MAX_PLAYERS];
And check
Код:
if(newstate == PLAYER_STATE_DRIVER) gCarID[playerid] = GetPlayerVehicleID(playerid);
And then
Код:
if(newstate == PLAYER_STATE_ONFOOT && oldstate == PLAYER_STATE_DRIVER) SetVehicleToRespawn(gCarID[playerid]);
gCarID[playerid] = INVALID_VEHICLE_ID;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)