Help score timer dont save
#1

Hi,

I make a SetTimer for my gamemod but dont save this.
Код:
 
forward Score (playerid);
SetTimer ("Score", 60000, true);
Score public (playerid)
{
for (new i=0; i<MAX_PLAYERS; i++)
{ 
if ( IsPlayerConnected ( i ) ) 
{ 
new Current;
Current = GetPlayerScore(i);
SetPlayerScore(i,Current + 1);
}
Reply
#2

I don't really understand what you're trying. Your script completely fails. First of all, try this:
pawn Код:
forward Score(playerid);

SetTimerEx("Score", 60000, true, "i", playerid); // Score is based on a player id, so use SetTimerEx

public Score(playerid)
{
   SetPlayerScore(playerid,GetPlayerScore(playerid) + 1);
   return 1;
}
And why would you make a loop at Score? It's already for playerids.
And you don't have to check if the player is connected, because it will only set a timer on the player who is connected.
Reply
#3

i try this, and is great. really thanks .

but i have an another question. (sorry for my bad english.)
look that screen please.
/imageshack/i/omgx.jpg/
Reply
#4

Well, try to translate for me what it says, and post the code.
Reply
#5

i dont have this code. maybe i need to make it in my GM.

But in my screen : "Prochain niveau" : 1714/2160 is the time left for the next level. (One level = 1score)
Reply
#6

Well, I can't fix anything if I don't have a code.
Reply
#7

thanks for the first help.
Reply
#8

Maybe this will work.

Код:
forward Score (playerid);
SetTimer ("Score",10*60000, true);
Score public (playerid)
{
for (new i=0; i<MAX_PLAYERS; i++)
{ 
if ( IsPlayerConnected ( i ) ) 
{ 
new Current;
Current = GetPlayerScore(i);
SetPlayerScore(i,Current + 1);
}
else

Код:
public OnPlayerConnect(playerid)
{
    SetTimerEx("GiveScore", 60*1000, true, "i", playerid);
    return 1;
}
forward GiveScore(playerid);
public GiveScore(playerid)
{
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
}
Reply
#9

Angel, your post is for my screenshot ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)