SA-MP Forums Archive
OnPlayerStateChange - 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: OnPlayerStateChange (/showthread.php?tid=96529)



OnPlayerStateChange - ilikepie2221 - 08.09.2009

Concerning OnPlayerStateChange, I know there is no way to naturally get it from the callback. Can someone help me get the vehicleid using this callback anyways?

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == 2)
    {
        if((vehicleid == Bcar1||vehicleid == Bcar2||vehicleid == Bcar3||vehicleid == Bcar4) && ispassenger == 0) SendClientMessage(playerid, COLOR_CYAN, "This is a B-license test vehicle")
        else if((vehicleid == Acar1||vehicleid == Acar2) && ispassenger == 0) SendClientMessage(playerid, COLOR_CYAN, "This is an A-license test vehicle")
        else
        {
            if(pLicensesInfo[playerid] == 'A'||pLicensesInfo[playerid] == 'B') SendClientMessage(playerid, COLOR_GREEN, "Stay careful while driving!")
            else if(pLicensesInfo[playerid] == 0) SendClientMessage(playerid, COLOR_WHITE, "You do not have a drivers license! Look out for cops!")
        }
    }
}
Some help?


Re: OnPlayerStateChange - Nero_3D - 08.09.2009

GetPlayerVehicleID