Score...
#1

Hello!
I have this
pawn Код:
public score100(playerid)
{
    if(ScoreUpdate[playerid] == 1)
    {
        if(GetPlayerScore(playerid) >= 100)
        {
            SendClientMessage(playerid,COLOR_GREEN,"Congratulation! You won 50k for achieving 100 points.");
      new name[MAX_PLAYER_NAME];
            GetPlayerName(playerid,name,MAX_PLAYER_NAME);
            format(msg,sizeof(msg),"%s has won 50k for achieving 100 points.",name,playerid);
            SendClientMessageToAll(COLOR_YELLOW,msg);
            GivePlayerMoney(playerid, 10000);
            ScoreUpdate[playerid] = 2;
        }
    }
}
(Someone helped me do this)
It gives the player 10k if he reaches 50 points!
Ok so far so good...but when i relog with the same 50 score or more it give me money again!
How to fix it?

Thanks!
Reply
#2

on player disconnect
ScoreUpdate[playerid] = 0;

i dont understand so much your problem
Reply
#3

I have a saving Points System!
So i made that small thingy that at 50 points the players get 10k!
But if that player has 50 points ,or more when he relogs he will receive the 10k again (which i dont want to happen)!

Reply
#4

Then don't save the score at all...?

or try

Under OnPlayerDisconnect

pawn Код:
if(GetPlayerScore >= 100) // change this to 50 if you want that if he gets 50 points that it goes away)
{
SetPlayerScore(playerid, 0);
}
if you want to add that it says if you got less then 50 points (in this case 100 score)
pawn Код:
{
else if(GetPlayerScore < 100)
ScoreUpdate[playerid] = 1; // or what it actually saves the score
}
Reply
#5

Yea nice works

Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)