Admin on duty (4 error's)
#1

I have gamemode GodFather, but i did copy code this admin on duty from Los Angeles RP source...

Код:
//-------------------------------[admin duty]----------------------------------------------------------------
	if(!strcmp(cmdtext, "/aod", true)) // By Ellis
	{
		if(IsPlayerConnected(playerid))
		{
		  if(gPlayerLogged[playerid] == 0)
		  {
		    SendClientMessage(playerid, COLOR_GREY, "  You need to login first !");
				return 1;
		  }
		  if(PlayerInfo[playerid][pAdmin] > 0)
		  {
		    if(AdminDuty[playerid] == 0)
		    {
		      AdminDuty[playerid] = 1;
		      SetPlayerArmour(playerid, 999);
					SetPlayerHealth(playerid, 999);
					SetPlayerColor(playerid,TEAM_VAGOS_COLOR);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "Teade: [ID:%d]%s on admin duty.", playerid, sendername);
					ABroadCast(COLOR_YELLOW,string,1);
					if(PlayerInfo[playerid][pAdmin] >= 1337)
					{
					  for(new i = 0; i < sizeof(CarInfo); i++)
						{
							SetVehicleParamsForPlayer(i,playerid,0,0);
						}
					}
					return 1;
		    }
		    else if(AdminDuty[playerid] == 1)
		    {
		      AdminDuty[playerid] = 0;
		      SetPlayerArmour(playerid, 0);
					SetPlayerHealth(playerid, 100);
					SetPlayerColor(playerid,TEAM_HIT_COLOR);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "Teade: [ID:%d]%s off admin duty.", playerid, sendername);
					ABroadCast(COLOR_YELLOW,string,1);
					return 1;
		    }
		  }
		  else
		  {
		    SendClientMessage(playerid, COLOR_GREY, "  You're not the admin !");
		    return 1;
		  }
		}
	  return 1;
	}
COMPILER ERROR:
Код:
C:\Documents and Settings\Owner\Desktop\sa-mp server\gamemodes\gf.pwn(8179) : error 017: undefined symbol "AdminDuty"
C:\Documents and Settings\Owner\Desktop\sa-mp server\gamemodes\gf.pwn(8179) : warning 215: expression has no effect
C:\Documents and Settings\Owner\Desktop\sa-mp server\gamemodes\gf.pwn(8179) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Owner\Desktop\sa-mp server\gamemodes\gf.pwn(8179) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Owner\Desktop\sa-mp server\gamemodes\gf.pwn(8179) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#2

pawn Код:
//Top

new AdminDuty[MAX_PLAYERS];

//OnPlayerConnect

AdminDuty[playerid] = 0;
Reply
#3

Код:
C:\Documents and Settings\Owner\Desktop\sa-mp server\gamemodes\gf.pwn(8198) : error 017: undefined symbol "CarInfo"
C:\Documents and Settings\Owner\Desktop\sa-mp server\gamemodes\gf.pwn(8198) : error 036: empty statement
C:\Documents and Settings\Owner\Desktop\sa-mp server\gamemodes\gf.pwn(8198) : error 017: undefined symbol "i"
C:\Documents and Settings\Owner\Desktop\sa-mp server\gamemodes\gf.pwn(8198) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#4

Bump!
Reply
#5

don't bump that quick.
Replace it with MAX_VEHICLES.
Reply
#6

Quote:
Originally Posted by Rk_
don't bump that quick.
Replace it with MAX_VEHICLES.
What text do i replace ?
Reply
#7

CarInfo...
Reply
#8

Код:
new OnDuty[MAX_PLAYERS];
Код:
//----------------Admin on Duty // --------------------------------//
	if(strcmp(cmd, "/onduty", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			if (PlayerInfo[playerid][pAdmin] >= 1)
			{
            SetPlayerHealth(playerid, 1000);
            GetPlayerName(playerid, sendername, sizeof(sendername));
		    SendClientMessageToAll(COLOR_WHITE, "Admin On Duty");
           format(string, sizeof(string), "Admin %s is On Duty, Please /w if you need help", sendername);
           SendClientMessageToAll(COLOR_DBLUE, string);
           SetPlayerColor(playerid, 0xFF6600AA); // Orange
			return 1;
			}
			else
			{
			SendClientMessage(playerid, COLOR_GRAD1, " You are not an Admin !");
			}
		}
		return 1;
	}
//----------------Admin Off Duty // --------------------------------//
	if(strcmp(cmd, "/offduty", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			if (PlayerInfo[playerid][pAdmin] >= 1)
			{
            SetPlayerHealth(playerid, 80);
            GetPlayerName(playerid, sendername, sizeof(sendername));
		    SendClientMessageToAll(COLOR_WHITE, "Admin Off Duty");
           format(string, sizeof(string), "Admin %s is Off Duty, Please do not /w", sendername);
           SendClientMessageToAll(COLOR_DBLUE, string);
           SetPlayerColor(playerid, COLOR_WHITE);
			return 1;
			}
			else
			{
			SendClientMessage(playerid, COLOR_GRAD1, " You are not an Admin !");
			}
		}
		return 1;
	}

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)