Xp(score) earning... - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Xp(score) earning... (
/showthread.php?tid=249755)
Xp(score) earning... -
Vvolk - 20.04.2011
I want to do that in my server every people can get xp but it don't work. Please chech my code and say for me where is bug or write here your code. This my code:
At the top:
Код HTML:
#include <a_samp>
#if defined FILTERSCRIPT
SetTimer("ScoreTimer",60000,true);
This at the bottom
Код HTML:
public ScoreTimer()
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
SetPlayerScore(i,GetPlayerScore(i)+3);
}
}
}
And can you please write here code or say how to do than V.I.P. can get 50% more XP(SCORES)...
Re: Xp(score) earning... -
Mean - 20.04.2011
You have put SetTimer under if defined FILTERSCRIPT, you need to put it under OnGameModeInit( ) .
Also, you need to forward it, so public should look like this:
pawn Код:
forward ScoreTimer( );
public ScoreTimer( )
{
for( new i = 0; i < MAX_PLAYERS; i++ )
{
if( IsPlayerConnected( i ) )
{
SetPlayerScore(i,GetPlayerScore(i)+3);
}
}
}
About timer,
pawn Код:
public OnGameModeInit( )
{
SetTimer("ScoreTimer",60000,true);
return 1;
}
Re: Xp(score) earning... -
Vvolk - 20.04.2011
Thank you very much...

I have a question: What include I need to do vip system ant to do that vips can get 5xp a minute

(normal peoples can get 3 xp a minute)...
Re: Xp(score) earning... -
Mean - 20.04.2011
You need to use Variables for checking if player is VIP and you need to save stats to a file. Check for admin system in the filterscripts section, some have VIP system.