Doesn't put people in vehicles.
#1

pawn Код:
for(new i,g=GetMaxPlayers(); i < g; i++) if(IsPlayerConnected(i) && !IsPlayerNPC(i))
        {
            if(i != playerid)
            {
                for(new d; d <15; d++)
                {
                    if(!IsPlayerInVehicle(i,hunter[d]) || !IsPlayerInVehicle(i,hydra[d]))
                    {
                      new chance = random(10);
                      switch(chance)
                      {
                            case 0: PutPlayerInVehicle(playerid,hunter[d],0);
                            case 1: PutPlayerInVehicle(playerid,hunter[d],0);
                            case 2: PutPlayerInVehicle(playerid,hunter[d],0);
                            case 3: PutPlayerInVehicle(playerid,hunter[d],0);
                            case 4: PutPlayerInVehicle(playerid,hunter[d],0);
                            case 5: PutPlayerInVehicle(playerid,hunter[d],0);
                            case 6: PutPlayerInVehicle(playerid,hunter[d],0);
                            case 7: PutPlayerInVehicle(playerid,hunter[d],0);
                            case 8: PutPlayerInVehicle(playerid,hunter[d],0);
                            case 9: PutPlayerInVehicle(playerid,hydra[d],0);
                        }
                    }
                    break;
                }
            }
        }
thats what i got on join the deathmatch and it doesn't put them in the vehicles
Reply
#2

Replace playerid with i ?
Reply
#3

I will but will it make the difference? cause it doesn't even put id 0

edit: tried it, don't work.
Reply
#4

Does foreach make a difference?
Try it...
Reply
#5

Already tried it.
Reply
#6

Multiple things could be wrong:
Код:
case 0:	PutPlayerInVehicle(playerid,hunter[d],0);
playerid should be i, because else it will only put ID 0 in hunters.


Also, could you explain to me what this is for:
Код:
if(i != playerid)
Reply
#7

In you for loop, where is the initial value of "i"?
like for(new i=0.......................)
Reply
#8

Some guy gave me this code and i edited to chances random but it didn't even work without chances random, i don't know seems pretty normal for me and i already said i replaced it with I it doesn't work, PLAYERID doesn't work too even if i'm id 0 and one in the server
Reply
#9

maybe you shoudl add something like this:
Код:
hunter[d]= CreatVehicle(blabla)
Else... I'm out of ideas :/

EDIT: CreateVehicle, not CreatVehicle
Reply
#10

After death it would respawn and i create ANOTHER One ON It, makes no sense I already created ongamemodeinit
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)