How to make Vehicles set to a team?
#1

How can i make a certain class/team only be able to drive a certain vehicle?

Thanks in advanced
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=160810
have fun.
Reply
#3

Here's an example of doing it with OnPlayerStateChange.

pawn Код:
new restrictedvehicle;

public OnGameModeInit()
{
    restrictedvehicle = CreateVehicle(blablabla...);
    return 1;
}

public OnPlayerStateChange(playerid,newstate,oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        if(GetPlayerTeam(playerid) != TEAM_WHATEVER && GetPlayerVehicleID(playerid) == restrictedvehicle)
        {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid,red,"You are not allowed to drive that vehicle");
        }
    }
    return 1;
}
Reply
#4

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
Here's an example of doing it with OnPlayerStateChange.

pawn Код:
new restrictedvehicle;

public OnGameModeInit()
{
    restrictedvehicle = CreateVehicle(blablabla...);
    return 1;
}

public OnPlayerStateChange(playerid,newstate,oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        if(GetPlayerTeam(playerid) != TEAM_WHATEVER && GetPlayerVehicleID(playerid) == restrictedvehicle)
        {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid,red,"You are not allowed to drive that vehicle");
        }
    }
    return 1;
}
tyvm

PS. soz for the double post...wont appn again ay
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)