[Ajuda]Sistema Level
#5

pawn Код:
#include <a_samp>
#include <dini>


#define COR_AQUI      0xFFFFFFAA


new Level[MAX_PLAYERS];
new Respeito[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    if(dini_Isset("levels.dkn",PlayerName(playerid))) Level[playerid] = (playerid,dini_Int("levels.dkn",PlayerName(playerid)));
    SetTimerEx("Timer",60000,true,"d",playerid);
    return 1;
}

forward Timer(playerid);
public Timer(playerid)
{
    Respeito[playerid]++;
    SendClientMessage(playerid,COR_AQUI,"Gratz,your respect has grown a bit more!!");
    if(Respeito[playerid] == 5)
    {
        SendClientMessage(playerid,COR_AQUI,"Gratz,you leveled up!!");
    }
    return 1;
}

public OnGameModeInit()
{
    if(!fexist("levels.dkn")) dini_Create("levels.dkn");
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    dini_IntSet("levels.dkn",PlayerName(playerid),Level[playerid]);
    return 1;
}

public OnPlayerConnect(playerid)
{
    dini_IntSet("levels.dkn",PlayerName(playerid),Level[playerid]);
    if(dini_Isset("levels.dkn",PlayerName(playerid))) SetPlayerScore(playerid,dini_Int("levels.dkn",PlayerName(playerid)));
    return 1;
}

stock PlayerName(playerid)
{
    new PlayerNameLevel[MAX_PLAYERS];
    GetPlayerName(playerid, PlayerNameLevel, MAX_PLAYERS);
    return PlayerNameLevel;
}
Reply


Messages In This Thread
[Ajuda]Sistema Level - by =WoR=Bruno - 09.03.2011, 15:05
Re: [Ajuda]Sistema Level - by JonathanFeitosa - 09.03.2011, 17:05
Re: [Ajuda]Sistema Level - by leandro123456 - 09.03.2011, 17:24
Re: [Ajuda]Sistema Level - by Ricop522 - 09.03.2011, 18:33
Re: [Ajuda]Sistema Level - by zSuYaNw - 10.03.2011, 14:06

Forum Jump:


Users browsing this thread: 1 Guest(s)