Making jobs , job spawns colors
#6

The code provided by @MSC won't work properly, as if you change the variable's value, it will be given to the whole server's players. As they are not per-player variables. Plus could easily avoid one variable per job, and declare an array.


Код:
enum
{
    Farmer,
    Lumberjack,
    Miner,
    Unemployed
};

new PlayerJob[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    switch(PlayerJob[playerid])
    {
        case Farmer: SetPlayerColor(playerid, -1);
        case Lumberjack: SetPlayerColor(playerid, -1);
        case Miner: SetPlayerColor(playerid, -1);
        case Unemployed: SetPlayerColor(playerid, -1);
    }
    return 1;
}
Reply


Messages In This Thread
Making jobs , job spawns colors - by TheButler - 16.02.2019, 10:23
Re: Making jobs , job spawns colors - by MSC - 16.02.2019, 11:11
Re: Making jobs , job spawns colors - by TheButler - 16.02.2019, 11:22
Re: Making jobs , job spawns colors - by MSC - 16.02.2019, 12:08
Re: Making jobs , job spawns colors - by TheButler - 16.02.2019, 12:18
Re: Making jobs , job spawns colors - by TheToretto - 16.02.2019, 12:32

Forum Jump:


Users browsing this thread: 2 Guest(s)