15.08.2011, 21:58
pawn Код:
if (strcmp("/nitro", cmdtext, true, 10) == 0)
{
if(GetPlayerScore(playerid) < 100) // checks if your playerscore is lower then 100
{
AddVehicleComponent(GetPlayerVehicleID(playerid), 1009); // This is 2x nitro
SendClientMessage(playerid, COLOR_RED, " You have add Nitro!");
}
return 1;
}
Edit:
This is one is to all players: just saw that you needed it aswell
pawn Код:
if (strcmp("/nitro", cmdtext, true, 10) == 0)
{
if(GetPlayerScore(playerid) < 100) // checks if your playerscore is lower then 100
{
for(new i = 0; i < MAX_PLAYERS; i++) // This loops through all players
{
if(GetPlayerScore(i) < 100) // Gets the score of everyone and checks if its lower then 100
{
new string[128], name[24];
GetPlayerName(playerid, name, 24);
format(string, sizeof string, "%s sended nitro to you! Sadly, you dont have 100 score, so no nitro for you.", name);
SendClientMessage(i, -1, string);
} else { // If the score is higher as 100, this gets excecuted
AddVehicleComponent(GetPlayerVehicleID(i), 1009);
new string[128], name[24];
GetPlayerName(playerid, name, 24);
format(string, sizeof string, "%s sended nitro to you! Say thanks to him :\)", name);
SendClientMessage(i, -1, string);
}
}
} else return SendClientMessage(playerid, -1, "You cant use this command, you need 100 score for this");
return 1;
}