money=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: money=score (
/showthread.php?tid=101520)
money=score -
addysnow1 - 11.10.2009
Might this is a stupid question but i couldn't found it somewere, how i can set the player money as score?
Re: money=score -
SpiderPork - 11.10.2009
pawn Код:
// On top
forward ScoreUpdate();
// OnGameModeInit/FilterScriptInit
SetTimer("ScoreUpdate", 1000, 1);
// Outside of any callbacks/functions
public ScoreUpdate()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
SetPlayerScore(playerid, GetPlayerMoney(playerid));
}
}
}
Re: money=score -
[eLg]Timmy - 11.10.2009
Quote:
Originally Posted by SpiderPork
pawn Код:
// On top forward ScoreUpdate();
// OnGameModeInit/FilterScriptInit SetTimer("ScoreUpdate", 1000, 1);
// Outside of any callbacks/functions public ScoreUpdate() { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { SetPlayerScore(playerid, GetPlayerMoney(playerid)); } } }
|
Should be
pawn Код:
SetPlayerScore(i, GetPlayerMoney(i));
Re: money=score -
SpiderPork - 11.10.2009
True. My mistake, just a typo.