12.06.2014, 18:16
pawn Код:
#include <a_samp>
#include <zcmd>
enum PlayerInfo
{
Exp,
CurExp,
Level,
}
new pInfo[MAX_PLAYERS][PlayerInfo];
CMD:test(playerid, params[])
{
SetTimer("LevelTimer", 1800000, true);
pInfo[playerid][Exp] = 8;
pInfo[playerid][Level] = 1;
return 1;
}
forward LevelTimer(playerid);
public LevelTimer(playerid)
{
new string[128];
if(pInfo[playerid][CurExp] != pInfo[playerid][Exp])
{
pInfo[playerid][CurExp] += 1;
format(string, sizeof(string), "SERVER:{FFFFFF} Level progression: {BF4B4B}%d{FFFFFF}/{60B34B}%d{FFFFFF}. Next payday in 30 minutes.", pInfo[playerid][CurExp], pInfo[playerid][Exp]);
SendClientMessage(playerid, 0x46E850FF, string);
}
else if(pInfo[playerid][CurExp] == pInfo[playerid][Exp])
{
pInfo[playerid][CurExp] = 0;
pInfo[playerid][Exp] += 8;
pInfo[playerid][Level] += 1;
format(string, sizeof(string), "SERVER:{FFFFFF} You have leveled up! New level: {FFBB00}%d{FFFFFF}!", pInfo[playerid][Level]);
SendClientMessage(playerid, 0x46E850FF, string);
format(string, sizeof(string), "SERVER:{FFFFFF} Experience necessities upgraded: {BF4B4B}%d{FFFFFF}/{FFBB00}%d{FFFFFF}.", pInfo[playerid][CurExp], pInfo[playerid][Exp]);
SendClientMessage(playerid, 0x46E850FF, string);
}
return 1;
}