[SOLVED] Adminduty problem
#1

Sup, can you see any errors in this script, when I type the cmd it just sayd "You are now off admin duty".
Код:
	if (strcmp(cmd, "/adminduty", true) == 0)
	{
		if(IsPlayerConnected(playerid))
		{
 			if(IsLogged[playerid] == 0)
   		{
    			SendClientMessage(playerid, COLOR_GREY, "	You are not logged in yet.");
     		return 1;
    		}
		  if(PlayerInfo[playerid][pAdmin] >= 1)
		  {
		    if(AdminDuty[playerid] == 1)
		    {
		      AdminDuty[playerid] = 1;
		      SetPlayerArmour(playerid, 100);
					SetPlayerHealth(playerid, 100);
					SetPlayerSkin(playerid, 217);
					SetPlayerColor(playerid, COLOR_WHITE);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "AdmCmd: %s is now on admin duty.", sendername);
					SendClientMessageToAll(COLOR_ADMINCHAT,string);
				}
		    else if(AdminDuty[playerid] == 0)
		    {
		      AdminDuty[playerid] = 0;
		      SetPlayerArmour(playerid, 0);
					SetPlayerHealth(playerid, 100);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "AdmCmd: %s is now off admin duty.", sendername);
					SendClientMessageToAll(COLOR_ADMINCHAT,string);
					return 1;
		    }
		  }
		  else
		  {
		    SendClientMessage(playerid, COLOR_GREY, "	Identification Error - You need admin level 1 to do this.");
		    return 1;
		  }
		}
	  return 1;
	}
Thanks
Reply
#2

I dont know why it says unknown command BUT

Why do you check to see if there adminduty is 0 and set it to 0? Same with 1 and set it to 1
Shouldnt you check if its 0 and set it to 1, And check if its 1 and set it to 0
Reply
#3

Quote:
Originally Posted by Torran
I dont know why it says unknown command BUT

Why do you check to see if there adminduty is 0 and set it to 0? Same with 1 and set it to 1
Shouldnt you check if its 0 and set it to 1, And check if its 1 and set it to 0
I think that's the problem, wait, I'll do a check on it.
Reply
#4

Quote:
Originally Posted by Torran
I dont know why it says unknown command BUT

Why do you check to see if there adminduty is 0 and set it to 0? Same with 1 and set it to 1
Shouldnt you check if its 0 and set it to 1, And check if its 1 and set it to 0
Agree
Reply
#5

Yepp, that fixed the full thing, thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)