Need help with this code..
#1

Код:
CMD:aduty(playerid, params[]) {
	new string[128];
    if((PlayerInfo[playerid][pAdmin] >= 2) && GetPVarInt(playerid, "IsInArena") < 0 && !GetPVarInt(playerid, "EventToken")) {
		if(PlayerInfo[playerid][pAdminDuty]) {
			PlayerInfo[playerid][pAdminDuty] = 0;
			PlayerInfo[playerid][pTogReports] = 1;
			//SetPlayerToTeamColor(playerid);
			SendClientMessageEx(playerid, COLOR_WHITE, "You have clocked out from Admin Duty, you are now in Role Play Mode.");
			format(string, sizeof(string), "{AA3333}Admin Duty{FFFF00}: %s has clocked off and is now off duty.", GetPlayerNameEx(playerid));
			ABroadCast(COLOR_YELLOW,string, 2);
		}
		else {
			PlayerInfo[playerid][pAdminDuty] = 1;
			PlayerInfo[playerid][pTogReports] = 0;
			//SetPlayerToTeamColor(playerid);
			SendClientMessageEx(playerid, COLOR_WHITE, "You have clocked in to Admin Duty, you are no longer in Role play Mode.");
			format(string, sizeof(string), "{AA3333}Admin Duty{FFFF00}: %s has clocked in and is now on duty.", GetPlayerNameEx(playerid));
			ABroadCast(COLOR_YELLOW,string, 2);
		}
	}
	return 1;
}

CMD:eaduty(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] != 99999) return 1;
	if(PlayerInfo[playerid][pAdminDuty] != 2) {
	    SendClientMessageEx(playerid, -1, "You are now on EAdmin Duty.");
	    PlayerInfo[playerid][pAdminDuty] = 2;
	}
	else {
	    SendClientMessageEx(playerid, -1, "You are no longer on EAdmin Duty.");
	    PlayerInfo[playerid][pAdminDuty] = 1;
	}
	return 1;
}
Guys i've made this code and added to my gamemode, but after compiling it i get this error. Can someone help me to resolve it?

Error:
Код:
DGRP.pwn(55572) : error 017: undefined symbol "pAdminDuty"
DGRP.pwn(55572) : error 017: undefined symbol "pAdminDuty"
DGRP.pwn(55572) : error 017: undefined symbol "pAdminDuty"
DGRP.pwn(55572) : error 017: undefined symbol "pAdminDuty"
DGRP.pwn(55572) : error 017: undefined symbol "pAdminDuty"
DGRP.pwn(55572) : error 017: undefined symbol "pAdminDuty"
Reply
#2

u need to add pAdminDuty in your enum pInfo
Reply
#3

pawn Код:
enum example
{
     pAdminDuty
}
new PlayerInfo[MAX_PLAYERS][example];
Reply
#4

Add pAdminDuty in the enum at the top...

Edit : late ._.
Reply
#5

P.S; Resolved it thanks for help..
Reply
#6

yes it will
Reply
#7

Yes it will work
Reply
#8

Quote:
Originally Posted by muzammilfreeman
Посмотреть сообщение
I added this>>
Код:
enum
{
     pAdminDuty
}
new PlayerInfo[MAX_PLAYERS][example];
Will it work? I added that in my enum..
Sure it will work, dont forget to add onPlayerConnect
PHP код:
PlayerInfo[playerid][pAdminDuty] = 0
Reply
#9

Simply add pAdminDuty in the enum pInfo whats so hard in this?
Reply
#10

yes it will work
you dont have to do it like this exacly

pawn Код:
enum example
{
     pAdminDuty
}
new PlayerInfo[MAX_PLAYERS][example];
you can change the example name and the PlayerInfo to your own
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)