/me command need help - 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: /me command need help (
/showthread.php?tid=80745)
/me command need help -
Guardian - 06.06.2009
I need help on how to script the /me command
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/me", true, 3)) // 3 is the length of /me
{
if(cmdtext[3] == 0) {
SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [action]");
return 1;
}
new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
SendClientMessageToAll(0xFFFF00AA, str);
return 1;
}
return 0;
}
I want this command but i don't know where to put it and how. Can some one tell me how?
Step by step please.
Re: /me command need help -
lavamike - 06.06.2009
public OnPlayerCommandText(playerid, cmdtext[])
is a callback.
Whenever you type something with a / in front SA:MP goes to that.
You should be able to paste your code in and it would work unless you have another OnPlayerCommandText in your script, try and figure it out, if you can't post the compiler's results here
Re: /me command need help -
russiany - 06.06.2009
use strtok
Re: /me command need help -
Abernethy - 06.06.2009
Post your script in Pastebin, than I'll do it for you.