Vice City: Multiplayer

Server Development => Scripting and Server Management => Script and Content Requests => Topic started by: UncleRus on April 20th, 2020, 03:47 PM

Title: what command to be a admin on server
Post by: UncleRus on April 20th, 2020, 03:47 PM
what command to be a admin server
Title: Re: what command to be a admin on server
Post by: Razor. on April 20th, 2020, 05:51 PM
Here have one simple command to toogle your admin level, by me.

Code: [Select]
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]
Title: Re: what command to be a admin on server
Post by: UncleRus on April 20th, 2020, 07:06 PM
console command!
Title: Re: what command to be a admin on server
Post by: Razor. on April 21st, 2020, 12:31 AM
You can't execute a code from server console.
Title: Re: what command to be a admin on server
Post by: UncleRus on April 21st, 2020, 07:01 AM
я точно не помню комманду ну она начиналась как то так level[0]set=2 или как то ёще я просто не помню
Title: Re: what command to be a admin on server
Post by: umar4911 on April 21st, 2020, 10:30 AM
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