Help Me Fixing This Bug
#1

Hello Guys I Have Added A System That Admin Can Enable And Disable Headshoot So Here Is My Code

Код:
CMD:disable(playerid,params[]) {
    if(PlayerInfo[playerid][Level] >= 4 || IsPlayerAdmin(playerid)) {
	    if(isnull(params)) {
			SendClientMessage(playerid,red,"USAGE: /disable [antiswear / namekick / antispam / ping / readcmds / readpms /caps / admincmdmsgs /connectmsgs / autologin / headshoot]");
		}
	    new string[128], file[256]; format(file,sizeof(file),"ladmin/config/Config.ini");
		if(strcmp(params,"antiswear",true) == 1) {
			ServerInfo[AntiSwear] = 0;
			dini_IntSet(file,"AntiSwear",0);
			format(string,sizeof(string),"Administrator %s has disabled antiswear", PlayerName2(playerid));
			SendClientMessageToAll(blue,string);
		} else if(strcmp(params,"namekick",true) == 1) {
			ServerInfo[NameKick] = 0;
			dini_IntSet(file,"NameKick",0);
			format(string,sizeof(string),"Administrator %s has disabled namekick", PlayerName2(playerid));
			SendClientMessageToAll(blue,string);
	 	} else if(strcmp(params,"antispam",true) == 1)	{
			ServerInfo[AntiSpam] = 0;
			dini_IntSet(file,"AntiSpam",0);
			format(string,sizeof(string),"Administrator %s has disabled antispam", PlayerName2(playerid));
			SendClientMessageToAll(blue,string);
		} else if(strcmp(params,"ping",true) == 1)	{
			ServerInfo[MaxPing] = 0;
			dini_IntSet(file,"MaxPing",0);
			format(string,sizeof(string),"Administrator %s has disabled ping kick", PlayerName2(playerid));
			SendClientMessageToAll(blue,string);
		} else if(strcmp(params,"readcmds",true) == 1) {
			ServerInfo[ReadCmds] = 0;
			dini_IntSet(file,"ReadCMDs",0);
			format(string,sizeof(string),"Administrator %s has disabled reading commands", PlayerName2(playerid));
			MessageToAdmins(blue,string);
		} else if(strcmp(params,"readpms",true) == 1) {
			ServerInfo[ReadPMs] = 0;
			dini_IntSet(file,"ReadPMs",0);
			format(string,sizeof(string),"Administrator %s has disabled reading pms", PlayerName2(playerid));
			MessageToAdmins(blue,string);
  		} else if(strcmp(params,"caps",true) == 1)	{
			ServerInfo[NoCaps] = 1;
			dini_IntSet(file,"NoCaps",1);
			format(string,sizeof(string),"Administrator %s has prevented captial letters in chat", PlayerName2(playerid));
			SendClientMessageToAll(blue,string);
		} else if(strcmp(params,"admincmdmsgs",true) == 1) {
			ServerInfo[AdminCmdMsg] = 0;
			dini_IntSet(file,"AdminCMDMessages",0);
			format(string,sizeof(string),"Administrator %s has disabled admin command messages", PlayerName2(playerid));
			MessageToAdmins(green,string);
		} else if(strcmp(params,"connectmsgs",true) == 1)	{
			ServerInfo[ConnectMessages] = 0;
			dini_IntSet(file,"ConnectMessages",0);
			format(string,sizeof(string),"Administrator %s has disabled connect & disconnect messages", PlayerName2(playerid));
			MessageToAdmins(green,string);
		} else if(strcmp(params,"autologin",true) == 1)	{
			ServerInfo[AutoLogin] = 0;
			dini_IntSet(file,"AutoLogin",0);
			format(string,sizeof(string),"Administrator %s has disabled auto login", PlayerName2(playerid));
			MessageToAdmins(green,string);
		} else if(strcmp(params,"headshoot",true) == 1)	{
			ServerInfo[HeadShoot] = 0;
			dini_IntSet(file,"HeadShoot",0);
			format(string,sizeof(string),"Administrator %s has disabled headshoot", PlayerName2(playerid));
			MessageToAdmins(green,string);
		} else {
			SendClientMessage(playerid,red,"USAGE: /disable [antiswear / namekick / antispam / ping / readcmds / readpms /caps / admincmdmsgs /connectmsgs / autologin / headshoot]");
		} return 1;
	} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}

