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"); }
if(strcmp(params,"antiswear",true) == 1) |
if(strcmp(params,"antiswear",true) == 0) |
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], string2[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(string2,sizeof(string2),"Administrator %s has disabled headshoot", PlayerName2(playerid)); MessageToAdmins(green,string2); } 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:dcar(playerid,params[]) { if(PlayerInfo[playerid][LoggedIn] == 1) { if(PlayerInfo[playerid][dRank] >= 1) { new Float:x,Float:y,Float:z; GetPlayerPos(playerid,x,y,z); CreateVehicle(411,x,y,z,100,0,0,-1); PutPlayerInVehicle(playerid,411,2); } else return SendClientMessage(playerid,red,"ERROR: You Need Atleast Donor Rank 1 To Use This Command"); } else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
new DonatorCarTimer[MAX_PLAYERS];
CMD:dcar(playerid,params[]) { if(PlayerInfo[playerid][LoggedIn] == 1) { if(PlayerInfo[playerid][dRank] >= 1) { new Float:x,Float:y,Float:z; GetPlayerPos(playerid,x,y,z); CreateVehicle(411,x,y,z,100,0,0,-1); PutPlayerInVehicle(playerid,411,2); SetTimerEx("DonatorCar", 300000, 0, "i", playerid); SendClientMessage(playerid, red, "WARNING: The car will despawn in 5 minutes!"); } else return SendClientMessage(playerid,red,"ERROR: You Need Atleast Donor Rank 1 To Use This Command"); } else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
forward DonatorCar(playerid); public DonatorCar(playerid) { new vehicleid = GetPlayerVehicleID(playerid); DestroyVehicle(vehicleid); KillTimer(DonatorCarTimer[playerid]); }
Seeing your previous posts I notice you are in a defensive mood, so, before everything, sorry for being alive.
The code you provided is pretty useless as it will destroy the player's vehicle 300 seconds after he uses the command. He can use the car for only 300 seconds, which is not.. cool? The second problem with this code is that, if you use the /dcar command, leave the car and get in other car, the car you joined will get deleted after 300 seconds, which is not good at all. The better way to do this function is to assign the car id to a player variable and detroy the car under OnPlayerStateChange, that way you can delete the car when the player decides to leave it. |
if(vehicleid == 411) |
It should only play it once. I'm assuming that OP wants to use /saveallstats before he restarts the server. So. |