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



Vehicle problem - Ananisiki - 25.04.2013

This ejects admins from the vehicle but not normal players, i want so the non-admin person gets ejected when entering one of these vehicles.


pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER && GetVehicleModel(GetPlayerVehicleID(playerid) == 432 || 520 || 425 || 441 || 464 || 465 || 501 || 564 || 594 || 447 || 449 || 537 || 538 || 539 || 557 || 592 || 601 || 604 || 605))
    {
        if(!IsPlayerLAdmin(playerid))
        {
            RemovePlayerFromVehicle(playerid);
            GameTextForPlayer(playerid, "~r~this is an admin vehicle~n~~p~ejected", 5000, 3);
        }
    }
    return 1;
}



AW: Vehicle problem - HurtLocker - 25.04.2013

What does the isplayerLadmin function do? Obviously, there's something wrong about it.


Re: AW: Vehicle problem - dannyk0ed - 25.04.2013

Quote:
Originally Posted by HurtLocker
Посмотреть сообщение
What does the isplayerLadmin function do? Obviously, there's something wrong about it.
It's a include.


Re: Vehicle problem - Pottus - 25.04.2013

This made me laugh.

pawn Код:
if(newstate == PLAYER_STATE_DRIVER && GetVehicleModel(GetPlayerVehicleID(playerid) == 432 || 520 || 425 || 441 || 464 || 465 || 501 || 564 || 594 || 447 || 449 || 537 || 538 || 539 || 557 || 592 || 601 || 604 || 605))
Now it can be

pawn Код:
if(newstate == PLAYER_STATE_DRIVER && IsAdminVehicle(GetVehicleModel(GetPlayerVehicleID(playerid))))
With this

pawn Код:
stock IsAdminVehicle(vmodel)
{
    switch(vmodel)
    {
        case 432: { return 1; }
        case 520: { return 1; }
        case 425: { return 1; }
        case 441: { return 1; }
        case 464: { return 1; }
        case 465: { return 1; }
        case 501: { return 1; }
        case 564: { return 1; }
        case 594: { return 1; }
        case 447: { return 1; }
        case 449: { return 1; }
        case 537: { return 1; }
        case 538: { return 1; }
        case 539: { return 1; }
        case 557: { return 1; }
        case 592: { return 1; }
        case 601: { return 1; }
        case 604: { return 1; }
        case 605: { return 1; }
    }
    return 0;
}
Looks like more Raven's Roleplay monkey coding to me.