Help with this GetPlayerName Cmd
#1

well i got this code

//AT THE TOP
new bool:Bros[MAX_PLAYERS];
Код:
	
  if(strcmp(cmd, "/brothers", true) == 0)
  {
    new PLName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, PLName, sizeof(PLName));
    if(strcmp(PLName, "North", true) || strcmp(PLName, "Sonic", true))
    {
	  if(Bros == false)
	  {
  	    Bros = true;
      	MoveObject(corleonegate1, -2118.17, -80.35, 35.17,2);
      	MoveObject(corleonegate2, -2137.14, -80.35, 35.17,2);
      	SendClientMessage(playerid, COLOR_RED,"Gates Open");
      }
      else if(Bros == true)
    	  {
	    Bros = false;
      	MoveObject(corleonegate1, -2123.17, -80.35, 35.17,2);
      	MoveObject(corleonegate2, -2131.14, -80.35, 35.17,2);
      	SendClientMessage(playerid, COLOR_RED,"Gates Closed");
	  }
    }
 	else
	{
      SendClientMessage(playerid, COLOR_RED, "Sorry My Friend CMD Not For You ^^!");
	}
	return 1;
  }
but when i type this cmd with another nick it works too, its supposed tu work just for North And Sonic... help please?
Reply
#2

Why don't u create a variable like GetPlayerBrothers and use dubd to save it and reload it on login ?
Reply
#3

Replace this:
Код:
if(strcmp(PLName, "North", true) || strcmp(PLName, "Sonic", true))
With this:
Код:
if(!strcmp(PLName, "North", true) || !strcmp(PLName, "Sonic", true))
Reply
#4

Quote:
Originally Posted by ev0lutionnn
Replace this:
Код:
if(strcmp(PLName, "North", true) || strcmp(PLName, "Sonic", true))
With this:
Код:
if(!strcmp(PLName, "North", true) || !strcmp(PLName, "Sonic", true))
ok thanks it worked ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)