SA-MP Forums Archive
/makeadmin cmd trouble - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /makeadmin cmd trouble (/showthread.php?tid=636308)



/makeadmin cmd trouble - MrCesar - 24.06.2017

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


Re: /makeadmin cmd trouble - XtremeRz - 24.06.2017

Код:
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?


Re: /makeadmin cmd trouble - MrCesar - 24.06.2017

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'..


Re: /makeadmin cmd trouble - Kane - 24.06.2017

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


Re: /makeadmin cmd trouble - MrCesar - 24.06.2017

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