Error 029 +1 Rep
#5

Quote:
Originally Posted by DobbysGamertag
Посмотреть сообщение
That's because of this:

pawn Код:
if(PlayerInfo[playerid][pAdmin] >= 3) return SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");
Remove that, or remove the else statement where the error occurs.
Okay i tried this[

Код:
CMD:release(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 3)
	{
		if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
 		{
  			SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");
			return 1;
   		}
		if(PlayerInfo[playerid][pRelease] == 0)
		{
		new string[128], giveplayerid, reason[64];
		if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /release [playerid/partofname] [reason]");

		if(IsPlayerConnected(giveplayerid))
		{
			format(string, sizeof(string), "AdmCmd: %s has been released from prison by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
			Log("logs/admin.log", string);
			format(string, sizeof(string), "AdmCmd: %s has been released from prison by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
			SendClientMessageToAllEx(COLOR_LIGHTRED, string);
			PlayerInfo[giveplayerid][pJailed] = 0;
			PlayerInfo[giveplayerid][pWantedLevel] = 0;
			SetPlayerToTeamColor(giveplayerid);
			SetPlayerWantedLevel(giveplayerid, 0);
			PlayerInfo[giveplayerid][pJailTime] = 0;
			SetPlayerPos(giveplayerid, 1529.6,-1691.2,13.3);
			SetPlayerInterior(giveplayerid,0);
			PlayerInfo[giveplayerid][pInt] = 0;
			SetPlayerVirtualWorld(giveplayerid, 0);
			PlayerInfo[giveplayerid][pVW] = 0;
			PhoneOnline[giveplayerid] = 0;
			}
		}
	}
	else
	{
		SendClientMessage(playerid, COLOR_GRAD1, "You can't release a player with /norelease cmd!");
	}
	return 1;
}
But if they tried to /release it, if the player is in the /norelease option what is the msg ?

EDIT:

how about if they are not admin what will be the msg

EDIT:

already fixed

Код:
CMD:release(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 3)
	{
		if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
 		{
  			SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");
			return 1;
   		}
		if(PlayerInfo[playerid][pRelease] == 0) return SendClientMessage(playerid, COLOR_GRAD1, "You can't release a player with /norelease cmd!");
		{
		new string[128], giveplayerid, reason[64];
		if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /release [playerid/partofname] [reason]");

		if(IsPlayerConnected(giveplayerid))
		{
			format(string, sizeof(string), "AdmCmd: %s has been released from prison by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
			Log("logs/admin.log", string);
			format(string, sizeof(string), "AdmCmd: %s has been released from prison by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
			SendClientMessageToAllEx(COLOR_LIGHTRED, string);
			PlayerInfo[giveplayerid][pJailed] = 0;
			PlayerInfo[giveplayerid][pWantedLevel] = 0;
			SetPlayerToTeamColor(giveplayerid);
			SetPlayerWantedLevel(giveplayerid, 0);
			PlayerInfo[giveplayerid][pJailTime] = 0;
			SetPlayerPos(giveplayerid, 1529.6,-1691.2,13.3);
			SetPlayerInterior(giveplayerid,0);
			PlayerInfo[giveplayerid][pInt] = 0;
			SetPlayerVirtualWorld(giveplayerid, 0);
			PlayerInfo[giveplayerid][pVW] = 0;
			PhoneOnline[giveplayerid] = 0;
			}
		}
	}
	else
	{
		SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");
	}
	return 1;
}
Reply


Messages In This Thread
Error 029 +1 Rep - by ChuckyBabe - 18.04.2015, 23:56
Re: Error 029 +1 Rep - by DobbysGamertag - 19.04.2015, 00:00
Re: Error 029 +1 Rep - by ChuckyBabe - 19.04.2015, 00:02
Re: Error 029 +1 Rep - by DobbysGamertag - 19.04.2015, 00:03
Re: Error 029 +1 Rep - by ChuckyBabe - 19.04.2015, 00:05
Re: Error 029 +1 Rep - by BleverCastard - 19.04.2015, 00:11
Re: Error 029 +1 Rep - by ChuckyBabe - 19.04.2015, 00:17
Re: Error 029 +1 Rep - by BleverCastard - 19.04.2015, 00:29
Re: Error 029 +1 Rep - by ChuckyBabe - 19.04.2015, 01:10

Forum Jump:


Users browsing this thread: 3 Guest(s)