[HELP]/mask command not working properly
#1

Well when i do /mask it is suppose to turn on mask ok dat works but if i have the mask on and i do /mask it is suppose to take off the mask but it doesnt heres my command
Код:
 	if(strcmp(cmd, "/mask", true) == 0) // by LordMan
	{
	  if(IsPlayerConnected(playerid))
	  {
	  	if(PlayerInfo[playerid][pMask] < 0)
	  	{

	    		SendClientMessage(playerid, COLOR_GRAD1, " You must be level 5.");
	    	return 1;
	  	}
	  		if(PlayerInfo[playerid][pLevel] < 5)
	  	{
	    		SendClientMessage(playerid, COLOR_GRAD1, " You are not able to use it.");
	    	return 1;
	  	}
			for(new i = 0; i < MAX_PLAYERS; i++)
  			{
  		  	if(IsPlayerConnected(i))
  		  	{
		  			ShowPlayerNameTagForPlayer(i, playerid, 0);
				}
			}
		format(string, sizeof(string), "~p~You have put your mask on");
		GameTextForPlayer(playerid, string, 4000, 3);
		PlayerInfo[playerid][pMaskuse] = 1;
		OnPropUpdate();
		return 1;
	}

	  	else if(PlayerInfo[playerid][pMaskuse] == 1)
	  	{
	  	for(new i = 0; i < MAX_PLAYERS; i++)
  			{
  		  	if(IsPlayerConnected(i))
  		  	{
		  			ShowPlayerNameTagForPlayer(i, playerid, 1);
				}
			}
			format(string, sizeof(string), "~p~You have tooken off the mask");
			GameTextForPlayer(playerid, string, 4000, 3);
			PlayerInfo[playerid][pMaskuse] = 0;
			OnPropUpdate();
		}
		return 1;
	}
Please help thanks
Reply
#2

I may be acting stupid here, but I think you've said:

Код:
if(strcmp(cmd, "/mask", true) == 0)
// bla bla bla
else if(PlayerInfo[playerid][pMaskuse] == 1)
// bla bla bla
In short, I think you've misplaced your 'else if'. Good luck.

- Foxtrot
Reply
#3

Lol dat doesnt help either
Reply
#4

Oh, well sorry for trying help.
Reply
#5

?
Reply
#6

OMG SOMEONE REPLY
Reply
#7

Maybe this will help
Код:
new sendername[MAX_PLAYER_NAME];
new playername[MAX_PLAYER_NAME];	

if(strcmp(cmdtext, "/maskoff", true) == 0)
	{
	if(!strfind(playername, "[Hitman]", true))
		 {
	  	for(new i = 0; i < MAX_PLAYERS; i++)
  			{
  		  	if(IsPlayerConnected(i))
  		  	{
		  			ShowPlayerNameTagForPlayer(i, playerid, 1);
				}
			}
			SendClientMessage(playerid, COLOR_WHITE, "You have put your mask off [/maskon to put it on].");
			GetPlayerName(playerid, sendername, sizeof(sendername));
   		format(string, sizeof(string), "* %s puts his mask away.", sendername);
   		SendClientMessageToAll(COLOR_WHITE, string);

		}
	}
	if(strcmp(cmdtext, "/maskon", true) == 0) 
	{
	if(!strfind(playername, "[Hitman]", true))
		 {
			for(new i = 0; i < MAX_PLAYERS; i++)
  			{
  		  	if(IsPlayerConnected(i))
  		  	{
		  			ShowPlayerNameTagForPlayer(i, playerid, 0);
		  			SetPlayerColor(playerid, COLOR_WHITE);
		  			SetPlayerMarkerForPlayer( 42, 1, 0xFFFFFF00 );
				}
			}
			SendClientMessage(playerid, COLOR_WHITE, "  You have put your mask on [/maskoff to put it away].");
			GetPlayerName(playerid, sendername, sizeof(sendername));
   		format(string, sizeof(string), "* %s puts his mask on.", sendername);
		}
	}
Reply
#8

Lol dats not what i mean i mean if i do /mask and i have the mask on i want to do /mask again to take of the mask but when i do /mask i have the mask on and i do /mask again it still if on me
Reply
#9

if(PlayerInfo[playerid][pMask] < 0)

to

if(PlayerInfo[playerid][pMaskuse] == 0)

btw i think 75% of the command is wrong...
Reply
#10

Nope didnt work still
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)