11.07.2016, 18:14
Код:
CMD:radiusfreeze(playerid, params[]) { new string[128], bool:toggle, admin[MAX_PLAYER_NAME], radi; if( Player[playerid][pAdmin] < 1 ) return SCM(pid, ADMIN_COLOR, ADMIN_MESSAGE); if( radi > 100 && Player[playerid][pAdmin] < 1337 ) return SCM(pid, ADMIN_COLOR, " You cannot use more than 100!"); if(sscanf(params, "f", radi)) return SCM(pid, -1, "{00E6FF}USAGE:{FFFFFF} /radiusfreeze [Range] {FF0000}(( USE AGAIN TO UNFREEZE ))"); GetPlayerName(playerid, admin, sizeof(admin)); for(new i = 0; i < MAX_PLAYERS; i++) { if(i == playerid) continue; if( bool:toggle == false ) { RadiusDetector(radi, playerid, i); TogglePlayerControllable(i, 1); format(string, sizeof(string), "{FF6347}[EVENT]{33CCFF} Admin {FF0000}%s {33CCFF}has unfrozen you", admin); SCM(i, -1, string); toggle = false; } else { RadiusDetector(radi, playerid, i); TogglePlayerControllable(i, 0); format(string, sizeof(string), "{FF6347}[EVENT]{33CCFF} Admin {FF0000}%s {33CCFF}has frozen you.", admin); SCM(i, -1, string); toggle = true; } } return 1; }
What is wrong with this script? Whenever I type "radiusfreeze" twice it sends the message with "Admin %s has unfrozen you" , and unfreezes the player.