Help with my admin system
#1

Hi guys, I'm making an admin system, I continue to follow tutorials but without success! I make everytime a new /makeadmin /setlevel or /setadmin command, I try it in the server and: SERVER: Unknown command ._.
Now, I made a login/register system, work perfectly with these enums:
enum pInfo
{
pPass,
pScore,
pCash,
pKills,
pDeaths,
pAdminlevel[MAX_PLAYERS],
}
enum ServerOptions
{
MaxAdminLevel
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Anyone with these enums can make for me "/setlevel" command?
Reply
#2

Guys is this right?:
Код:
dcmd_setlevel(playerid,params[]) {
	if(PlayerInfo[playerid][LoggedIn] == 1) {
		if(PlayerInfo[playerid][Level] >= 5 || IsPlayerAdmin(playerid)) {
		    new tmp[256], tmp2[256], Index;		tmp = strtok(params,Index), tmp2 = strtok(params,Index);
		    if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /setlevel [playerid] [level]");
	    	new player1, level, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
			player1 = strval(tmp);
			if(!strlen(tmp2)) return SendClientMessage(playerid, red, "USAGE: /setlevel [playerid] [level]");
			level = strval(tmp2);
Reply
#3

Looks good to me.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)