Drop items around.
#1

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.
Reply
#2

Try this - https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Reply
#3

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
Reply
#4

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
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
Something like that is exactly what I am looking for thanks +rep
Reply
#5

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
Reply
#6

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..
Reply
#7

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.
Reply
#8

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.
Reply
#9

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!
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)