Spec Questions\Problems - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Spec Questions\Problems (
/showthread.php?tid=170272)
Spec Questions\Problems -
ScottCFR - 22.08.2010
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;
}