/makeadmin cmd trouble
#1

hey guys..i've tried to make a simple /makeadmin cmd myself..
this is the cmd i did

Код:
CMD:makeadmin(playerid, params[]) 
{
	if(IsPlayerAdmin(playerid)) 
	{
	    new id, level, string[126];
		if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, -1, "syntax");
		Player[id][Admin] = level;
		format (string, sizeof(string), "%s has made you admin level %d", GetNameEx(playerid), level);
	    SendClientMessage(id, -1, string);
	    format (string, sizeof(string), "you  have made %s admin level %d", GetNameEx(id), level);
	    SendClientMessage(playerid, -1, string);
	}
	return 1;
}
and those are the errors i am getting..
Код:
C:\Users\socky\Desktop\NZGaming\gamemodes\NZG.pwn(612) : error 017: undefined symbol "Player"
C:\Users\socky\Desktop\NZGaming\gamemodes\NZG.pwn(612) : warning 215: expression has no effect
C:\Users\socky\Desktop\NZGaming\gamemodes\NZG.pwn(612) : error 001: expected token: ";", but found "]"
C:\Users\socky\Desktop\NZGaming\gamemodes\NZG.pwn(612) : error 029: invalid expression, assumed zero
C:\Users\socky\Desktop\NZGaming\gamemodes\NZG.pwn(612) : fatal error 107: too many error messages on one line

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


4 Errors.
thanks in advance
Reply
#2

Код:
Player[id][Admin] = level;
You need to change that with the respective value in your enumerator. Can you show me your player stats enumerator structure?
Reply
#3

Quote:
Originally Posted by XtremeRz
Посмотреть сообщение
Код:
Player[id][Admin] = level;
You need to change that with the respective value in your enumerator. Can you show me your player stats enumerator structure?
Код:
enum pInfo
{
    pPass,
    pCash,
    pAdmin,
    pKills,
    pDeaths
}
new PlayerInfo[MAX_PLAYERS][pInfo];
this? I've tried with pAdmin aswell didn't work tho'..
Reply
#4

Change Player[id][Admin] = level; to PlayerInfo[id][pAdmin]. You did it completely wrong.
Reply
#5

Quote:
Originally Posted by Arthur Kane
Посмотреть сообщение
Change Player[id][Admin] = level; to PlayerInfo[id][pAdmin]. You did it completely wrong.
thanks lol
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)