How can i make this so only "BLANK" can use the cmd.
#1

Код:
	else if(strcmp(PlayerName,"BLANK",true))
I''ve tried it, but everyone can use the command.
Reply
#2

If you read the documentation, you can see that strcmp returns not 1 when it's correct.

try this:
pawn Код:
else if(!strcmp(PlayerName,"BLANK",true))
the ! means that's not 1 :P

And BTW: make sure that PlayerName contains the playername.
Reply
#3

Quote:
Originally Posted by Doom (NoZer0)
If you read the documentation, you can see that strcmp returns not 1 when it's correct.

try this:
pawn Код:
else if(!strcmp(PlayerName,"BLANK",true))
the ! means that's not 1 :P

And BTW: make sure that PlayerName contains the playername.
What do you mean by:
Код:
And BTW: make sure that PlayerName contains the playername.
at the top of it, i have :
Код:
  new PlayerName[24];
  GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
Reply
#4

Код:
new PlayerName[24];
Код:
if(!strcmp(cmdtext, "/command" ,true))
{
if(strcmp(PlayerName,"BLANK",true))
     {
//your command goes here
}
return 1;
}
untested but it will work fine
Reply
#5

I just need to know what will work, since you 2 gave me different things, it's weird.

pawn Код:
else if(strcmp(PlayerName,"BLANK",true))
    {
      if (PlayerToPoint(15, playerid,174.788970,-1350.784301,68.365165))
      {
       //command.
      }
      else { SendClientMessage(playerid, COLOR_GREY,"Destination is too far."); }
    }
So, how should i edit that ?
Reply
#6

Quote:
Originally Posted by NewYorkRP
I just need to know what will work, since you 2 gave me different things, it's weird.

pawn Код:
else if(strcmp(PlayerName,"BLANK",true))
    {
      if (PlayerToPoint(15, playerid,174.788970,-1350.784301,68.365165))
      {
       //command.
      }
      else { SendClientMessage(playerid, COLOR_GREY,"Destination is too far."); }
    }
pawn Код:
else if(!strcmp(PlayerName,"BLANK",true))
    {
      if (PlayerToPoint(15, playerid,174.788970,-1350.784301,68.365165))
      {
       //command.
      }
      else { SendClientMessage(playerid, COLOR_GREY,"Destination is too far."); }
    }
So, how should i edit that ?
so, try replace that piece with my piece of code.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)