Command Parameters
#5

Quote:
Originally Posted by TheGarfield
Посмотреть сообщение
try this.


pawn Код:
new string[100];
CMD:admin(playerid, params[])
{
    static iStr[128], player, name[24],i[30];
    if(sscanf(params[], "uss",player, i,iStr)) return false;
    if(!strcmp(i,"hi", true))
    {
        format(string, sizeof(string),"This admin %s says for you %s",GetPlayerName(playerid, name, 24), iStr);
        SendClientMessage(player, COLOR_MSG,string);
        format(string, sizeof(string),"You send %s  to %s",iStr, GetPlayerName(player, name, 24);
        SendClientMessage(playerid, COLOR_MSG, string);
    }
    if(!strcmp(i,"ann", true))
    {
        if(sscanf(params[] "s",iStr)) return false;
        format(string, sizeof(string),"%s says:%s",GetPlayerName(player, name, 24),iStr);
        SendClientMessageToAll(COLOR_MSG, string);
    }
    return 1;
}
using sscanf.
pawn Код:
if(sscanf(params, "us[24]s[30]",player, i,iStr)) return false;
Reply


Messages In This Thread
Command Parameters - by Lorenc_ - 08.05.2011, 08:30
Re: Command Parameters - by TheGarfield - 08.05.2011, 08:57
Re: Command Parameters - by Lorenc_ - 08.05.2011, 09:05
Re: Command Parameters - by TheGarfield - 08.05.2011, 09:19
Re: Command Parameters - by HyperZ - 08.05.2011, 09:29
Re: Command Parameters - by Lorenc_ - 08.05.2011, 10:06

Forum Jump:


Users browsing this thread: 1 Guest(s)