PDA

View Full Version : Spectate vehicle after death


iWhite
21/05/2012, 01:42 PM
OnPlayerSpawn:
if(Died[playerid])
{
TogglePlayerSpectating(playerid, 1);
PlayerSpectateVehicle(playerid, Car, 3);
SetTimerEx("Ride", 5000, false, "i", playerid);
SendClientMessage(playerid, 0xFFFFFFFF, "Spawned");
return 1;
}

OnPlayerDeath:
if(killerid == INVALID_PLAYER_ID)
{
GameTextForPlayer(playerid,"Died",2000,2);
ResetPlayerMoneyA(playerid);
Died[playerid]=true;
SendClientMessage(playerid, 0xFFFFFFFF, "You died");
return 1;
}

After death, player isn't spectating vehicle....

These functions are on the top of callbacks


EDIT:
After death, player gains message "You died", but after spawn, he doesn't get message "Spawned"

coole210
21/05/2012, 02:46 PM
Is "Died" a bool?

Is "Car" set as a vehicle?

iWhite
21/05/2012, 03:40 PM
Yes it is


EDIT:

As I tested, OnPlayerSpawn isn't checked after death....

spedico
21/05/2012, 04:26 PM
If OnPlayerSpawn doesn't get called, make sure you have classes added. (AddPlayerClass)