How to give level per payday? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to give level per payday? (
/showthread.php?tid=433680)
How to give level per payday? -
lQs - 28.04.2013
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
}
Re: How to give level per payday? -
Nostrum - 28.04.2013
Replace money with new level?
Quote:
new nextlevel = PlayerInfo[targetid][pLevel]+1;
|
Re: How to give level per payday? -
lQs - 28.04.2013
I want money and level, not only level.
Re: How to give level per payday? -
Nostrum - 28.04.2013
Look at your buylevel or levelup cmd, copy the line which gives the player a level and add it to your payday script..
Re: How to give level per payday? -
Tamer - 28.04.2013
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
Re: How to give level per payday? -
lQs - 28.04.2013
Solved, thx Tamer T.