Gang kill rewards (NEED IDEA)
#1

Hello community,

I am here again, today with just a little bit of IDEA help, since I can not figure it out.

What I need is, that I have 6 teams of gangs, and I want, that when player from any of these gangs kills player, that is in different gang(team), he will get rewarded for that kill.

I have idea where I need to work with it - OnPlayerDeath and I need to use killerid, perhaps some loops, this is what I constructed so far, but was not enable to continue, since I just did not know, what to script next - i did not get the idea, how to do it.

PHP код:
    for(new 0MAX_PLAYERSi++)
    {
        if(
PlayerInfo[i][pJob] == 9// Grove
        
{
            if( 
So I made a loop, so I will find players, that are in Gang "Grove", which on pJob is set on 9. Than I probably wanted to figure out, who they killed, and if the killed ones were different gang, i would reward them.

However I want to reward them only if they kill a member of different gang (not all players).

If you guys could contribute with any solutionable ideas, I would appreciate it more, than you think.
Reply
#2

First you must save the team of every player into enums or VarInt, then check if the dead guy's team differs from the killer, if yes then award the killer, easy..
Reply
#3

OnPlayerDeath have to arguments - "playerid" and "killerid".

So i assume you are not using SetPlayerTeam, otherwise there is no way a team member can kill another team member.

So you can just compare the way you checked the team in loop:
PHP код:
if (PlayerInfo[playerid][pJob] != PlayerInfo[killerid][pJob]) {} 
And if this statement is true, you continue your loop inside it. About your loop, you need to modify it to this (you only want to give score to connected gang members right?):
PHP код:
for (new 0GetPlayerPoolSize(); <= ji++) {
    if (
IsPlayerConnected(i)) {
        
// do your if statements here
    
}

Reply
#4

Yes, however the thing is, that in pJob, there are for example cops or taxidrivers too, and I do not want gang members to get money from killing them.
Reply
#5

Quote:
Originally Posted by MrakBuster
Посмотреть сообщение
Yes, however the thing is, that in pJob, there are for example cops or taxidrivers too, and I do not want gang members to get money from killing them.
Check the team id's before giving awards.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)