pls help me with my string :)
#3

I'll write out the command, give me two minutes, and i'll edit the post.

pawn Код:
cmd(afk, playerid, params[])
{
    new string[128], name[MAX_PLAYER_NAME], minute, reason[128];
    if(!sscanf(params, "is", minutes, reason))
    {
      GetPlayerName(playerid, name, sizeof(name));
      format(string,sizeof(string),"%s is away from keyboard for %i minutes (Reason: %s)",name,minutes,reason);
      SendClientMessageToAll(0xFF0000AA,string);
    }
    else return SendClientMessage(playerid,0xFF0000AA,"Usage: /afk <minutes> <reason>");
    return 1;
}
The thing that you did wrong: You need to define reason as a string.

Yours:
pawn Код:
new reason;
Correct:
pawn Код:
new reason[128];
Reply


Messages In This Thread
pls help me with my string :) - by KIDUL - 10.11.2009, 14:58
Re: pls help me with my string :) - by KIDUL - 10.11.2009, 16:04
Re: pls help me with my string :) - by (.Aztec); - 10.11.2009, 16:06
Re: pls help me with my string :) - by KIDUL - 10.11.2009, 16:12
Re: pls help me with my string :) - by KIDUL - 10.11.2009, 16:23
Re: pls help me with my string :) - by oncedead - 10.11.2009, 16:31

Forum Jump:


Users browsing this thread: 2 Guest(s)