16.09.2010, 15:47
Well this emote cmd is not showing the sender name but just the actions...
here is my code
If someone can help me im apreciate..
here is my code
pawn Код:
if(strcmp(cmd, "/me", true) == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, GREEN, "USAGE: /me [action]");
return 1;
}
format(string, sizeof(string), "* %s %s", sendername, result);
printf("%s", string);
SendClientMessageToAll(COLOR_PURPLE, result);
return 1;
}