help pls
#6

Tanush i thought i told you.

pawn Код:
if(GetPlayerMoney(playerid) < WHAT EVER HERE))return SendClientMessage(playerid,COLOR,"You need whatever to buy thhis");
Example :

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.
Reply


Messages In This Thread
help pls - by tanush - 01.03.2011, 23:54
Re: help pls - by Antonio [G-RP] - 01.03.2011, 23:58
Re: help pls - by tanush - 02.03.2011, 00:07
Re: help pls - by mprofitt - 02.03.2011, 00:09
Re: help pls - by tanush - 02.03.2011, 00:14
Re: help pls - by Tee - 02.03.2011, 00:20
Re: help pls - by Antonio [G-RP] - 02.03.2011, 00:20
Re: help pls - by tanush - 02.03.2011, 00:28
Re: help pls - by Antonio [G-RP] - 02.03.2011, 00:30
Re: help pls - by Mean - 02.03.2011, 09:29

Forum Jump:


Users browsing this thread: 1 Guest(s)