Not showing sendername.. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Not showing sendername.. (
/showthread.php?tid=177144)
Not showing sendername.. -
HardMode - 16.09.2010
Well this emote cmd is not showing the sender name but just the actions...
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;
}
If someone can help me im apreciate..
Re: Not showing sendername.. -
Hiddos - 16.09.2010
pawn Код:
SendClientMessageToAll(COLOR_PURPLE, result);
Here you're sending the "result" string, not the "string" string. Guess that's your error, good luck
Re: Not showing sendername.. -
HardMode - 16.09.2010
Thank you Hiddos problem solved

the "string" is getting the sender name and result my bad lol "Edit"