ANy help I dont know this mean
#1

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;
}

Reply
#2

Here is a explanation.

pawn Код:
dcmd_changemode(playerid, params[]) // Command using DCMD.
{
    if (IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdminLevel] > 2){ // If the player is A: Logged into rcon or 2: Level 3 Admin+ in-game
        new idx,gamemode,tmp[256],string[128]; // Local varible defines.
        tmp = strtok(params, idx);
        if(!strlen(tmp)) // If the String length is too short(Syntax is not correct) It sends the message below.
        {
            SendClientMessage(playerid, COLOR_ERROR, "USAGE: /changemode (gamemode) - Enter A Number 1 - 3");
            return 1;
        }
        if(!isNumeric(tmp))// If you use a Letter instead of a number, the following is sent.
        {
            SendClientMessage(playerid, COLOR_ERROR, "Invalid Gamemode Please Use A Numeric Character.");
            return 1;
        }
        gamemode = strval(tmp); // Gamemode = the  String Value inputed.
        if(gamemode < 1 || gamemode > 3) // String value can't be less then 1, or greater then 3
        {
            SendClientMessage(playerid, COLOR_ERROR, "Invalid Gamemode Please Enter A Number 1 - 3.");
            return 1;
        }
        for(new i = 0; i < GetMaxPlayers(); i++) // Instead of playerid, it uses i, to loop through all players.
        {
            if(IsPlayerConnected(i)) // Seeing if the playerid is Connected.
            {
                //SendClientMessage(i,COLOR_SERVER_HELP_MSG, "The Week is Over! - Please Reconnect.");
                PlayerInfo[i][pSpawn] = 0;
                //Kick(i);
            }
        }
        switch (gamemode) // The String Value, which was entered earlier.
        {
            case 1: // If 1 is entered, then Change to Los Santos.
            {
                format(string, sizeof(string), "{FFFFFF}Game Mode Changed: {BDBDBD}Los Santos");
            }
            case 2: // If 2 was entered, then change to Las Venturas
            {
                format(string, sizeof(string), "{FFFFFF}Game Mode Changed: {BDBDBD}Las Venturas");
            }
            case 3: // If 3 was entered, change to San Fierro.
            {
                format(string, sizeof(string), "{FFFFFF}Game Mode Changed: {BDBDBD}San Fierro");
            }
        }
        SendClientMessage(playerid,COLOR_SERVER_MAIN_MSG, string);
        // Updates 'Server' and sets 'Gamemode' to the value inputed, at 'Server' through the SQL database.
        format(string, sizeof(string), "UPDATE server SET Gamemode = '%d' WHERE Server = '2'",gamemode);
        mysql_query(string); // Query's the SQL
        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"); // Restarts the server, once the new Gamemode is set.
    }else{
        SendClientMessage(playerid, COLOR_ERROR, "Unknown Command! Type /cmds For Available Commands.");
    }
    return 1;
}
Reply
#3

Thanks Btw Why i do /changemode nothings happen
Reply
#4

Prefix for the command is
Код:
/changemode [Number]
where 1 = Los Santos
where 2 = Las Venturas
where 3 = San Fierro

Basicly this command changes the city where the game is 'played'
Enviromental change.
Reply
#5

Its nothing happend sir can u help me with ir or try to observe if ur Free
Reply
#6

How about ill gonna disable the 3 maps! ill gonna make it into 1 because that Map selecting u can Rob in LV, SF if u chose LS how i can REmove the Selection
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)