[HowTo] 1 Kill = 500$ Bounty
#1

how can i set a bounty on a player that has killed someone ? and the bounty to grow if he killed 2 persons to have 1000$ and so on
Reply
#2

OnPlayerDeath(), GivePlayerMoney() and the wonderful things that Pawn (which has a brilliant tutorial that can be found all over these forums called pawn-lang.pdf) can do .
Reply
#3

Arrays are all you need.
pawn Code:
new BountyArray[MAX_PLAYERS];
pawn Code:
public OnPlayerDeath(playerid,killerid,reason)
{
  BountyArray[killerid]+=500;
  return 1;
}
Reply
#4

Quote:
Originally Posted by [P7
Pixels^ ]Arrays are all you need.
pawn Code:
new BountyArray[MAX_PLAYERS];
pawn Code:
public OnPlayerDeath(playerid,killerid,reason)
{
  BountyArray[killerid]+=500;
  return 1;
}
1) You don't need return 1; at the bottom of that callback as it is called AFTER a player has died, so would never have any effect.
2) You do know that if there isn't a killer, i.e the player fell from a cliff or drowned, then the killerid will return 255; which as far as i can see will exceed you cell value of 200 (1-199) by 56.
3) Not really a big deal but if he has a server of only say 13 player slots then MAX_PLAYERS ( 200 ) seems pretty pointless.
Reply
#5

Quote:
Originally Posted by BeckzyBoi
Quote:
Originally Posted by [P7
Pixels^ ]Arrays are all you need.
pawn Code:
new BountyArray[MAX_PLAYERS];
pawn Code:
public OnPlayerDeath(playerid,killerid,reason)
{
  BountyArray[killerid]+=500;
  return 1;
}
3) Not really a big deal but if he has a server of only say 13 player slots then MAX_PLAYERS ( 200 ) seems pretty pointless.
Why post that if it's, as you claimed, not a big deal? If he changes the amount of cells to let's say 50, then it's pointless too. So, you didn't add something useful to this discussion. The only point of yours that was useful was point number 2. Thank you for that one.
Reply
#6

well... u got me in fog... i got the basic bounty system from SanAndreas MoneyGrub, LandGrub, DM ... and could say the code instead of arqueing and Beczy , thnx
Reply
#7

They wern't negative, if you don't want help then don't post. I know fine well that if i didn't post those 3 points you would have kept the return statement, you would have not checked if there was a killer and you would have kept the max cells in the array as 200. So now that i have pointed those 3 things out to you you have saved on efficiency and time (time = not having to type return 1 when you didn't need to on most of the existing callbacks. So.. how was my reply negative?

@ RobbyMeist3r: Yes 2 of the points i posted wouldn't have have changed the visual effects to players but all 3 of them would increase efficiency. So why get the hump? Is it because i am helping make the way people code BETTER? Jees you people should seriously think before posting.
Reply
#8

did i say somethin wrong ?
Reply
#9

1) Has nothing to do with the help he wants. You answered to the guy Pixels who had a good solution, and if return 1; has no effect, it doesn't bother anything, so you could post that little "tip" in the General Reference topic or something.
2) That one's true.
3) Not pointless to have MAX_PLAYERS, it doesn't make the code less useful. It'd be less useful if he didn't have MAX_PLAYERS, as you suggested.
Reply
#10

Yes you did say something wrong, infact you and RobbyMeist3r did but here is what you said incase you can't be bothered to look back at posts:

Quote:
Originally Posted by cmg4life
well... u got me in fog... i got the basic bounty system from SanAndreas MoneyGrub, LandGrub, DM ... and could say the code instead of arqueing and Beczy , thnx
How on God's earth would that be helping you? That would just be doing it for you!! The whole point in this board is to help people and i helped you. If anything, critisize what [P7]Pixels^ posted as not only is he doing it for you but what he posted would give you problems for both when you use it and in the future when you try to make something similer. Although not to worry about that, because you don't try to make things do you? You post asking people to write and submit the code for you. Well if both you and RobbyMeist3r agree with that then don't post commenting on it as it is breaking the rules. If you want people to do it all for you in the future then there is a pinned thread in the General board which is specifically there for requests, go there and not here.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)