30.08.2011, 20:30
I need a command to enable/disable other commands, such as the /heal command can be enable/disable by administrator
new bool:eheal;
CMD:disableheal(playerid,params[])
{
if(eheal = true)
{
eheal = false;
}
else if(eheal = false)
{
eheal = true;
}
return 1;
}
CMD:heal(playerid,params[])
{
if(eheal=true){
SetPlayerHealth(playerid,100);}
else if(eheal=false) return SendClientMessage(playerid,red,"this command is disabled");
return 1;
}
CMD:heal(playerid,params[])
{
if(eheal)
{
SetPlayerHealth(playerid,100);
eheal = false;
}
else if(!eheal)
{
SendClientMessage(playerid, 0xFFFFFFAA, "this command is disabled");
eheal = true;
}
return 1;
}
new bool:eheal; CMD:disableheal(playerid,params[]) { if(eheal = true) { eheal = false; //Here I want to write "{GetPlayerColor}%s administrator disable command /heal" } else if(eheal = false) { eheal = true; //Here I want to write "{GetPlayerColor}%s administrator enable command /heal" } return 1; } CMD:heal(playerid,params[]) { if(eheal) { SetPlayerHealth(playerid,100); eheal = false; } else if(!eheal) { SendClientMessage(playerid, 0xFFFFFFAA, "This command is disabled"); eheal = true; } return 1; }
new bool:eheal;
CMD:disableheal(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return 1;//Rcon admin
new string[128];
if(eheal = true)
{
eheal = false;
GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"%s administrator disable command /heal",string);
}
else if(eheal = false)
{
eheal = true;
GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"%s administrator enable command /heal",string);
}
SendClientMessageToAll(color,string);
return 1;
}
CMD:disableheal(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return 1;//Rcon admin
new string[128],name[24];
if(eheal = true)
{
eheal = false;
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"%x",GetPlayerColor(playerid));
strmid(string,string,2,7)
format(string,sizeof(string),"{%s}%s{FFFFFF} administrator disable command /heal",string,name);
}
else if(eheal = false)
{
eheal = true;
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"%x",GetPlayerColor(playerid));
strmid(string,string,2,7)
format(string,sizeof(string),"{%s}%s{FFFFFF} administrator enable command /heal",string,name);
}
SendClientMessageToAll(color,string);
return 1;
}