how to make dynamic levels?
#1

how to make dynamic levels with exp.
Level1: max exp 24
Level2: x2
Level3: x2
Level4: etc
and get player % level?
Reply
#2

First, you must create player variable.

new XP[MAX_PLAYERS];

Then you put XP[playerid] += amount; where you want the players gets points.

For example (This gives a killer 1 point):

public OnPlayerDeath(playerid, killerid, reason)
{
XP[killerid] += 1;
return 1;
}

Levels you can do like this:

if(XP[playerid] < 25){
SendClientMessage(playerid, -1, "You are level 1.");
}; //when he has point from 0 to 24

else if(XP[playerid] > 24 && XP[playerid] < 51){
SendClientMessage(playerid, -1, "You are level 2.");
}; //when he has points from 25 to 50

else if(XP[playerid] > 50 && XP[playerid] < 71) {
SendClientMessage(playerid, -1, "You are level 3.");
}; //when he has points from 51 to 70
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)