SA-MP Forums Archive
Problem with one area, 2 persons. - 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: Problem with one area, 2 persons. (/showthread.php?tid=145761)



Problem with one area, 2 persons. - Niixie - 03.05.2010

Hey, i have a problem.
-I have a checkpoint (size 10.00) .. when one player enters it, his pos changes to:
Код:
-2254.1687, 306.4822, 34.8911 ( We call this pos 1 )
Thats okay. But when the second person enters the checkpoint, he gets pos 1 too! but in the script it says this:
Код:
-2249.0278, 306.1509, 34.8911 ( Pos 2 )
Heres my code.

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 10.00, -2251.6699,306.0903,35.0391))
        {
          if(Drag1RacePos == 0)
          {
            SetVehiclePos(vehicleid, -2254.1687, 306.4822, 34.8911); // startpos1drag1
                SetVehicleZAngle(vehicleid, 179.1690); // startpos1drag1
                PutPlayerInVehicle(playerid, vehicleid, 0);
                Freeze(playerid, 0);
                DisablePlayerCheckpoint(playerid);
                SetPlayerRaceCheckpoint(playerid, 0, DragRace1[DragRace1CP][0], DragRace1[DragRace1CP][1], DragRace1[DragRace1CP][2], DragRace1[DragRace1CP+1][0], DragRace1[DragRace1CP+1][1], DragRace1[DragRace1CP+1][2], 10.00);
                Drag1RacePos = 1;
            }
            else if(Drag1RacePos == 1)
            {
              SetVehiclePos(vehicleid, -2249.0278, 306.1509, 34.8911); // startpos2drag1
                SetVehicleZAngle(vehicleid, 179.9744); // startpos2drag1
                PutPlayerInVehicle(playerid, vehicleid, 0);
                Freeze(playerid, 0);
                DisablePlayerCheckpoint(playerid);
                SetPlayerRaceCheckpoint(playerid, 0, DragRace1[DragRace1CP][0], DragRace1[DragRace1CP][1], DragRace1[DragRace1CP][2], DragRace1[DragRace1CP+1][0], DragRace1[DragRace1CP+1][1], DragRace1[DragRace1CP+1][2], 10.00);
                Drag1RacePos = 2;
            }
           
            if(Drag1RacePos == 2)
            {
              SetTimerEx("Drag1Race", 2000, false, "i", playerid);
            }
        }
Help?


Re: Problem with one area, 2 persons. - Jochemd - 03.05.2010

Hey,

I can't watch your whole code on iPod, but I guess you forgot the thing to set the second player to the second pos? Use variables as the first 1 0

if(variable == 0)
SetPlayerPos(blabla);
variable == 1;

if(variable == 1)
SetPlayerPos(blabla);
variable == 2;

And go on!


Re: Problem with one area, 2 persons. - Niixie - 04.05.2010

They are already there. i tried some other ways than this, but it still doesnt work?
Can anyone help me?


Re: Problem with one area, 2 persons. - Niixie - 05.05.2010

bump*


Re: Problem with one area, 2 persons. - Young Santana - 06.05.2010

Incredible, no one can fix this


Re: Problem with one area, 2 persons. - Desert - 06.05.2010

I can't see noting wrong there. Try use a switch and see if that works?


Re: Problem with one area, 2 persons. - Niixie - 18.05.2010

Like

Код:
switch(what here?) {
case 1: SetPlayerpos to the first
case 2: SetPlayerpos to the second }