SA-MP Forums Archive
Stars per kill - 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: Stars per kill (/showthread.php?tid=464699)



Stars per kill - Sliceofdeath - 18.09.2013

Can anyone tell me how to do this ?

Like -

Slice killed ABCD , Slice will get 1 star then again he kill 2 star then etc etc .. It will go till 6 [Wanted level]

Can anyone tell how to do this ? I tried to find in wiki , ****** but not got.Maybe cause of my rip eng. xD


Re: Stars per kill - [HK]Ryder[AN] - 18.09.2013

pawn Код:
new wantedlevel;
wantedlevel=GetPlayerWantedLevel(playerid);
SetPlayerWantedLevel(playerid, wantedlevel+1);
Paste it in OnPlayerDeath or somewhere


Re: Stars per kill - DanishHaq - 18.09.2013

https://sampwiki.blast.hk/wiki/SetPlayerWantedLevel.

I.e:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
    {
        new newwanted = GetPlayerWantedLevel(killerid) + 1;
        SetPlayerWantedLevel(killerid, newwanted);
        SetPlayerWantedLevel(playerid, 0); // optional if you want, set the dead player to wanted 0 because he died
    }
    return 1;
}
Edit: Person above me was faster, but he did it wrong.


Re: Stars per kill - alinategh - 18.09.2013

Quote:
Originally Posted by [HK]Ryder[AN]
Посмотреть сообщение
pawn Код:
new wantedlevel;
wantedlevel=GetPlayerWantedLevel(playerid);
SetPlayerWantedLevel(playerid, wantedlevel+1);
Paste it in OnPlayerDeath or somewhere
Corrections:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  new wantedlevel;
  wantedlevel=GetPlayerWantedLevel(killerid);
  SetPlayerWantedLevel(killerid, wantedlevel+1);
  return 1;
}
should be "killerid"