/me isn't working - 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 isn't working (
/showthread.php?tid=255514)
/me isn't working -
Jonteh - 15.05.2011
pawn Код:
if(strcmp(cmd, "/me", true) == 0)
{
if(IsLogged[playerid] == 1)
{
new pname[24], str[128];
GetPlayerName(playerid, pname, 24);
if(PlayerInfo[playerid][MaskOn] == 1)
{
format(str, sizeof(str), "Stranger %s", str);
}
else
{
format(str, sizeof(str), "%s %s", pname, str);
}
ProxDetector(10.0, playerid, str, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
}
else
{
SendClientMessage(playerid, COLOR_ERRORRED, "SERVER: You need to be logged in to use this command!");
}
}
It just displays their name or "stranger", no second part.
Re: /me isn't working -
NRJ53 - 15.05.2011
Are you using Strtok?
Re: /me isn't working -
lowrida018 - 15.05.2011
Try this:
Код:
if(strcmp(cmd, "/me", true) == 1)
{
if(IsLogged[playerid] == 1)
{
new pname[24], str[128];
GetPlayerName(playerid, pname, 24);
if(PlayerInfo[playerid][MaskOn] == 1)
{
format(str, sizeof(str), "Stranger %s", str);
}
else
{
format(str, sizeof(str), "%s %s", pname, str);
}
ProxDetector(10.0, playerid, str, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
}
else
{
SendClientMessage(playerid, COLOR_ERRORRED, "SERVER: You need to be logged in to use this command!");
}
}
Re: /me isn't working -
Naruto_Emilio - 15.05.2011
pawn Код:
if(!strcmp(cmdtext, "/me", true, 3))
{
if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [ACTION]");
new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInRangeOfPoint(i, 40.0, x, y, z))
{
SendClientMessage(i, COLOR_LIME, str);
}
}
}
return 1;
}
Try my code
Re: /me isn't working -
lowrida018 - 15.05.2011
Quote:
Originally Posted by Naruto_Emilio
pawn Код:
if(!strcmp(cmdtext, "/me", true, 3)) { if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [ACTION]"); new str[128]; GetPlayerName(playerid, str, sizeof(str)); format(str, sizeof(str), "* %s %s", str, cmdtext[4]); new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); for(new i=0; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(IsPlayerInRangeOfPoint(i, 40.0, x, y, z)) { SendClientMessage(i, COLOR_LIME, str); } } } return 1; }
Try my code 
|
You copied that off a admin script, witch needs Includes.
Re: /me isn't working -
Jonteh - 15.05.2011
Quote:
Originally Posted by Naruto_Emilio
pawn Код:
if(!strcmp(cmdtext, "/me", true, 3)) { if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [ACTION]"); new str[128]; GetPlayerName(playerid, str, sizeof(str)); format(str, sizeof(str), "* %s %s", str, cmdtext[4]); new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); for(new i=0; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(IsPlayerInRangeOfPoint(i, 40.0, x, y, z)) { SendClientMessage(i, COLOR_LIME, str); } } } return 1; }
Try my code 
|
Thanks matey. Do you have msn by any chance? I'm pushing a big project.
Re: /me isn't working -
Jonteh - 15.05.2011
Quote:
Originally Posted by lowrida018
You copied that off a admin script, witch needs Includes.
|
I rewrote it any way, to look like this:
pawn Код:
if(!strcmp(cmdtext, "/me", true, 3))
{
if(!cmdtext[3])return SendClientMessage(playerid, COLOR_ERRORRED, "USAGE: /me [ACTION]");
new str[128];
GetPlayerName(playerid, str, sizeof(str));
if(PlayerInfo[playerid][MaskOn] == 1)
{
format(str, sizeof(str), "* Stranger %s", cmdtext[4]);
}
else
{
format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
}
ProxDetector(10.0, playerid, str, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
return 1;
}
Does anyone have that purple colour that most servers use in /me?
Re: /me isn't working -
Naruto_Emilio - 15.05.2011
Yes lemme pm it to you
Re: /me isn't working -
lowrida018 - 15.05.2011
Quote:
Originally Posted by Jonteh
Thanks matey. Do you have msn by any chance? I'm pushing a big project.
|
I can help with it.
Re: /me isn't working -
Jonteh - 15.05.2011
Quote:
Originally Posted by lowrida018
I can help with it.
|
Sounds good. My MSN is
jontycat@zaphotel.net