22.08.2010, 12:45
(
Последний раз редактировалось iggy1; 22.08.2010 в 13:04.
)
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,
should be
If you wana show message to all (not rp style) Jochemd' code could be further simplified to,
pawn Код:
if(strcmp(cmdtext, "/me", true) == 0)
pawn Код:
if(!strcmp(cmdtext, "/me", true) == 0)//with a '!'
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;
}