Vehicle problem
#1

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;
}
Reply
#2

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

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)