Drop items around. - 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: Drop items around. (
/showthread.php?tid=637151)
Drop items around. -
Alex_T - 09.07.2017
Hello I made a system that drops items when you die. However I want it to drop items around your position, like within a range of 5.0. I am just not sure how I would accomplish this.
Re: Drop items around. -
cdoubleoper - 09.07.2017
Try this -
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Re: Drop items around. -
AbyssMorgan - 09.07.2017
If you want generate random points in range use:
PHP код:
GetRandomPointInCircle(Float:x,Float:y,Float:radius,&Float:tx,&Float:ty);
3DTryg.inc:
https://sampforum.blast.hk/showthread.php?tid=591010
Re: Drop items around. -
Alex_T - 09.07.2017
Quote:
Originally Posted by AbyssMorgan
|
Something like that is exactly what I am looking for thanks +rep
Re: Drop items around. -
Pottus - 09.07.2017
Quote:
Originally Posted by Alex_T
Something like that is exactly what I am looking for thanks +rep
|
Just because you generate a random point does not mean it is valid.
- In a wall
- Over the edge of a cliff
- Slope difference under the floor
Re: Drop items around. -
JasonRiggs - 09.07.2017
I totally agree with Pottus's point.. Why don't you create an object on the ground like a backpack or something.. and if IsPlayerInRangeOfPoint (this backpack) and uses a command like /pickup or something, give him what's in that dead player inventory, easy..
Re: Drop items around. -
Pottus - 09.07.2017
Quote:
Originally Posted by JasonRiggs
I totally agree with Pottus's point.. Why don't you create an object on the ground like a backpack or something.. and if IsPlayerInRangeOfPoint (this backpack) and uses a command like /pickup or something, give him what's in that dead player inventory, easy..
|
It is actually pretty easy to check for valid points.
Re: Drop items around. -
JasonRiggs - 09.07.2017
Quote:
Originally Posted by Pottus
It is actually pretty easy to check for valid points.
|
He can save it without creating the object.. But I just gave him a suggestion to make it kinda better or realistic, so as if the inv of a player is inside a bag, u take it, take what's in it, But he can make also enums for player death points, and Save them as GetPlayerPos and create a cmd if he wants, or press a button or smth if he is near these points to take the stuff in the inv.
Re: Drop items around. -
Eoussama - 09.07.2017
Quote:
Originally Posted by Pottus
It is actually pretty easy to check for valid points.
|
Can you? I'm interested, I'd appreciate if you'd demonstrate how is it possible, cuz I honestly have no idea!
Re: Drop items around. -
Sew_Sumi - 10.07.2017
Quote:
Originally Posted by Eoussama
Can you? I'm interested, I'd appreciate if you'd demonstrate how is it possible, cuz I honestly have no idea!
|
MapAndreas is one option in this... Check for the point where the player is, compare the height to the random point given, and if found to be higher or odd from where they died.
Not just 0.9 higher, like 5 or more higher.
Then the random point would just need to find another point if it ends up being an invalid point.
That's just a random idea though, Pottus may have a better plan on this.