SA-MP Forums Archive
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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Score... (/showthread.php?tid=148692)



Score... - ColdXX - 18.05.2010

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!


Re: Score... - iJumbo - 18.05.2010

on player disconnect
ScoreUpdate[playerid] = 0;

i dont understand so much your problem


Re: Score... - ColdXX - 18.05.2010

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)!




Re: Score... - MastahServers - 18.05.2010

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
}



Re: Score... - ColdXX - 18.05.2010

Yea nice works

Thanks!