Basic Admin Commands Script

Started by Sonmez, Jun 04, 2019, 09:02 AM

Previous topic - Next topic

Sonmez

function onPlayerCommand( player, cmd, text )
{
if (cmd == "playercommand1)
{
}
else if (cmd == "playercommand2)
{
}
else
{
if (player.Name == "ADMINS NAME")
{
onAdminCommand( player, cmd, text );
}
else
{
 MessagePlayer("Unknown command", player);
}
}
}
function onAdminCommand( player, cmd, text )
{
if (cmd == "admincommand1") //Admin Command
{
}
else if (cmd == "admincommand2") //Admin Command...
{
}
else
{
 MessagePlayer("Unknown command", player);
}
}
if (!perfect) createAgain();

umar4911

As already said by many, prefer level system
RT Member | Asian City Scripter | CTB Contributor | VKs Contributor | European City Contributor | EAD Scripter

Sonmez

#2
I wrote it as "player.Name" because this topic is general script. You can change it with your admin identification.
if (!perfect) createAgain();

NicusorN5

Quote from: Sonmez on Jun 04, 2019, 09:02 AMif (player.Name == "ADMINS NAME")
{
function onAdminCommand( player, cmd, text );}
Do you even test your code?

Sonmez

Quote from: Athanatos on Jun 04, 2019, 03:47 PM
Quote from: Sonmez on Jun 04, 2019, 09:02 AMif (player.Name == "ADMINS NAME")
{
function onAdminCommand( player, cmd, text );}
Do you even test your code?
Fixed. :D
if (!perfect) createAgain();