SA-MP Forums Archive
OnPlayerEnterVehicle to StateChange - 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)
+--- Thread: OnPlayerEnterVehicle to StateChange (/showthread.php?tid=503363)



OnPlayerEnterVehicle to StateChange - Mriss - 29.03.2014

Could someone edit my OnPLayerEnterVehicle
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    for(new i = 0; i < 12; i++)
    {
        new pFac = PlayerInfo[playerid][pMember];
        if(vehicleid == LSPDVehicles[i])
        {
            if(pFac != 1)
            {
                ClearAnimations(playerid);
                SendClientMessage(playerid, -1, "You don`t have the keys for this car.");
            }
        }
    }
    return 1;
}
And make it not let them inside if they try to drive it, but passengers allowed..

Make into ONPlayerStateChange


Re: OnPlayerEnterVehicle to StateChange - Mriss - 29.03.2014

+REP for helper


Re: OnPlayerEnterVehicle to StateChange - EiresJason - 29.03.2014

pawn Код:
if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
    {
            new vehicleid = GetPlayerVehicleID(playerid);
        for(new i = 0; i < 12; i++)
        {
            new pFac = PlayerInfo[playerid][pMember];
            if(vehicleid == LSPDVehicles[i])
            {
                if(pFac != 1)
                {
                    ClearAnimations(playerid);
                    SendClientMessage(playerid, -1, "You don`t have the keys for this car.");
                }
            }
        }
    }



Re: OnPlayerEnterVehicle to StateChange - Mriss - 29.03.2014

Millenium.pwn(427) : error 017: undefined symbol "vehicleid"


Re: OnPlayerEnterVehicle to StateChange - EiresJason - 29.03.2014

Ops, sorry. I edited my original post.