/hits Problem
#1

Say I /hit 7 15000 for example. 7 would be my id because of bots, and 15000 as the hit amount. I made a /hits command to show all hits, so it shows "Hit for grandtheftotto || by grandtheftotto || price: 15000"

I know I /hit myself and it will be changed as soon as I'm done testing But the problem is, for example: /hit 4 54000 (id 4 is a bot), it will place the hit on the player, and show 2 hits available in /hits which is working right but the problem is the last hit amount/price will replace the first hit, so instead of it saying:

Quote:

"Hit for grandtheftotto || by grandtheftotto || price: 15000"
"Hit for botname || by grandtheftotto || price: 54000"

It will say:

Quote:

"Hit for grandtheftotto || by grandtheftotto || price: 54000"
"Hit for botname || by grandtheftotto || price: 54000"

So I need to fix it so it doesn't show the last hit amount/price for all players, but instead show their separate amounts. Any solution?
Reply
#2

Show some code. I think I know how you're doing it. You're making the amount each player places stored with that player instead of the other player.
Reply
#3

It probably has something to do with my hitamount variable. At the moment it is a global variable, but it isn't indexed (it's not MAX_PLAYERS). That must be why right?
Reply
#4

Probably.
Reply
#5

a per-player variable will fix it:
Код:
SetPVarInt(HitRecieverID,"HitPlacedByID",playerid);
SetPVarInt(HitRecieverID,"HitPlacedAmont",Amount);
i bet now you know what to do ^^
if you want, i will send you my /hit callback via xf, it allows multiple hits on a player, but the hits are irreversible...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)