Job Help
#1

Hello, I need Help.

pawn Код:
COMMAND:posao(playerid, params[])
{
    new level, targetid;
    if(PlayerInfo[playerid][pPosao] == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 3, 1769.9082,-2048.7869,13.5608))
        {
            SendClientMessage(playerid, COLOR_YELLOW, ""COL_RED"[BalkanWorld] "COL_YELLOW"Uspesno ste se zaposlili kao komunalac!");
            SendClientMessage(playerid, COLOR_YELLOW, ""COL_RED"[BalkanWorld] "COL_YELLOW"Da uzemete opremu /oprema!");
            PlayerInfo[targetid][pPosao] = level;
        }
    }
    else return SendClientMessage(playerid,-1,""COL_RED"[BalkanWorld] "COL_YELLOW"Vec ste zaposljeni!");
    return 1;
}
What i am trying here to make is an job command that saves players job in PlayerInfo

My Enum

pawn Код:
enum pInfo
{
    pPass,
    pCash,
    pAdmin,
    pKills,
    pDeaths,
    pPosao,
    pSkin
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Reply
#2

I do not understand friend, better specify what your problem
Reply
#3

Quote:
Originally Posted by Cerealguy
Посмотреть сообщение
I do not understand friend, better specify what your problem
He wanna make saving sys for pPosao = pJob
Reply
#4

I am trying to make an Job comamnd. My first job will be komunalac (don't know hot to say it in english ).
But when i write /posao i get the job but it dosent save in Player Info
___________________

Reply
#5

show onplayerdisconnect?
Reply
#6

Here sir.

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
    INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
    INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
    INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
    INI_WriteInt(File,"Posao",PlayerInfo[playerid][pPosao]);
    INI_WriteInt(File,"Skin",GetPlayerSkin(playerid));
    INI_Close(File);
    return 1;
}
Reply
#7

pawn Код:
COMMAND:posao(playerid, params[])
{
    new level;
    if(PlayerInfo[playerid][pPosao] == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 3, 1769.9082,-2048.7869,13.5608))
        {
            SendClientMessage(playerid, COLOR_YELLOW, ""COL_RED"[BalkanWorld] "COL_YELLOW"Uspesno ste se zaposlili kao komunalac!");
            SendClientMessage(playerid, COLOR_YELLOW, ""COL_RED"[BalkanWorld] "COL_YELLOW"Da uzemete opremu /oprema!");
            PlayerInfo[playerid][pPosao] = level;
        }
    }
    else return SendClientMessage(playerid,-1,""COL_RED"[BalkanWorld] "COL_YELLOW"Vec ste zaposljeni!");
    return 1;
}
I realized I had targetID, if you have no parameters in the command. SOLVED!
Reply
#8

It still dont save
pawn Код:
[data]
Password = 207159904
Cash = 0
Admin = 5
Kills = 0
Deaths = 0
Posao = 0
Skin = 26
Reply
#9

friend!, at your command you say:

PlayerInfo[playerid][pPosao] = level;

and level is = 0, since it is a default

pawn Код:
new level; //no given value, default is 0
Reply
#10

man you need to put your job level to save
PlayerInfo[playerid][pPosao] = level;
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)