Xp(score) earning...
#1

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)...
Reply
#2

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;
}
Reply
#3

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)...
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)