/me command help
#1

everyone on the server can see when someone types in a /me and i want that only the ppl in range of the player can see it
Reply
#2

code?
Reply
#3

if(!strcmp(cmdtext, "/me", true, 3)) // 3 is the length of /me
{
if(!cmdtext[3])return SendClientMessage(playerid, 0xFEFEFEFF, "USAGE: /me [action]");
new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
SendClientMessageToAll(0xFFFF00AA, str);
return 1;
}
Reply
#4

You have SendClientMessageToAll, change that to SendClientMessage only...


Try with this...
Код:
if(!strcmp(cmdtext, "/me", true, 3)) // 3 is the length of /me
{
if(!cmdtext[3])return SendClientMessage(playerid, 0xFEFEFEFF, "USAGE: /me [action]");
new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
SendClientMessage(0xFFFF00AA, str);
return 1;
}
REP + If i helped you
Reply
#5

https://sampforum.blast.hk/showthread.php?tid=336052

Use this.
Reply
#6

it is my code
if(strcmp(cmdtext, "/me", true, 3)==0)
{
new pname1[24], string[256];
GetPlayerName(playerid, pname1, 24);
format(string, 256, "{762B76}*** {FFFFFF}%s {762B76}%s", pname1, cmdtext[4]);
SendClientMessageToAll(0xFFFFFFAA , string);
return 1;
}
Reply
#7

use

Код:
it is my code
if(strcmp(cmdtext, "/me", true, 3)==0)
{
new pname1[24], string[256];
GetPlayerName(playerid, pname1, 24);
format(string, 256, "{762B76}*** {FFFFFF}%s {762B76}%s", pname1, cmdtext[4]);
SendClientMessage(0xFFFFFFAA , string);
return 1;
}
Reply
#8

Quote:
Originally Posted by NeroX98
Посмотреть сообщение
You have SendClientMessageToAll, change that to SendClientMessage only...


Try with this...
Код:
if(!strcmp(cmdtext, "/me", true, 3)) // 3 is the length of /me
{
if(!cmdtext[3])return SendClientMessage(playerid, 0xFEFEFEFF, "USAGE: /me [action]");
new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
SendClientMessage(0xFFFF00AA, str);
return 1;
}
REP + If i helped you
if i do that i get an error it says Type mismatch
Reply
#9

it is 100% working but you can change the colors i mean usethis way (using only one color) :
if(strcmp(cmdtext, "/me", true, 3)==0)
{
new pname1[24], string[256];
GetPlayerName(playerid, pname1, 24);
format(string, 256, "{762B76}*** %s %s", pname1, cmdtext[4]);
SendClientMessage(0xFFFFFFAA , string);
return 1;
}
Reply
#10

i always get errors cus of this line:

format(string, 256, "{762B76}*** %s %s", pname1, cmdtext[4]);
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)