#3

I use zcmd and sscanf so i don't know what ur errors are but 2 things i spotted, the string is 2x to large it should be 128. And,
pawn Код:
if(strcmp(cmdtext, "/me", true) == 0)
should be
pawn Код:
if(!strcmp(cmdtext, "/me", true) == 0)//with a '!'
If you wana show message to all (not rp style) Jochemd' code could be further simplified to,

pawn Код:
dcmd_me(playerid,params[])
{
    new string[128],Playername[MAX_PLAYER_NAME],action[104];
    if(sscanf(params,"s[104]",action)) return SendClientMessage(playerid,COLOR_RED,"* Syntax Error: /me [action]");
    else
    {
        GetPlayerName(playerid,Playername,sizeof(Playername));
        format(string,sizeof(string),"* %s %s",Playername,action);
        SendClientMessageToAll(COLOR_LIGHTGREY,string);
    }
    return 1;
}
Reply


Messages In This Thread
/me - by GangsTa_ - 22.08.2010, 12:37
Re: /me - by Jochemd - 22.08.2010, 12:42
Re: /me - by iggy1 - 22.08.2010, 12:45
Re: /me - by GangsTa_ - 22.08.2010, 16:00
Re: /me - by [XST]O_x - 22.08.2010, 16:16
Re: /me - by GangsTa_ - 23.08.2010, 09:30
Re: /me - by Hiddos - 23.08.2010, 09:51
Re: /me - by Vince - 23.08.2010, 10:43

Forum Jump:


Users browsing this thread: 1 Guest(s)