positions in derby
#1

I have minigame derby, but I have a problem.
and I want that if a position is occupied, no one else can use it unless the player leaves the minigame. I mean, unique for each player positions, are 15 different positions

Thanks!
Reply
#2

Codes plz!
Reply
#3

Код:
new Float:DerbyPos[15][4] = {
	{370.5317, 5334.2036, 21.5007, 90.0000},
    {471.6571, 5268.3271, 10.0410, 0.0000},
    {331.5957, 5257.8633, 10.0410, -90.0000},
    {461.1842, 5268.4790, 10.0410, 45.0000},
    {318.8594, 5270.2227, 10.0410, 0.0000},
    {318.7415, 5398.4912, 10.0410, 180.0000},
    {328.9519, 5400.3428, 10.0410, 225.0000},
    {458.5728, 5410.6563, 10.0410, 90.0000},
    {461.5033, 5400.9453, 10.0410, 135.0000},
    {395.5331, 5361.3579, 21.5007, 359.3239},
    {395.5331, 5361.3579, 21.5007, 359.3239},
    {376.8490, 5352.4053, 10.1472, 45.0000},
    {420.8829, 5334.2803, 21.5007, -90.0000},
    {414.3392, 5353.3311, 10.1472, -45.0000},
    {376.9891, 5315.6880, 10.1472, 135.0000}
};

new PositionsDerby;


//enter derby
pos vehicles..
SetVehiclePos(playerid, DerbyPos[PositionsDerby][0], DerbyPos[PositionsDerby][1], DerbyPos[PositionsDerby][2]);
PositionsDerby++;

//exit derby
exit derby...
PositionsDerby--;
Thanks!
Reply
#4

//enter derby

pawn Код:
new PositionsDerby = random(sizeof(DerbyPos));;
SetVehiclePos(playerid, DerbyPos[PositionsDerby][0], DerbyPos[PositionsDerby][1], DerbyPos[PositionsDerby][2]);
and use this to block if derby is full

pawn Код:
if ( PositionsDerby >= 14) return Yourfucnctionhere; // use your function sendclientmsg or anything
Change that 14 to yours
Reply
#5

No no. That's not the problem.

when a player leaves the minigame, the variable remains, and when another player enters the minigame, falls on top of another player, bone positions are bugs
Reply
#6

How players leaving minigame? do you have any command to leave?

If yes you can try using GetVehiclePos and SetVehiclePos
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)