SA-MP Forums Archive
Vehicle for only a specific rank - 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 for only a specific rank (/showthread.php?tid=410578)



Vehicle for only a specific rank - _Mohit_ - 26.01.2013

my gm has a rank system based on score.And i want the tank to be only driveable by rank 9(5000 score).Can anyone help me?


Re: Vehicle for only a specific rank - Glad2BeHere - 26.01.2013

do u have a rank variable otherwise

pawn Код:
new tank; // at the top

public GameModeInit()
{
 tank = CreateVehicle(info in here);
 return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == 2)
    {
        new CarCheck = GetPlayerVehicleID(playerid);
        if(CarCheck == tank )
        {
            if(GetPlayerScore(playerid) < 5000)
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, -1 ,"You Don't have the keys for this car!");
                return 1;
            }
        }
        return 1;
    }
    return 1;
}



Re: Vehicle for only a specific rank - _Mohit_ - 26.01.2013

it worked bro..Tnx for the help..+reped