SA-MP Forums Archive
Question - 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)
+--- Thread: Question (/showthread.php?tid=287669)



Question - Lookin - 04.10.2011

Is there a possible way to have it so your stars are your score?

i tryed using this

Код:
public OnPlayerUpdate(playerid)
{
      if(GetPlayerWantedLevel(playerid) == 1) 
      {
      SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
      return 0;
      }
      return 1;
}
but didnt seem to work

NOTE: indentations fine just the way i copy and paste


Re: Question - Basicz - 04.10.2011

stars = score? so 0 stars = 0 score, 1 stars = 1 score?
pawn Код:
public OnPlayerUpdate( playerid )
{
    if ( GetPlayerWantedLevel( playerid ) > 0 )
        SetPlayerScore( playerid, GetPlayerWantedLevel( playerid ) );

    return 1;
}
I highly recommend you to not return ' 0 ' in OnPlayerUpdate.


Re: Question - $India$ - 04.10.2011

pawn Код:
public OnPlayerUpdate(playerid)
{
        if(GetPlayerWantedLevel(playerid) > 0)
        SetPlayerScore(playerid,GetPlayerWantedLevel(playerid));
        return 1;
}



Re: Question - [MG]Dimi - 04.10.2011

And if you want to only add score without reseting to 0 just delete
pawn Код:
return 0;
.


Re: Question - [GOD]Dragonster82 - 04.10.2011

Quote:
Originally Posted by $India$
Посмотреть сообщение
pawn Код:
public OnPlayerUpdate(playerid)
{
        if(GetPlayerWantedLevel(playerid) > 0)
        SetPlayerScore(playerid,GetPlayerWantedLevel(playerid));
        return 1;
}
pawn Код:
public OnPlayerUpdate(playerid)
{
   
        if(GetPlayerWantedLevel(playerid) > 0)
        SetPlayerScore(playerid,GetPlayerWantedLevel(playerid));
        }
        new WantedLevel;
        WantedLevel = (GetPlayerWantedLevel, playerid)
        if(WantedLevel >= 6)
        {
                SendClientMessage(playerid,YOURCOLOR, "Sorry! Stars exceeded");
         }
return 1;



Re: Question - [MG]Dimi - 04.10.2011

Quote:
Originally Posted by [GOD]Dragonster82
Посмотреть сообщение
pawn Код:
public OnPlayerUpdate(playerid)
{
   
        if(GetPlayerWantedLevel(playerid) > 0)
        SetPlayerScore(playerid,GetPlayerWantedLevel(playerid));
        }
        new WantedLevel;
        WantedLevel = (GetPlayerWantedLevel, playerid)
        if(WantedLevel >= 6)
        {
                SendClientMessage(playerid,YOURCOLOR, "Sorry! Stars exceeded");
         }
return 1;
This would spam his chat till he dies. Check Note on wiki.sa-mp.com/wiki/OnPlayerUpdate

Also
PHP код:
WantedLevel = (GetPlayerWantedLevelplayerid
You probably thought
PHP код:
WantedLevel GetPlayerWantedLevel(playerid); 



Re: Question - aRoach - 04.10.2011

pawn Код:
public OnPlayerUpdate( playerid )
{
    SetPlayerScore( playerid, GetPlayerWantedLevel( playerid ) );

    return 1;
}
Now if you have Wanted 0 you will have the Score 0 ...


Re: Question - Lookin - 06.10.2011

aRoach got it! thanks guys for the help i appreciate it