what command to be a admin on server

Started by UncleRus, Apr 20, 2020, 02:47 PM

Previous topic - Next topic

UncleRus

I LoperkinDead.My brothers scripters TimyrSem,VladSem

Razor.

Here have one simple command to toogle your admin level, by me.

function onPlayerCommand( player, cmd, text )
{
if ( cmd == "admin" )
{
if ( player.IP != "127.0.0.1" /*<--- your ip here*/ ) MessagePlayer( "You don't have acess for this command.", player );
else if ( !text ) MessagePlayer( "[Sintax] Use: /admin <on/off>", player );
else if ( text == "on" )
{
if ( player.IsAdmin == true ) MessagePlayer( "You already have admin level.", player );
else
{
player.IsAdmin = true;
MessagePlayer( "Admin level enabled.", player );
}
}
else if ( text == "off" )
{
if ( player.IsAdmin == false ) MessagePlayer( "You already are without level.", player );
else
{
player.IsAdmin = false;
MessagePlayer( "Admin level disabled.", player );
}
}
else MessagePlayer( "Invalid option, use <on/off>", player );
}
}
[code]

UncleRus

I LoperkinDead.My brothers scripters TimyrSem,VladSem

Razor.

You can't execute a code from server console.

UncleRus

я точно не помню комманду ну она начиналась как то так level[0]set=2 или как то ёще я просто не помню
I LoperkinDead.My brothers scripters TimyrSem,VladSem

umar4911

There are many ways to be an admin. I guess you're using class so you need to change the value of the respective element to be an admin like Stats[player.ID].Level = 6