SA-MP Forums Archive
Problem with score. - 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: Problem with score. (/showthread.php?tid=285727)



Problem with score. - Zaito - 25.09.2011

Hey Guys!!! how to create the command 1 score per minute


Re: Problem with score. - [MWR]Blood - 25.09.2011

Create a callback and then a timer of 60,000 ms which will call the callback you made.


Re: Problem with score. - Zaito - 25.09.2011

like this one? :

Quote:

#include <a_samp>

new GiveScoreTimer[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
GiveScoreTimer[playerid] = SetTimerEx ("GivePlayerScore", 1000*60, true, "d", playerid);
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
KillTimer(GiveScoreTimer[playerid]);
return 1;
}

forward GivePlayerScore(playerid);
public GivePlayerScore(playerid)
{
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
return 1;
}




Re: Problem with score. - [HiC]TheKiller - 25.09.2011

pawn Код:
//On OnGameModeInit / OnFilterScriptInit
SetTimer("playerscore", 60000, true);

//Anywhere
forward playerscore();
public playerscore()
{
    for(new x; x<MAX_PLAYERS; x++)
    {
        if(!IsPlayerConnect(x)) continue;
        SetPlayerScore(x, GetPlayerScore(x) + 1);
    }
    return 1;
}
Or you could use a timer per player.


Re: Problem with score. - Zaito - 25.09.2011

I got an Error:
Quote:

E:\Games\Rockstar Games\GTA San Andreas\SAMP\gamemodes\XS.pwn(60) : error 017: undefined symbol "IsPlayerConnect"




Re: Problem with score. - Luis- - 25.09.2011

Use,
pawn Код:
IsPlayerConnected(x)



Re: Problem with score. - Kostas' - 25.09.2011

I added it on my gamemode and i got score every .. minute.
But when i disconnect I have 0 score again. How can i save it?


Re: Problem with score. - [MWR]Blood - 25.09.2011

Quote:
Originally Posted by Kostas'
Посмотреть сообщение
I added it on my gamemode and i got score every .. minute.
But when i disconnect I have 0 score again. How can i save it?
By using this, for example.
https://sampforum.blast.hk/showthread.php?tid=169029


Re: Problem with score. - iJumbo - 25.09.2011

use a saving system .. Y_ini dini MySQL there are 309842038402938 tutorials just use search button


Re: Problem with score. - Kostas' - 25.09.2011

Thank you!