SA-MP Forums Archive
leveling syteam help - 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: leveling syteam help (/showthread.php?tid=401241)



leveling syteam help - Matthew_Garrowo - 22.12.2012

I got a leveling syteam where it takes track of the hours the people have played for in my server when you type /stats you see the hours is there a way i can switch it so it just goes to the level?

what type of code do you need ill post it after you guys tell me


Re: leveling syteam help - park4bmx - 22.12.2012

what you mean it goes to the level??
you mean if they played 1 hr they get lvl 1 if they play 2hrs they get lvl2 ?
Quote:

This forum requires that you wait 120 seconds between posts.

Hate this so much, Now ;X (worst enemy)


Re: leveling syteam help - Matthew_Garrowo - 22.12.2012

yes i want it so it levels 1 level by the hour what code do you guys need or how do i do it and ill post it here


Re: leveling syteam help - Matthew_Garrowo - 24.12.2012

*Bump


Re: leveling syteam help - DaRk_RaiN - 24.12.2012

If you mean the time he played ingame in one single season (without disconnecting)
Use a simple variable
pawn Код:
Level[MAX_PLAYERS];
under OnPlayerConnect and OnPlayerDisconnect
pawn Код:
Level[playerid] =0;
under OnPlayerSpawn
pawn Код:
SetTimerEx("Levels", 60*60*1000, 1, "i", playerid);//one hour
pawn Код:
forward Levels(playerid);
public Levels(playerid)
{
Level[playerid]++;
if(Level[playerid] ==1)
{
//do what ever here
return 1;
}
if(Level[playerid] ==2)
{
//do what ever here
return 1;
}
if(Level[playerid] ==3)
{
//do what ever here
return 1;
}
P.S: those levels don't get saved.


Re: leveling syteam help - Lz - 24.12.2012

Tbh couldn't you just change the /stats command instead of showing "playing time: %s hours" to "level: %s" Would pretty much need to change nothing


Re: leveling syteam help - Matthew_Garrowo - 24.12.2012

i already got a system in and shows the hours i just want it to show up on the screen when you click TAB because all my players stay at 0 instead of it showing up


Re: leveling syteam help - SKAzini - 24.12.2012

SetPlayerScore(playerid, PLAYING TIME);

71 in this case is the value defined with SetPlayerScore:



Re: leveling syteam help - Matthew_Garrowo - 24.12.2012

Is This It And Can You Guys Teach Me To Reverse it so you dont buy levels they just go to straight to my level
is this the right code or do i fix it on my payday that i get every hour?

Quote:

CMD:upgradelevel(playerid, params[]) {
/* 1 level costs Level x min_level_upgrade_cost */
if(playerVariables[playerid][pBankMoney] >= playerVariables[playerid][pLevel] + 1 * assetVariables[3][aAssetValue] && playerVariables[playerid][pBankMoney] > 0) {
if(playerVariables[playerid][pLevel] >= 10)
return SendClientMessage(playerid, COLOR_GREY, "You're at the maximum level.");

if(FetchLevelFromHours(playerVariables[playerid][pPlayingHours]) == playerVariables[playerid][pLevel])
return SendClientMessage(playerid, COLOR_GREY, "You can't upgrade your level yet.");

playerVariables[playerid][pLevel] += 1;
playerVariables[playerid][pBankMoney] -= playerVariables[playerid][pLevel] + 1 * assetVariables[3][aAssetValue];

SetPlayerScore(playerid, playerVariables[playerid][pLevel]);
}
return 1;
}




Re: leveling syteam help - Matthew_Garrowo - 26.12.2012

*bump