Tanush i thought i told you.
pawn Код:
if(GetPlayerMoney(playerid) < WHAT EVER HERE))return SendClientMessage(playerid,COLOR,"You need whatever to buy thhis");
Example
![Cheesy](images/smilies/biggrin.png)
:
pawn Код:
CMD:ban(playerid, params[])
{
new id, reason[64];
if(GetPlayerMoney(playerid) < 200))return SendClientMessage(playerid,COLOR,"You need $200 to use this command");
if(sscanf(params, "us[64", id, reason)) return SendClientMessage(playerid, -1, "USAGE: /ban [id] [reason]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "That player isn't connected!");
if(IsPlayerAdmin(playerid))
{
new name[MAX_PLAYER_NAME];
GetPlayerName(id, name, sizeof(name));
new string[128];
format(string, sizeof(string), "%s was banned for %s", name, reason);
SendClientMessageToAll(-1, string);
Ban(id);
}
else {
SendClientMessage(playerid, -1, "You aren't admin!");
}
return 1;
}
I added it to the Ban command.
Explanation:
if - It makes a decission. Like if(IsThePlayer'sMone*****Than 200?) <--That is not a function in pawn just an example
GetPlayerMoney(playerid) - Gets the players holding cash.
< - That sign means less than. So if(IsThePlayer'sMoney < 200?)
I don't know if you understand.
Also
this link may help you.
Tan also in sscanf never use "i" for playerid always use "u". What "u" does is if you type /ban tan. It will ban "tan" but if you use "i" and type /ban tan it will return Unknown Command. The "u" looks for the player that you type or the 1st letter in the players name and execute the command.