27.06.2014, 06:14
What is this for
Quote:
dcmd_changemode(playerid, params[]) { if (IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdminLevel] > 2){ new idx,gamemode,tmp[256],string[128]; tmp = strtok(params, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_ERROR, "USAGE: /changemode (gamemode) - Enter A Number 1 - 3"); return 1; } if(!isNumeric(tmp)) { SendClientMessage(playerid, COLOR_ERROR, "Invalid Gamemode Please Use A Numeric Character."); return 1; } gamemode = strval(tmp); if(gamemode < 1 || gamemode > 3) { SendClientMessage(playerid, COLOR_ERROR, "Invalid Gamemode Please Enter A Number 1 - 3."); return 1; } for(new i = 0; i < GetMaxPlayers(); i++) { if(IsPlayerConnected(i)) { //SendClientMessage(i,COLOR_SERVER_HELP_MSG, "The Week is Over! - Please Reconnect."); PlayerInfo[i][pSpawn] = 0; //Kick(i); } } switch (gamemode) { case 1: { format(string, sizeof(string), "{FFFFFF}Game Mode Changed: {BDBDBD}Los Santos"); } case 2: { format(string, sizeof(string), "{FFFFFF}Game Mode Changed: {BDBDBD}Las Venturas"); } case 3: { format(string, sizeof(string), "{FFFFFF}Game Mode Changed: {BDBDBD}San Fierro"); } } SendClientMessage(playerid,COLOR_SERVER_MAIN_MSG, string); format(string, sizeof(string), "UPDATE server SET Gamemode = '%d' WHERE Server = '2'",gamemode); mysql_query(string); GameTextForAll("~b~THE WEEK IS OVER!~n~~w~CHANGING CITIES", 5000, 3); SendClientMessageToAll(COLOR_SERVER_MAIN_MSG, "{FFFFFF}The Week is Over! - {FF0000}Changing Cities"); SendRconCommand("gmx"); }else{ SendClientMessage(playerid, COLOR_ERROR, "Unknown Command! Type /cmds For Available Commands."); } return 1; } |