MakeTempAdmin
#1

I get this error i don't know how to fix
Код:
C:\Users\Ramin\Desktop\Spel\PL-RP\gamemodes\PLRP.pwn(61503) : error 017: undefined symbol "IsTempAdmin"
C:\Users\Ramin\Desktop\Spel\PL-RP\gamemodes\PLRP.pwn(61503) : warning 215: expression has no effect
C:\Users\Ramin\Desktop\Spel\PL-RP\gamemodes\PLRP.pwn(61503) : error 001: expected token: ";", but found "]"
C:\Users\Ramin\Desktop\Spel\PL-RP\gamemodes\PLRP.pwn(61503) : error 029: invalid expression, assumed zero
C:\Users\Ramin\Desktop\Spel\PL-RP\gamemodes\PLRP.pwn(61503) : fatal error 107: too many error messages on one line

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


4 Errors.
Код:
CMD:maketempadmin(playerid, params[])
{
	new string[128], giveplayerid, minutes, rank;
	if(sscanf(params, "udd[64]", giveplayerid, rank, minutes)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /maketempadmin [playerid] [rank] [minutes]");
	if(PlayerInfo[playerid][pAdmin] >= 99999) {
		if(IsPlayerConnected(giveplayerid)) {
			if(PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin]) {
				SendClientMessageEx(playerid, COLOR_WHITE, "You can't perform this action on an equal or higher level administrator.");
				return 1;
			}
			PlayerInfo[giveplayerid][pAdmin] = rank;
			IsTempAdmin[giveplayerid] = 1;
			/*new IsTempAdmin[MAX_PLAYERS];*/
			PlayerInfo[giveplayerid][pAdminTime] = minutes*60;
			format(string, sizeof(string), "AdmCmd: %s has been temporarily made Level %d Admin for %d minutes by %s", GetPlayerNameEx(giveplayerid), rank, minutes, GetPlayerNameEx(playerid));
			SendClientMessageToAllEx(COLOR_LIGHTRED, string);
			/*format(szMessage, sizeof(szMessage), "You have been promoted to a level %d admin by %s for %d minutes.", rank, GetPlayerNameEx(playerid), minutes);
			SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, szMessage);*/
		}
		else SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid player specified.");
	}
	else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command");
	return 1;
}
Reply
#2

at top of your script
pawn Код:
new IsTempAdmin[MAX_PLAYERS];
Reply
#3

Quote:
Originally Posted by doreto
Посмотреть сообщение
at top of your script
pawn Код:
new IsTempAdmin[MAX_PLAYERS];
One more error
Код:
C:\Users\Ramin\Desktop\Spel\PL-RP\gamemodes\PLRP.pwn(61506) : error 017: undefined symbol "pAdminTime"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#4

define it too
pawn Код:
new pAdminTime;
I am guessing it is an integer.
Reply
#5

Quote:
Originally Posted by emokidx111
Посмотреть сообщение
define it too
pawn Код:
new pAdminTime;
I am guessing it is an integer.
Worked. One warning
Код:
C:\Users\Ramin\Desktop\Spel\PL-RP\gamemodes\PLRP.pwn(61507) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Reply
#6

Quote:
Originally Posted by raamiix
Посмотреть сообщение
One more error
Код:
C:\Users\Ramin\Desktop\Spel\PL-RP\gamemodes\PLRP.pwn(61506) : error 017: undefined symbol "pAdminTime"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
you need to add your pAdminTime to your PlayerInfo enum

enum PlayerInfo
...,
...,
pAdminTime
Reply
#7

Quote:
Originally Posted by doreto
Посмотреть сообщение
you need to add your pAdminTime to your PlayerInfo enum

enum PlayerInfo
...,
...,
pAdminTime
Script? Didnt understand
Reply
#8

Quote:
Originally Posted by raamiix
Посмотреть сообщение
Script? Didnt understand
pawn Код:
enum PlayerInfo
{
    pAdminTime
}
new PInfo[MAX_PLAYERS][PlayerInfo];
Reply
#9

top of your gamemode/filescript . I hope you understand everything and you solve your problem

for more information about enums read on samp wiki
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)