SA-MP Forums Archive
SetPlayerScore +rep - 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: SetPlayerScore +rep (/showthread.php?tid=296585)



SetPlayerScore +rep - Mr_Scripter - 12.11.2011

I was working on SetPlayerScore as you know when someone Kills someone it gives +1 Score to him after getting 100 scores it gives player new rank from Newbie to Killa but to test my Ranks when i use /setscore 0 101 the Textdraw changes to killa but after 2 secs it becomes Newbie again and my Score in (tab) becomes 0 also i'm using gAdmin anyone know how to fix this shit?


Re: SetPlayerScore +rep - =WoR=G4M3Ov3r - 12.11.2011

Do you have a timer for it ?


Re: SetPlayerScore +rep - Mr_Scripter - 12.11.2011

No i have
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID) SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
btw which one is good?


Re: SetPlayerScore +rep - =WoR=G4M3Ov3r - 12.11.2011

Quote:
Originally Posted by Mr_Scripter
Посмотреть сообщение
No i have
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID) SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
Show me the whole code.

EDIT: The first one.


Re: SetPlayerScore +rep - park4bmx - 12.11.2011

Well. Check if u got any ago cheat system that might be stoping to set score.
Or look for a timer that's SETS the score back to 0.
also Make sure the texture is [MAX_LLAYERS] so the player each will see there own string


Re: SetPlayerScore +rep - Mr_Scripter - 12.11.2011

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
   //My Other script which have nothing to do with SetPlayerScore
i have no timer or anything..


Re: SetPlayerScore +rep - =WoR=G4M3Ov3r - 12.11.2011

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    
// Add 1 to this killer's score.
    
if(killerid != INVALID_PLAYER_IDSetPlayerScore(killeridGetPlayerScore(killerid) + 1);
    return 
1;

This should work fine, check your script, and are you using it in a filterscript ?


Re: SetPlayerScore +rep - park4bmx - 12.11.2011

Show the code where ur formatting the Killer and Newbie


Re: SetPlayerScore +rep - Mr_Scripter - 12.11.2011

Not Fs.... what i did is Just Gone to onPlayerDeath and added this script
pawn Код:
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);



Re: SetPlayerScore +rep - Mr_Scripter - 12.11.2011

Oh here
pawn Код:
public OnPlayerUpdate(playerid)
    {
    if GetPlayerScore(playerid) >= NEWBIESCORE && GetPlayerScore(playerid) <=NEWBIESCORETO*then
    {
    TextDrawUseBox(Textdraw3, 1);
    TextDrawBoxColor(Textdraw3, 0x00000000);
    TextDrawSetShadow(Textdraw3,0);
    TextDrawShowForPlayer(playerid, Textdraw3);
    TextDrawHideForPlayer(playerid, Textdraw4);
    TextDrawHideForPlayer(playerid, Textdraw5);
    TextDrawHideForPlayer(playerid, Textdraw6);
    TextDrawHideForPlayer(playerid, Textdraw7);
    TextDrawHideForPlayer(playerid,Textdraw8);
    }
    if GetPlayerScore(playerid) >= KILLASCORE && GetPlayerScore(playerid) <=KILLASCORETO*then
    {
    TextDrawUseBox(Textdraw4,1);
    TextDrawBoxColor(Textdraw4, 0x00000000);
    TextDrawSetShadow(Textdraw4,0);
    TextDrawShowForPlayer(playerid, Textdraw4);
    TextDrawHideForPlayer(playerid, Textdraw3);
    TextDrawHideForPlayer(playerid, Textdraw5);
    TextDrawHideForPlayer(playerid, Textdraw6);
    TextDrawHideForPlayer(playerid, Textdraw7);
    TextDrawHideForPlayer(playerid,Textdraw8);
    }
    if GetPlayerScore(playerid) >= YOUNGGSCORE && GetPlayerScore(playerid) <=YOUNGGSCORETO*then
    {
    TextDrawUseBox(Textdraw5, 1);
    TextDrawBoxColor(Textdraw5, 0x00000000);
    TextDrawSetShadow(Textdraw5,0);
    TextDrawShowForPlayer(playerid, Textdraw5);
    TextDrawHideForPlayer(playerid, Textdraw3);
    TextDrawHideForPlayer(playerid, Textdraw4);
    TextDrawHideForPlayer(playerid, Textdraw6);
    TextDrawHideForPlayer(playerid, Textdraw7);
    TextDrawHideForPlayer(playerid,Textdraw8);
    }
    if GetPlayerScore(playerid) >= MOBSTASCORE && GetPlayerScore(playerid) <=MOBSTASCORETO*then
    {
    TextDrawUseBox(Textdraw6, 1);
    TextDrawBoxColor(Textdraw6, 0x00000000);
    TextDrawSetShadow(Textdraw6,0);
    TextDrawShowForPlayer(playerid, Textdraw6);
    TextDrawHideForPlayer(playerid, Textdraw3);
    TextDrawHideForPlayer(playerid, Textdraw5);
    TextDrawHideForPlayer(playerid, Textdraw4);
    TextDrawHideForPlayer(playerid, Textdraw7);
    TextDrawHideForPlayer(playerid,Textdraw8);
    }
    if GetPlayerScore(playerid) >=GANGSTASCORE && GetPlayerScore(playerid) <=GANGSTASCORETO*then
    {
    TextDrawUseBox(Textdraw7, 1);
    TextDrawBoxColor(Textdraw7, 0x00000000);
    TextDrawSetShadow(Textdraw7,0);
    TextDrawShowForPlayer(playerid, Textdraw7);
    TextDrawHideForPlayer(playerid, Textdraw3);
    TextDrawHideForPlayer(playerid, Textdraw5);
    TextDrawHideForPlayer(playerid, Textdraw6);
    TextDrawHideForPlayer(playerid, Textdraw4);
    TextDrawHideForPlayer(playerid,Textdraw8);
    }
    if GetPlayerScore(playerid) >=BOSSSCORE*then
    {
    TextDrawUseBox(Textdraw8, 1);
    TextDrawBoxColor(Textdraw7, 0x00000000);
    TextDrawSetShadow(Textdraw7,0);
    TextDrawShowForPlayer(playerid, Textdraw7);
    TextDrawHideForPlayer(playerid, Textdraw3);
    TextDrawHideForPlayer(playerid, Textdraw5);
    TextDrawHideForPlayer(playerid, Textdraw6);
    TextDrawHideForPlayer(playerid, Textdraw4);
    }
    return 1;
    }