Score timer does not work
#1

I've request a score timer in the script request thread #5,it seemed to be working but it doesn't.
Here's the code:
pawn Код:
#include <a_samp>
new ScoreTimer;

public OnPlayerUpdate(playerid)
{
    new time = gettime();
    if(ScoreTimer < time)
    {
        ScoreTimer++;
    }
    if(ScoreTimer == 60)
    {
        new score = GetPlayerScore(playerid);
        SetPlayerScore(playerid, score+1);
        ScoreTimer = 0;
    }
    return 1;
}
Whats really wrong?
Reply
#2

Nobody ?
Reply
#3

"new time = gettime();" will return something like this "1346348439"
OnPlayerUpdate(playerid) - "This callback is called very frequently per second per player, only use it when you know what it's meant for."

I do not understand exactly what you're doing whit this script ...
"a score timer" ... Explain a bit more ...
Reply
#4

pawn Код:
#include <a_samp>
new ScoreTimer[MAX_PLAYERS];
new ScoreTimerr[MAX_PLAYERS];

forward UpdateScore(playerid);

public OnPlayerConnect(playerid)
{
    ScoreTimerr[playerid] = SetTimerEx("UpdateScore", 1000, true, "i", playerid);
    ScoreTimer[playerid] = 0;
    return 1;
}

public OnPlayerDisconnect(playerid)
{
    KillTimer(ScoreTimerr[playerid]);
    return 1;
}

public UpdateScore(playerid)
{
    ScoreTimer[playerid] ++;
    if(ScoreTimer[playerid] == 60)
    {
        SetPlayerScore(playerid, GetPlayerScore(playerid) +1);
        ScoreTimer[playerid] = 0;
    }
    return 1;
}
Reply
#5

Never mind both of you.
Solved.
And a score timer is a score timer,what you did not understood?
And don't make me think that you did not understood what i meant because i provided you a code so stfu.
Reply
#6

Quote:
Originally Posted by Johnson_Brooks
Посмотреть сообщение
Never mind both of you.
Solved.
And a score timer is a score timer,what you did not understood?
And don't make me think that you did not understood what i meant because i provided you a code so stfu.
There is really no need to be insultibe.They are trying to help you and you are telling them to shut the fuck up. A score timer doesn't make sense, it's just a name that you use someone else might call it differently. Now I understand it increases the score every minute but maybe someone else doesn't.
Reply
#7

I didn't insult him.
I got a little bit pissed of because he double posted to increase his post count.
I provided a code and he asked me what exactly i mean by saying score timer.
That means he didn't even read the whole topic but just the subject.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)