How do i make a Level and XP System?
#1

Okay, i had an Idea for a little game mode i want to make and i need to know how to add levels and exp.
I wanted 30 Levels and from level 1 - 2 i need exp requirements like 650 exp to level 2 and so on.
How is this possible to make (i have seen exp systems on other servers)
Reply
#2

Create a variable called something like ExperiencePoints[MAX_PLAYERS]; every thing that you want to make the xp go up, like kills, deaths, etc add onto that, then every kill or something that the player gets, make it check for a level up, i might make a Level system now that im thinking of it
Reply
#3

can i have an example (in pawno) because i still don't get it.
also i am new to the whole server making side of sa-mp
Reply
#4

Since you arn't that experienced in pawn you shouldn't start making rank systems with xp, start on something small, try editing the lvdm gamemode.
Reply
#5

on top of your script.
pawn Код:
new ExpPoints[MAX_PLAYERS];
Somewhere like onplayerdeath
pawn Код:
ExpPoints[playerid] ++;
//or
ExpPoints[playerid]+=amount;
somewhere else
pawn Код:
if(ExpPoints[playerid] == amount)
{
//do your code for ranking
}
Hope this helps you abit
Reply
#6

thanks for that seven but, how can i set the exp per kill? and exp requirements per rank?
also how would i add more exp per kill streak?
1 kill = 1 exp. total = 1 exp
2 kill streak = 2 exp. total = 3 exp
3 kill streak = 3 exp. total = 6 exp
4 kill streak = 4 exp. total - 10 exp
5 kill streak = 5 exp. total = 15 exp
and so on.
Reply
#7

If you want them to have so everytime they join back in the game, use Dini to save the scores and stuff and they could buy or get guns or something with all there Exp idk :P
Reply
#8

ontop of your script add
pawn Код:
new PlayersRank[MAX_PLAYERS];
then on that script which the other guy just posted:
pawn Код:
if(ExpPoints[playerid] == 100)// ammount of xp needed to get to level 2
{
    PlayersRank[playerid] = 2;// set the players level to 2 if the player has 100 xp
}
Reply
#9

Hm, but how to make weapons skills with ranks, so your in rank 2 and you have like 20% of weapon skill, accuracy, damage... is better on higher ranks.
Reply
#10

Код:
if(Rank[playerid] == 2){
    SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 2);
    //Do this with all the possible weapons
}
( https://sampwiki.blast.hk/wiki/SetPlayerSkillLevel )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)