How to give level per payday?
#1

Hi, i have a problem. I mean, how i can add function which add 1 level per payday?

This is my payday function:

pawn Код:
forward payday(playerid);
public payday(playerid)
{
    new hh, mm, ss;
    gettime( hh, mm, ss );

    if( mm == 0 )
    {
        for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
        {
            new string[128];
            new RandomPay = random(1000 - 400) + 100;
            server_GiveCash( playerid, RandomPay );
            SendClientMessage(playerid, COLOR_WHITE,"----PAYCHECK----");
            format(string, sizeof(string), "Your earnings: $%i", RandomPay);
            SendClientMessage(i, COLOR_WHITE, string);
            SendClientMessage(playerid, COLOR_WHITE,"-------------------------");
        }
    }
    return 1;
}
pInfo:

pawn Код:
enum pInfo
{
    pPass,
    pCash,
    pSkin,
    pLevel,
    pInt,
    pVW,
    pAdmin,
    pSecKey,
    pKills,
    pDeaths,
    Float:pFacingAngle,
    Float:pHealth,
    Float:pArmour,
    Float:pLastX,
    Float:pLastY,
    Float:pLastZ
}
Reply
#2

Replace money with new level?
Quote:

new nextlevel = PlayerInfo[targetid][pLevel]+1;

Reply
#3

I want money and level, not only level.
Reply
#4

Look at your buylevel or levelup cmd, copy the line which gives the player a level and add it to your payday script..
Reply
#5

pawn Код:
pInfo[i][pLevel] ++;// increases by one per payday
Put it under your server_Givecash function at the code you wrote above,between the clientmessage
Reply
#6

Solved, thx Tamer T.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)