Little help (+REP) - 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: Little help (+REP) (
/showthread.php?tid=325916)
Little help (+REP) -
NeroX98 - 15.03.2012
Can someone who is bored
to make Mini level system for me?
In the level system i want to have experience points and levels.
1 minute will be 1 experience point and 1 level will need (example) 450 xp.
So every 1 minute you will get 1 exp point.
Levels should be:
1Level - 400 XP
2Level - 800 XP
3Level - 1200 XP
4Level - 1600 XP
This is example
I've tried to make this simple level system but i dont know how to put the timer
Re: Little help (+REP) -
WardenCS - 15.03.2012
Код:
#include <a_samp>
new exp[MAX_PLAYERS];
new level[MAX_PLAYERS];
forward exptimer();
public OnGameModeInit()
{
SetTimer("exptimer", 60000, 1);
return 1;
}
public exptimer()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
exp[i] += 1;
if(exp[i] == 400 && level[i] == 0)
{
SendClientMessage(i,0xFFFFFFFF,"Level up,you are now level 1!");
level[i] = 1;
exp[i] = 0;
}
if(exp[i] == 800 && level[i] == 1)
{
SendClientMessage(i,0xFFFFFFFF,"Level up,you are now level 2!");
level[i] = 2;
exp[i] = 0;
}
if(exp[i] == 1200 && level[i] == 2)
{
SendClientMessage(i,0xFFFFFFFF,"Level up,you are now level 3!");
level[i] = 3;
exp[i] = 0;
}
if(exp[i] == 1600 && level[i] == 3)
{
SendClientMessage(i,0xFFFFFFFF,"Level up,you are now level 4!");
level[i] = 4;
exp[i] = 0;
}
}
return 1;
}
i dont know if its working but try
if you get 400 exp you will get level 1 and it will reset your exp and so on