CMD:enable(playerid,params[]) {
   if(PlayerInfo[playerid][Level] >= 4 || IsPlayerAdmin(playerid)) {
	    if(isnull(params)) {
		SendClientMessage(playerid,red,"USAGE: [/enable [antiswear / namekick / antispam / ping / readcmds / readpms /caps / admincmdmsgs /connectmsgs / autologin / headshoot]");
		}
	    new string[128], file[256]; format(file,sizeof(file),"ladmin/config/Config.ini");
		if(strcmp(params,"antiswear",true) == 0) {
			ServerInfo[AntiSwear] = 1;
			dini_IntSet(file,"AntiSwear",1);
			format(string,sizeof(string),"Administrator %s has enabled antiswear", PlayerName2(playerid));
			SendClientMessageToAll(blue,string);
		} else if(strcmp(params,"namekick",true) == 0)	{
			ServerInfo[NameKick] = 1;
			dini_IntSet(file,"NameKick",1);
			format(string,sizeof(string),"Administrator %s has enabled namekick", PlayerName2(playerid));
			SendClientMessageToAll(blue,string);
 		} else if(strcmp(params,"antispam",true) == 0)	{
			ServerInfo[AntiSpam] = 1;
			dini_IntSet(file,"AntiSpam",1);
			format(string,sizeof(string),"Administrator %s has enabled antispam", PlayerName2(playerid));
			SendClientMessageToAll(blue,string);
		} else if(strcmp(params,"ping",true) == 0)	{
			ServerInfo[MaxPing] = 800;
			dini_IntSet(file,"MaxPing",800);
			format(string,sizeof(string),"Administrator %s has enabled ping kick", PlayerName2(playerid));
			SendClientMessageToAll(blue,string);
		} else if(strcmp(params,"readcmds",true) == 0)	{
			ServerInfo[ReadCmds] = 1;
			dini_IntSet(file,"ReadCMDs",1);
			format(string,sizeof(string),"Administrator %s has enabled reading commands", PlayerName2(playerid));
			MessageToAdmins(blue,string);
		} else if(strcmp(params,"readpms",true) == 0) {
			ServerInfo[ReadPMs] = 1;
			dini_IntSet(file,"ReadPMs",1);
			format(string,sizeof(string),"Administrator %s has enabled reading pms", PlayerName2(playerid));
			MessageToAdmins(blue,string);
		} else if(strcmp(params,"caps",true) == 0)	{
			ServerInfo[NoCaps] = 1;
			dini_IntSet(file,"NoCaps",1);
			format(string,sizeof(string),"Administrator %s has allowed captial letters in chat", PlayerName2(playerid));
			SendClientMessageToAll(blue,string);
		} else if(strcmp(params,"admincmdmsgs",true) == 0)	{
			ServerInfo[AdminCmdMsg] = 1;
			dini_IntSet(file,"AdminCmdMessages",1);
			format(string,sizeof(string),"Administrator %s has enabled admin command messages", PlayerName2(playerid));
			MessageToAdmins(green,string);
		} else if(strcmp(params,"connectmsgs",true) == 0) {
			ServerInfo[ConnectMessages] = 1;
			dini_IntSet(file,"ConnectMessages",1);
			format(string,sizeof(string),"Administrator %s has enabled connect & disconnect messages", PlayerName2(playerid));
			MessageToAdmins(green,string);
		} else if(strcmp(params,"autologin",true) == 0) {
			ServerInfo[AutoLogin] = 1;
			dini_IntSet(file,"AutoLogin",1);
			format(string,sizeof(string),"Administrator %s has enabled auto login", PlayerName2(playerid));
			MessageToAdmins(green,string);
		} else if(strcmp(params,"headshoot",true) == 0) {
			ServerInfo[HeadShoot] = 1;
			dini_IntSet(file,"HeadShoot",1);
			format(string,sizeof(string),"Administrator %s has enabled headshoot", PlayerName2(playerid));
			MessageToAdmins(green,string);
  } else {
		SendClientMessage(playerid,red,"USAGE: /enable [antiswear / namekick / antispam / ping / readcmds / readpms /caps / admincmdmsgs /connectmsgs / autologin / headshoot]");
		} return 1;
	} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}
But I Am Having A Problem With Disable Command When I Type /disable headshoot it says see in the picture
http://imgur.com/a/3wCkX
It says antiswear but it should say headshoot
Reply


Messages In This Thread
Help Me Fixing This Bug - by Speaker - 10.03.2017, 03:10
Re: Help Me Fixing This Bug - by coool - 10.03.2017, 03:54
Re: Help Me Fixing This Bug - by oSAINTo - 10.03.2017, 03:57
Re: Help Me Fixing This Bug - by Speaker - 10.03.2017, 04:11
Re: Help Me Fixing This Bug - by oSAINTo - 10.03.2017, 04:36
Re: Help Me Fixing This Bug - by Speaker - 10.03.2017, 04:38
Re: Help Me Fixing This Bug - by oSAINTo - 10.03.2017, 04:41
Re: Help Me Fixing This Bug - by Toroi - 10.03.2017, 04:52
Re: Help Me Fixing This Bug - by oSAINTo - 10.03.2017, 04:54
Re: Help Me Fixing This Bug - by Toroi - 10.03.2017, 05:06

Forum Jump:


Users browsing this thread: 1 Guest(s)