10.07.2013, 13:47
Okay so Im having two problems my first one is, any class can enter the "Pilot" restricted vehicles such as the rustler, Sea Sparrow, ect.
so to combat that im using this:
now when that line says
anyone can enter the plane as long as they have a high enough score. Question: how can I make it to the point to where only pilots can enter.
problem 2: for some reason this rank system I downloaded I giving players 1 rank higher than they are supposed to be This is the code:
now the "<=" mean equal too or greater than correct? and how would I make it display their correct rank! Help would be greatly appriciated.
so to combat that im using this:
pawn Код:
if(GetVehicleModel(vehicleid) == 447 && GetPlayerScore(playerid) < 919 && gLoadout[playerid] == CLASS_PILOT)
{
SendClientMessage(playerid, COLOR_ERROR, "You need at least a Colonel rank to ride a Sea Sparrow! Use /rank to see your rank.");
SendClientMessage(playerid, COLOR_ERROR, "You also need to be a pilot to drive this vehicle, use /kill and select the 'pilot' class");
RemovePlayerFromVehicle(playerid);
}
pawn Код:
gLoadout[playerid] == CLASS_PILOT)
problem 2: for some reason this rank system I downloaded I giving players 1 rank higher than they are supposed to be This is the code:
pawn Код:
forward GetPlayerRankInfo(playerid);
public GetPlayerRankInfo(playerid)
{
new string[250];
if(GetPlayerScore(playerid) <= 0)
{
SendClientMessage(playerid, COLOR_WHITE, "Your Rank Is Trainee");
format(string, sizeof(string),"Name:%s [Your score is:%d]",pName, GetPlayerScore(playerid));
SendClientMessage(playerid, COLOR_WHITE, string);
}
else if(GetPlayerScore(playerid) <= 10)
{
SendClientMessage(playerid, COLOR_WHITE, "Your Rank Is Private");
format(string, sizeof(string),"Name:%s [Your score is:%d]",pName, GetPlayerScore(playerid));
SendClientMessage(playerid, COLOR_WHITE, string);
}
else if(GetPlayerScore(playerid) <= 100)
{
SendClientMessage(playerid, COLOR_WHITE, "Your Rank Is Corporal");
format(string, sizeof(string),"Name:%s [Your score is: %d]",pName, GetPlayerScore(playerid));
SendClientMessage(playerid, COLOR_WHITE, string);
}
else if(GetPlayerScore(playerid) <= 250)
{
SendClientMessage(playerid, COLOR_WHITE, "Your Rank Is Sergeant");
format(string, sizeof(string),"Name:%s [Your score is: %d]",pName, GetPlayerScore(playerid));
SendClientMessage(playerid, COLOR_WHITE, string);
}
else if(GetPlayerScore(playerid) <= 400)
{
SendClientMessage(playerid, COLOR_WHITE, "Your Rank Is Captain");
format(string, sizeof(string),"Name:%s [Your score is: %d]",pName, GetPlayerScore(playerid));
SendClientMessage(playerid, COLOR_WHITE, string);
}
else if(GetPlayerScore(playerid) <= 650)
{
SendClientMessage(playerid, COLOR_WHITE, "Your Rank Is Major");
format(string, sizeof(string),"Name:%s [Your score is: %d]",pName, GetPlayerScore(playerid));
SendClientMessage(playerid, COLOR_WHITE, string);
}
else if(GetPlayerScore(playerid) <= 920)
{
SendClientMessage(playerid, COLOR_WHITE, "Your Rank Is Colonel");
format(string, sizeof(string),"Name:%s [Your score is: %d]",pName, GetPlayerScore(playerid));
SendClientMessage(playerid, COLOR_WHITE, string);
}
else if(GetPlayerScore(playerid) <= 1150)
{
SendClientMessage(playerid, COLOR_WHITE, "Your Rank Is Lieutenant Colonel");
format(string, sizeof(string),"Name:%s [Your score is: %d]",pName, GetPlayerScore(playerid));
SendClientMessage(playerid, COLOR_WHITE, string);
}
else if(GetPlayerScore(playerid) <= 1500)
{
SendClientMessage(playerid, COLOR_WHITE, "Your Rank Is Lieutenant General");
format(string, sizeof(string),"Name:%s [Your score is: %d]",pName, GetPlayerScore(playerid));
SendClientMessage(playerid, COLOR_WHITE, string);
}
else if(GetPlayerScore(playerid) <= 2000)
{
SendClientMessage(playerid, COLOR_WHITE, "Your Rank Is Major General");
format(string, sizeof(string),"Name:%s [Your score is: %d]",pName, GetPlayerScore(playerid));
SendClientMessage(playerid, COLOR_WHITE, string);
}
else if(GetPlayerScore(playerid) <= 2700)
{
SendClientMessage(playerid, COLOR_WHITE, "Your Rank Is General");
format(string, sizeof(string),"Name:%s [Your score is: %d]",pName, GetPlayerScore(playerid));
SendClientMessage(playerid, COLOR_WHITE, string);
}
else if(GetPlayerScore(playerid) <= 3000)
{
SendClientMessage(playerid, COLOR_WHITE, "Your Rank Is General Of The Army");
format(string, sizeof(string),"Name:%s [Your score is: %d]",pName, GetPlayerScore(playerid));
SendClientMessage(playerid, COLOR_WHITE, string);
}
return 1;
}