SA-MP Forums Archive
10vehicles for 10racers? - 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: 10vehicles for 10racers? (/showthread.php?tid=147505)



10vehicles for 10racers? - 0ne - 12.05.2010

I have created 10turismos, and i would like to know how could i do that if he ex:

types a command /race it adds him to race and turismo car nr1, second guy types it , he gets putted in turismo car nr2 and so on?


Re: 10vehicles for 10racers? - RyDeR` - 12.05.2010

Take a look at my race filterscript.


Re: 10vehicles for 10racers? - 0ne - 12.05.2010

The thing is that i just did, but i am trying to make my own way figuring it out.. you know not copying and stuff like that so I'm hoping for an answer to my way's problem


Re: 10vehicles for 10racers? - RyDeR` - 12.05.2010

Well I can give you some hints then.
1. You have to take two positions. One of the left road side and one of the right road side. You can do more also.
2. Check if playerid of the player is odd or even.
3. Just create a variable
4. If it's odd make the player on the right road side and the variable++
5. Same with even.
6. if(variable >= 2) use some trigonometric functions to set the other players after it.

This will bug of course.. But this is just a visual sight .
You have to create some other variables too to make it not bug.



Re: 10vehicles for 10racers? - 0ne - 12.05.2010

Yeah, i know that but theres a simplier way with 5 to 10lines which I can't figure out, I've been given some examples month or two ago and i forgot, didn't find the topic which the information was posted in, btw i already built 2vehicles on right and left side


Re: 10vehicles for 10racers? - 0ne - 13.05.2010

Anyone?..


Re: 10vehicles for 10racers? - ViruZZzZ_ChiLLL - 13.05.2010

PutPlayerInVehicle(playerid, vehicleid, seatid) maybe??


Re: 10vehicles for 10racers? - DJDhan - 13.05.2010

Try to create a new variable that stores no of players that typed "/race".
On top of your script.
Код:
new InRace;
Код:
if(strcmp(cmdtext,"/race",true,5)==0)
{
   InRace++;
//your race script here and what you can do is make a for loop like
for(new i=0;i<= InRace;i++)
{
//Then add the player to your vehicle at the last

}
I don't know if it will work but it gives the idea


Re: 10vehicles for 10racers? - 0ne - 13.05.2010

pawn Код:
for(new i,g=GetMaxPlayers(); i < g; i++) if(IsPlayerConnected(i) && !IsPlayerNPC(i))
            {
                if(!IsPlayerInVehicle(i,AirRaceI[CurrentAirRace][Plane]))
                {
                  PutPlayerInVehicle(i,AirRaceI[CurrentAirRace][Plane],0);
                }
            }
I'm using this right now when he types /race, but the code doesn't work


Re: 10vehicles for 10racers? - DJDhan - 13.05.2010

Oh man ofcourse that won't work.

Код:
for(new i=0,i<=GetMaxPlayers();i++) 
{
  if(IsPlayerConnected(i) && !IsPlayerNPC(i))
  {
    if(!IsPlayerInVehicle(i,AirRaceI[CurrentAirRace][Plane]))
    {
      PutPlayerInVehicle(i,AirRaceI[CurrentAirRace][Plane1],0);
    }
  }
}
You have to use it something like that.
Btw how did you create the ten turismos?
Give the code for the Turismos.