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



Sniper kill - Face9000 - 15.05.2013

Umh so, i finished scripting class system and inside of that i have the "Sniper" class, which gives extra score at who select this class and kill a player with sniper rifle. However, isn't working, the killer doesn't get score/money or even the message:

pawn Код:
if(reason == 34 && pInfo[killerid][Class] == 2) //reason == 34 is what i use for echo bots - class == 2 is the number of the class associated to "Sniper"
    {
    SCM(killerid, COLOR_YELLOW, "** Sniper Rifle kill as Sniper class! You got extra score/money and hp.");
    SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
    GivePlayerMoney(killerid, 3000);
    GameTextForPlayer(killerid, "~r~Sniper ~g~kill!", 3600, 4);
    }
I placed that code inside OnPlayerDeath.


Re : Sniper kill - DaTa[X] - 15.05.2013

use GetPlayerWeapon instead of reason
pawn Код:
if(GetPlayerWeapon(killerid) == 34 && pInfo[killerid][Class] == 2) //reason == 34 is what i use for echo bots - class == 2 is the number of the class associated to "Sniper"
    {
    SCM(killerid, COLOR_YELLOW, "** Sniper Rifle kill as Sniper class! You got extra score/money and hp.");
    SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
    GivePlayerMoney(killerid, 3000);
    GameTextForPlayer(killerid, "~r~Sniper ~g~kill!", 3600, 4);
    }



Re: Sniper kill - Face9000 - 15.05.2013

Thanks.