Class/Rank Vehicle System.
#1

It was well good working when it only included limits score.
There is 3 classes. I want only allow class 1 to drive heavy vehicles.
After testing, class 1 can drive heavy vehicles with any scores and class 2 and 3 are able to drive it above the required score.




Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    new Sparrow = GetVehicleModel(GetPlayerVehicleID(playerid));
    if(GetPlayerScore(playerid) < 150 && PickedClass[playerid] !=1) {
		if(Sparrow == 447) {
			SendClientMessage(playerid, COLOR_RED, "ERROR: You need to be LIEUTENANT and ASSAULT to Pilot this vehicle.");
			new Float:x, Float:y, Float:z;
	 	    GetPlayerPos(playerid, x, y, z); SetPlayerPos(playerid,x,y,z+1);
		}
    }
    new Rhino = GetVehicleModel(GetPlayerVehicleID(playerid));
    if(GetPlayerScore(playerid) < 300 && PickedClass[playerid] != 1) {
		if(Rhino == 432) {
			SendClientMessage(playerid, COLOR_RED, "ERROR: You need to be MAJOR AND Assualt to Pilot this vehicle.");
			new Float:x, Float:y, Float:z;
	 	    GetPlayerPos(playerid, x, y, z); SetPlayerPos(playerid,x,y,z+1);
		}
    }
	new Hydra = GetVehicleModel(GetPlayerVehicleID(playerid));
	if(GetPlayerScore(playerid) < 750 && PickedClass[playerid] != 1) {
		if(Hydra == 520) {
			SendClientMessage(playerid, COLOR_RED, "ERROR: You need to be COLONEL AND Assualt to Pilot this vehicle.");
			new Float:x, Float:y, Float:z;
	 	    GetPlayerPos(playerid, x, y, z); SetPlayerPos(playerid,x,y,z+1);
	 	}
	 	
	}
	new Hunter = GetVehicleModel(GetPlayerVehicleID(playerid));
	if(GetPlayerScore(playerid) < 750 && PickedClass[playerid] != 1) {
		if(Hunter == 425) {
			SendClientMessage(playerid, COLOR_RED, "ERROR: You need to be COLONEL AND Assualt to Pilot this vehicle.");
			new Float:x, Float:y, Float:z;
	 	    GetPlayerPos(playerid, x, y, z); SetPlayerPos(playerid,x,y,z+1);
		}
	}
Reply
#2

you need to remove him from vehicle? use RemovePlayerFromVehicle(playerid);
Reply
#3

Quote:
Originally Posted by dEcooR
Посмотреть сообщение
you need to remove him from vehicle? use RemovePlayerFromVehicle(playerid);
Код:
	new Float:x, Float:y, Float:z;
	 	    GetPlayerPos(playerid, x, y, z); SetPlayerPos(playerid,x,y,z+1);
it was working fine with score limits only, it changed after i added classes.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)