24.07.2012, 19:57
how to make a experience system with timer and textdraw ? any tutorial
new Exp[MAX_PLAYERS]; //experience new Lv[MAX_PLAYERS]; //level forward LevelUp(playerid);
SetTimer("LevelUp", 1000, false);
public LevelUp(playerid)
{
if(LevelNext(playerid) >= Exp[playerid]) {
Exp[playerid] = 0;
Lv[playerid] ++;
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
}
}
stock LevelNext(playerid){
return (Lv[playerid] * 5);
}

|
Try this code, I did it fast ..
Code:
new Exp[MAX_PLAYERS]; //experience new Lv[MAX_PLAYERS]; //level forward LevelUp(playerid); Code:
SetTimer("LevelUp", 1000, false);
Code:
public LevelUp(playerid)
{
if(LevelNext(playerid) >= Exp[playerid]) {
Exp[playerid] = 0;
Lv[playerid] ++;
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
}
}
Code:
stock LevelNext(playerid){
return (Lv[playerid] * 5);
}
Do not promise anything eh ![]() Otherwise, use one of these: https://sampforum.blast.hk/showthread.php?tid=353225 https://sampforum.blast.hk/showthread.php?tid=274680 |
SetTimerEx("MoneyCheck", 2000, true, "i", playerid);
public CheckMoney(playerid)
{
new stringcheck[128];
format(stringcheck, sizeof(stringcheck), "%08dFt", GetPlayerMoney(playerid));
// your textdraw configuration
return 1;
}