What is wrong with this
#1

hey guys what is wrong with this..
:
pawn Код:
if(!strcmp(pname, "Blacklisted_Bboy",sizeof(pname)))
  {
  format(string,sizeof(string),"[OWNER]%s:%s",pname,text);
  SendClientMessageToAll(-1,string);
  }
because it shows me a warning..
its under OnPlayerText callback

warning:tag mismatch on this line:
pawn Код:
if(!strcmp(pname,"Blacklisted_Bboy",sizeof(pname)))
Reply
#2

Look this:
https://sampwiki.blast.hk/wiki/Strcmp
pawn Код:
if(!strcmp(pname, "Blacklisted_Bboy", true, strlen(pname)))
Reply
#3

You forgot the case:
pawn Код:
if(!strcmp(pname, "Blacklisted_Bboy", true, sizeof(pname)))
{
    format(string, sizeof(string), "[OWNER]%s:%s", pname, text);
    SendClientMessageToAll(-1, string);
}
I set to true, change if you want it different.

EDIT: LeNy was faster.
Reply
#4

// Too late
Reply
#5

Quote:
Originally Posted by LeNy
Посмотреть сообщение
Look this:
https://sampwiki.blast.hk/wiki/Strcmp
pawn Код:
if(!strcmp(pname, "Blacklisted_Bboy", true, strlen(pname)))
this still shows the same warning with ryder's suggestion is compiling very well but it shows the text 2 times.. :P
Reply
#6

Show your code
Reply
#7

pawn Код:
new pname[MAX_PLAYER_NAME];
new string[256];
GetPlayerName(playerid,pname,sizeof(pname));
  if(!strcmp(pname, "Blacklisted_Bboy", true,sizeof(pname)))
  {
  format(string,sizeof(string),"[OWNER]%s:%s",pname,text);
  SendClientMessageToAll(-1,string);
  }
Reply
#8

Add "return 0;" under SendClientMessageToAll.
Reply
#9

thx [solved]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)