13.03.2010, 16:59
Hello!
This is my /me.
For some reasons, it is bugged and dont work.
if I type "/me"
It returns:
*** Christian_Hammer /me ***
if I type i.e "/me takes out a gun from his bag"
It returns nothing.
Help!
What is wrong?
This is my /me.
pawn Код:
if(strcmp(cmdtext, "/me", true) == 0)
{
new string[256], sendername[MAX_PLAYER_NAME];
new idx;
if(IsPlayerConnected(playerid))
{
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, COLOR_GRAD2, "USAGE: /me [action]");
return 1;
}
format(string, sizeof(string), "* %s %s", sendername, result);
}
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
printf("%s", string);
return 1;
}
if I type "/me"
It returns:
*** Christian_Hammer /me ***
if I type i.e "/me takes out a gun from his bag"
It returns nothing.
Help!
What is wrong?