Set myself admin on my own server
#1

Hey, finally got my server to run but can't set myself an admin, even if I log into rcon. There are no userfiles getting saved and I can't find them in my mysql database aswell, it's all poorly set up with the mysql database and I'm just looking forward to furnish a little on that RP server.

Could someone make this command public for me? Like, anyone can type it and make someone/himself an admin.

Код:
COMMAND:makeadmin(playerid, params[])
{
	if(GetPVarInt(playerid, "Admin") < 9) return nal(playerid);
	new id, lvl, str[128];
	if(sscanf(params, "ud", id, lvl)) return usage(playerid, "/makeadmin [Player] [Level]");
	if(GetPVarInt(playerid, "Admin") < GetPVarInt(id, "Admin")) return nal(playerid);
	if(GetPVarInt(playerid, "Admin") < lvl) return nal(playerid);
	if(lvl < 0 || lvl > 10) return error(playerid, "Invalid admin lvl.");
	SetPVarInt(id, "Admin", lvl);
	format(str, sizeof(str), "You have set (%s) to admin level (%d).", PlayerName(id), lvl);
	SCM(playerid, -1, str);
	return 1;
}
Reply
#2

Replace this
Код:
if(GetPVarInt(playerid, "Admin") < 9) return nal(playerid);
with this:
Код:
if(!IsPlayerAdmin && GetPVarInt(playerid, "Admin") < 9) return nal(playerid);
Now RCON admins can use that command.
Reply
#3

Error, You have no permission for this command.

Thanks for the quick reply but that didn't fix it. :/
Reply
#4

You have to log into RCON to be able to use the command..
Reply
#5

I already said I did.

Quote:
Originally Posted by xIs0BiHx
Посмотреть сообщение
even if I log into rcon.
Reply
#6

Quote:
Originally Posted by Stinged
Посмотреть сообщение
Replace this
Код:
if(GetPVarInt(playerid, "Admin") < 9) return nal(playerid);
with this:
Код:
if(!IsPlayerAdmin && GetPVarInt(playerid, "Admin") < 9) return nal(playerid);
Now RCON admins can use that command.
../gamemodes/Commands.pwn(1184 : error 076: syntax error in the expression, or invalid function call

When I tried to compile the mainscript which is connected with my Commands.pwn
Reply
#7

Tried anything can't fix it myself. Would be a big help if someone could make this makeadmin command public
Reply
#8

Quote:
Originally Posted by Stinged
Посмотреть сообщение
Replace this
Код:
if(GetPVarInt(playerid, "Admin") < 9) return nal(playerid);
with this:
Код:
if(!IsPlayerAdmin && GetPVarInt(playerid, "Admin") < 9) return nal(playerid);
Now RCON admins can use that command.
You made a little mistake, IsPlayerAdmin without playerid
PHP код:
if(!IsPlayerAdmin(playerid) && GetPVarInt(playerid"Admin") < 9) return nal(playerid); 
Reply
#9

Going to try that out right now, thank you
Reply
#10

Quote:
Originally Posted by Shinja
Посмотреть сообщение
You made a little mistake, IsPlayerAdmin without playerid
PHP код:
if(!IsPlayerAdmin(playerid) && GetPVarInt(playerid"Admin") < 9) return nal(playerid); 
Sorry, I was on my phone.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)