Sniper kill
#1

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.
Reply
#2

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);
    }
Reply
#3

Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)