Problem with score.
#1

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

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

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;
}

Reply
#4

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

I got an Error:
Quote:

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

Reply
#6

Use,
pawn Код:
IsPlayerConnected(x)
Reply
#7

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?
Reply
#8

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
Reply
#9

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

Thank you!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)