SA-MP Forums Archive
[SOLVED] Adminduty problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [SOLVED] Adminduty problem (/showthread.php?tid=131029)



[SOLVED] Adminduty problem - FreddeN - 01.03.2010

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


Re: [HELP] Adminduty problem - Torran - 01.03.2010

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


Re: [HELP] Adminduty problem - FreddeN - 01.03.2010

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.


Re: [HELP] Adminduty problem - bajskorv123 - 01.03.2010

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


Re: [HELP] Adminduty problem - FreddeN - 01.03.2010

Yepp, that fixed the full thing, thanks