SA-MP Forums Archive
Doesn't put people in vehicles. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Doesn't put people in vehicles. (/showthread.php?tid=147305)



Doesn't put people in vehicles. - 0ne - 11.05.2010

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


Re: Doesn't put people in vehicles. - Killa_ - 11.05.2010

Replace playerid with i ?


Re: Doesn't put people in vehicles. - 0ne - 11.05.2010

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

edit: tried it, don't work.


Re: Doesn't put people in vehicles. - Zh3r0 - 11.05.2010

Does foreach make a difference?
Try it...


Re: Doesn't put people in vehicles. - 0ne - 11.05.2010

Already tried it.


Re: Doesn't put people in vehicles. - Infinity - 11.05.2010

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)



Re: Doesn't put people in vehicles. - DJDhan - 11.05.2010

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



Re: Doesn't put people in vehicles. - 0ne - 11.05.2010

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


Re: Doesn't put people in vehicles. - Infinity - 11.05.2010

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

EDIT: CreateVehicle, not CreatVehicle


Re: Doesn't put people in vehicles. - 0ne - 11.05.2010

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