How to create Exp And Level System
#1

hey i dont know how to create exp and level system with dini , and every level up the exp will*2 .
example : 1 kill = 10 exp , and for level up to level 2 you need 100 . and when player reach level 2 so he need 200 for the next level .

sorry for my bad english
thanks before
rep ++ for who helped
Reply
#2

Hope this helps you

https://sampforum.blast.hk/showthread.php?tid=377207

Kind Regards
Ciandlah
Reply
#3

oh oke , and how to make it automatically level up ? so no need use /levelup ?
Reply
#4

Here you go hope this helps you out

Код:
new Exp[MAX_PLAYERS];

//Place this timer where you want it to go

Exp[playerid] = SetTimerEx("UpdateExp", 60000, true, "i", playerid);

forward UpdateExp(playerid);
public UpdateExp(playerid)
{
	if(IsPlayerConnected(playerid))
	{
		// The leveling up command goes here, whats inside the command not the /levelup peice
		return 1;
	}
	return 1;
}
Kind Regards
Ciandlah
Reply
#5

oke i'll try , thanks for your help .
rep given
Reply
#6

how to make for level up to level 2 need 100 exp ?
and level 3 need 200 exp and level 4 need 300 - level 10 need 900 exp - level 25 .
and how to make when player kill someone got 20 exp ?
thanks before
Reply
#7

You need use player enums and then he got 200 exp his level go up, I try make code to you.

pawn Код:
#include <a_samp>

enum pInfo
{
    Level,
    EXP
}
new PlayerInfo[MAX_PLAYERS][pInfo];
 
public OnPlayerSpawn(playerid)
{
        if(PlayerInfo[playerid][EXP] == 100)
        {
            PlayerInfo[playerid][Level] +=1;
        }
        if(PlayerInfo[playerid][EXP] == 200)
        {
            PlayerInfo[playerid][Level] +=1;
        }
        if(PlayerInfo[playerid][EXP] == 300)
        {
            PlayerInfo[playerid][Level] +=1;
        }
        if(PlayerInfo[playerid][EXP] == 400)
        {
            PlayerInfo[playerid][Level] +=1;
        }
        return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    PlayerInfo[killerid][EXP] -= 1;
    GivePlayerMoney(killerid, 5000);
        return 1;
}
Reply
#8

i have it MacT , just dont know how to create it .
thanks for your help
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)