How to create Exp And Level System
#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


Messages In This Thread
How to create Exp And Level System - by Loveno - 29.05.2014, 07:51
Re: How to create Exp And Level System - by Ciandlah - 29.05.2014, 07:52
Re: How to create Exp And Level System - by Loveno - 29.05.2014, 07:55
Re: How to create Exp And Level System - by Ciandlah - 29.05.2014, 08:00
Re: How to create Exp And Level System - by Loveno - 29.05.2014, 08:23
Re: How to create Exp And Level System - by Loveno - 30.05.2014, 07:01
Re: How to create Exp And Level System - by MacT - 30.05.2014, 07:11
Re: How to create Exp And Level System - by Loveno - 30.05.2014, 07:17

Forum Jump:


Users browsing this thread: 2 Guest(s)