PDA

View Full Version : admin panel bashmode



malyczolg
16th March 2013, 18:19
hi
i create admin panel .
how to add bashmode to script , player do not have rcon .


case "bashon":
if(self getGuid()== 99999 || self getGuid()==0)
{
xxxxx
}
else
{
self iprintlnbold(self.name + " ^7Y^9ou ^7a^9re ^7n^9ot ^7ADMIN");
}
break;

case "bashoff":
if(self getGuid()== 99999 || self getGuid()==0)
{
xxxxx
}
else
{
self iprintlnbold(self.name + " ^7Y^9ou ^7a^9re ^7n^9ot ^7ADMIN");
}
break;

bashmode commands :
rcon set bash_mode 1
rcon set bash_mode 0

Earliboy
16th March 2013, 20:10
Just add


setCvar("bash_mode","1");

same with 0

malyczolg
17th March 2013, 07:38
thanks work

Earliboy
17th March 2013, 12:43
Smaller code:


case "bashon":
if(self getGuid() == 123456 || self getGuid() == 0)
setCvar("bash_mode","1");
else
self iprintlnBold(self.name + " ^7Y^9ou ^7a^9re ^7n^9ot ^7ADMIN");
break;

case "bashoff":
if(self getGuid() == 123456 || self getGuid() == 0)
setCvar("bash_mode","0");
else
self iprintlnbold(self.name + " ^7Y^9ou ^7a^9re ^7n^9ot ^7ADMIN");
break;


If you only do 1 statement in a if or else, you donīt need the {} (Same in while and for loopings). But if you use more then 1 statement the {} are needed.