22.08.2010, 14:28
I am trying to make my spec system detect when a player goes into a car, and the person specing them will spec the car. Once the person in the car gets out, I spec them, instead of the car. Here's my current code, No errors..Just doesn't work.
pawn Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if(newstate == 2)
{
// TextDrawShowForPlayer(playerid, Textdraw0[playerid]); Don't mind this..
if(AccountInfo[playerid][Spec] == 1)
{
new sid = AccountInfo[playerid][Specer];
new vid = GetPlayerVehicleID(playerid);
PlayerSpectateVehicle(sid, vid);
}
}
if(newstate == 1 && oldstate == 2)
{
// TextDrawHideForPlayer(playerid, Textdraw0[playerid]); Don't mind this
if(AccountInfo[playerid][Spec] == 1)
{
new sid = AccountInfo[playerid][Specer];
PlayerSpectatePlayer(sid, playerid);
}
}
return 1;
}