SA-MP Forums Archive
How to create Exp And Level System - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to create Exp And Level System (/showthread.php?tid=516012)



How to create Exp And Level System - Loveno - 29.05.2014

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


Re: How to create Exp And Level System - Ciandlah - 29.05.2014

Hope this helps you

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

Kind Regards
Ciandlah


Re: How to create Exp And Level System - Loveno - 29.05.2014

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


Re: How to create Exp And Level System - Ciandlah - 29.05.2014

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


Re: How to create Exp And Level System - Loveno - 29.05.2014

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


Re: How to create Exp And Level System - Loveno - 30.05.2014

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


Re: How to create Exp And Level System - MacT - 30.05.2014

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;
}



Re: How to create Exp And Level System - Loveno - 30.05.2014

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