SA-MP Forums Archive
Help with my admin system - 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: Help with my admin system (/showthread.php?tid=383376)



Help with my admin system - lorizz - 07.10.2012

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?


Re: Help with my admin system - lorizz - 07.10.2012

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);



Re: Help with my admin system - rbush12 - 07.10.2012

Looks good to me.