SA-MP Forums Archive
Inside of car gate and /heal system - 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)
+--- Thread: Inside of car gate and /heal system (/showthread.php?tid=452608)



IsPlayerInRangeOfPoint inside of a car - ZeroTheScyther - 22.07.2013

Ok I feel really stupid for asking this but could someone tell me what's wrong with this script?
Everything works fine while I'm on foot but as soon as I get in car the script stops working. Is the range too small or what? (Sorry for wasting your time but I'm really tired and I want to finish this today)
pawn Код:
if ((oldkeys & KEY_CTRL_BACK) && !(newkeys & KEY_CTRL_BACK))
        {
        if(IsPlayerInRangeOfPoint(playerid, 5.0,-76.5506,-353.0117,1.4297))
            {
            if(gTeam[playerid] == 6)
            {
                MoveObject(hgate,-74.55550,-352.80170,-2.35262,5,0.00000,0.00000,90.00000);
                SetTimer("hgateClose",5000,false);
                }
                return 1;
            }
        }
Also can someone give me an example of how to make a heal command? Something like /heal [id] gives health to the player (Sorry again for wasting your time)


Re: Inside of car gate and /heal system - IceCube! - 22.07.2013

IsPlayerInRangeOfPoint only works if the player is outside a vehicle.


Re: Inside of car gate and /heal system - ZeroTheScyther - 22.07.2013

Should I use something like if(GetVehicleDistanceFromPoint(vehicleid) <= 5) ? (I know that code is wrong just giving an example)


Re: Inside of car gate and /heal system - IceCube! - 22.07.2013

****** for IsVehicleInRangeOfPoint (Pre-made stock) Place it anywhere in your GM.


Re: Inside of car gate and /heal system - ReneG - 22.07.2013

Quote:
Originally Posted by IceCube!
Посмотреть сообщение
IsPlayerInRangeOfPoint only works if the player is outside a vehicle.
Source? Too lazy to check right now.


Re: Inside of car gate and /heal system - IceCube! - 22.07.2013

Quote:
Originally Posted by ReneG
Посмотреть сообщение
Source? Too lazy to check right now.
Experiance, I'm sure it will say on SAMP Wiki. The clue is in IsPLAYERInRangeOfPoint. It's also down to you to verify my answer.


Re: Inside of car gate and /heal system - ZeroTheScyther - 22.07.2013

Weeeeew ... BUMP ... I didn't fixed it yet. Please help (I tryed to get the car's distance from point and if the distance was < 5 then the gate should open ... doesn't works )