22.10.2012, 15:44
Alright, it's really hard to explain what I want.. Lets say two players (Id 5, and id 8 ) hit me in 1 second difference.
So basically,
this stores ID 5 in PlayersIDBank[1] = 5;
and ID 8 into PlayersIDBank[2] = 8;.
Everything seems good. Now I want to vanish the first player who hit me after 5seconds (ID: 5), I set a timer whenever someone hits me and it looks like this:
Everything seems great ( please ignore the possible bugs in future and etc.)
So now, this is the problem. I have no idea how to remove the player ID 5 from the slot [1], maybe storing the slot id into a variable and attaching it into player id 5? Might work, but what about the slot [2]? The thing is, after I remove the first slot, the slot 2 MUST overtake slot1 place and become Slot[2]to Slot[1] = 8. I just cant think of a way to do this more efficiently OR AT LEAST DOING IT. Any help is appreciated.
NOTE: I will use multiple player id's up to 5, so I want them to move back.
pawn Код:
PlayersHit++;
PlayerIDBank[PlayersHit] = playerid;
this stores ID 5 in PlayersIDBank[1] = 5;
and ID 8 into PlayersIDBank[2] = 8;.
Everything seems good. Now I want to vanish the first player who hit me after 5seconds (ID: 5), I set a timer whenever someone hits me and it looks like this:
pawn Код:
PlayersHit++;
PlayerIDBank[PlayersHit] = playerid;
SetTimerEx("RemovePlayerID",5000,false,...);
So now, this is the problem. I have no idea how to remove the player ID 5 from the slot [1], maybe storing the slot id into a variable and attaching it into player id 5? Might work, but what about the slot [2]? The thing is, after I remove the first slot, the slot 2 MUST overtake slot1 place and become Slot[2]to Slot[1] = 8. I just cant think of a way to do this more efficiently OR AT LEAST DOING IT. Any help is appreciated.
NOTE: I will use multiple player id's up to 5, so I want them to move back.