Level system ! (+REP for help)
#1

Hello all !
I want to make a Level System for my new gamemode but i do not know where to start
And i want to be : 1hour = 1lvl = 1score
I mean at 1 hour played to be a 1Level (TAB=Score)
And my server is with basic enum pInfo and Login/Register system
If you help me , + REP you

Reply
#2

Show your enum.
Reply
#3

Код:
enum pInfo
{
    pPass,
    pCash,
    pAdmin,
    pSex,
    pAge,
	pSkin,
	pTeam,
	pAccent,
	pTaxiLic,
	Leader,
	Member,
	Rank

}
new PlayerInfo[MAX_PLAYERS][pInfo];
Reply
#4

require y_timers, foreach
Add pCSecs, pLevel to your enum
pawn Код:
// UPDATE Player connect time per secs
task UpdatePerSecs[1000]()
{
    foreach(new i : Player)
    {
        PlayerInfo[i][pCSecs]++;
        // 1 hours
        if(PlayerInfo[i][pCSecs] >= 3600)
        {
            PlayerInfo[i][pCSecs] -= 3600;
            PlayerInfo[i][pLevel]++;
            SetPlayerScore(playerid, PlayerInfo[i][pLevel]);
        }
    }
}
Reply
#5

I dont undersand put the pLevel and pCSecs on INI_ to save on accounts ? .ini
Reply
#6

And i want a SendClientMessage on fix hours " Its fix hour and you gained a 1level you have a Level
Reply
#7

And where put this "task"?
Reply
#8

you can save player level, connecttime when they disconnect ( use dini, y_ini or whatever you want )

if you want send mess when they level up just add SendClientMessage after
pawn Код:
SetPlayerScore(playerid, PlayerInfo[i][pLevel]);
about "task" read more here : https://sampforum.blast.hk/showthread.php?tid=182948
Reply
#9

Код:
D:\Old City RolePlay v0.1\pawno\include\YSI\y_iterate.inc(179) : fatal error 111: user error: "Old foreach.inc files are no longer compatible with YSI."


Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#10

http://forum.sa-mp.com/showpost.php?...58&postcount=9
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)