leveling syteam help
#1

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
Reply
#2

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)
Reply
#3

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
Reply
#4

*Bump
Reply
#5

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.
Reply
#6

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
Reply
#7

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
Reply
#8

SetPlayerScore(playerid, PLAYING TIME);

71 in this case is the value defined with SetPlayerScore:
Reply
#9

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;
}

Reply
#10

*bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)