24.11.2014, 05:38
Hello, i have a problem with this command.
When i change the name of one of the divisions with this command, it has a random chance of crashing the server, which it most likely does.
When i change the name of one of the divisions with this command, it has a random chance of crashing the server, which it most likely does.
Код HTML:
CMD:adjustdivisionname(playerid, params[]) { new division, name[8], string[128]; if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command."); if(!IsACop(playerid) || !PlayerInfo[playerid][pFacLeader]) return SendClientMessage(playerid, COLOR_GREY, "You are not an LSPD leader."); if(sscanf(params, "is[32]", division, name)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /adjustdivisionname [division 1-5] [name]"); switch(division) { case 1: { FacInfo[1][fDiv1] = name; format(string, sizeof(string), "You have set division 1's name to %s", name); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } case 2: { FacInfo[1][fDiv2] = name; format(string, sizeof(string), "You have set division 2's name to %s", name); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } case 3: { FacInfo[1][fDiv3] = name; format(string, sizeof(string), "You have set division 3's name to %s", name); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } case 4: { FacInfo[1][fDiv4] = name; format(string, sizeof(string), "You have set division 4's name to %s", name); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } case 5: { FacInfo[1][fDiv5] = name; format(string, sizeof(string), "You have set division 5's name to %s", name); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } } return 1; }