/transfer cmd
#8

pawn Код:
CMD:transfer(playerid, params[])
{
    new Target[MAX_PLAYER_NAME], amount, name[MAX_PLAYER_NAME], bool:found;
    if(sscanf(params, "s[MAX_PLAYER_NAME]d",  Target, amount))
    return SendClientMessage(playerid, -1, "USAGE: /transfer [Exact_Name] [amount]");
    for( new i = 0; i <= MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            GetPlayerName(i, name, sizeof(name));
            if(strcmp(Target, name) == 0)
            {
                found = true;
                // You command here..
            }
        }
    }
    if(found == false) return SendClientMessage(playerid, -1, "ERROR: Use the exact player name!");
    return 1;
}
Not tested, was written in this chat, please try and reply here if it works.

NOTE: You need ZCMD and sscanf
Reply


Messages In This Thread
/transfer cmd - by Yako - 04.03.2013, 05:02
Re: /transfer cmd - by Kathleen - 04.03.2013, 05:35
Re: /transfer cmd - by Yako - 04.03.2013, 09:56
Re: /transfer cmd - by Doughty - 04.03.2013, 10:53
Re: /transfer cmd - by Yako - 04.03.2013, 19:05
Re: /transfer cmd - by Kathleen - 15.03.2013, 17:02
Re : /transfer cmd - by morocco - 15.03.2013, 17:05
Re: /transfer cmd - by Denying - 15.03.2013, 17:37

Forum Jump:


Users browsing this thread: 3 Guest(s)