How do i make a Level and XP System? -
tommzy09 - 17.09.2010
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)
Re: How do i make a Level and XP System? -
PinkFloydLover - 17.09.2010
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
Re: How do i make a Level and XP System? -
tommzy09 - 17.09.2010
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
Re: How do i make a Level and XP System? -
PinkFloydLover - 17.09.2010
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.
Re: How do i make a Level and XP System? -
Seven. - 17.09.2010
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
Re: How do i make a Level and XP System? -
tommzy09 - 17.09.2010
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.
Re: How do i make a Level and XP System? -
Steven82 - 18.09.2010
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
Re: How do i make a Level and XP System? -
PinkFloydLover - 18.09.2010
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
}
Re: How do i make a Level and XP System? -
nejc001 - 18.09.2010
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.
Re: How do i make a Level and XP System? -
Kwarde - 18.09.2010
Код:
if(Rank[playerid] == 2){
SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 2);
//Do this with all the possible weapons
}
(
https://sampwiki.blast.hk/wiki/SetPlayerSkillLevel )