SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 18/11/2017, 02:14 PM   #1
Ritzy2K
High-roller
 
Ritzy2K's Avatar
 
Join Date: Jun 2014
Location: India
Posts: 1,547
Reputation: 170
Default Is there a way if a player fell out of map?

Okay so sometimes it happens that when a player is getting spawned due to whatever reasons he fells out of map and ends up in blueberry bugged with CJ skin.
Is there any way to detect that and to respawn it if he's felling down?
Also, how to avoid this issue? I have new spawning coords and changed them several times and this issue arises randomly out of blue
Ritzy2K is offline   Reply With Quote
Old 18/11/2017, 02:21 PM   #2
Eoussama
High-roller
 
Eoussama's Avatar
 
Join Date: Jul 2016
Location: Kingdom of Morocco // Tangier
Posts: 1,076
Reputation: 283
Default Re: Is there a way if a player fell out of map?

Check if the player is falling with animation,
get the ground Z level on his current X and Y position (I use colanders for precision),
Check if the player's Z coordinate is inferior to that of the ground level,
__________________

|===[Web taxi]===|
List of my work
Github
Pastebin

|===[Interesting topics]===|
Semantic Versioning
Eoussama is offline   Reply With Quote
Old 18/11/2017, 02:26 PM   #3
Ritzy2K
High-roller
 
Ritzy2K's Avatar
 
Join Date: Jun 2014
Location: India
Posts: 1,547
Reputation: 170
Default Re: Is there a way if a player fell out of map?

Quote:
Originally Posted by Eoussama View Post
Check if the player is falling with animation,
get the ground Z level on his current X and Y position (I use colanders for precision),
Check if the player's Z coordinate is inferior to that of the ground level,
What are some of the ways to avoid this bug? This issue wasn't present in the previous spawn coords. My spawn coords are a little modified, there's no custom objects, I even increased the value of z coord by 2 to let the world load below the player but this issue still occurs randomly.

Do you think I should do a timer which checks every one second to do what you said? Also how can I check if player is falling?
Ritzy2K is offline   Reply With Quote
Old 18/11/2017, 02:51 PM   #4
Ritzy2K
High-roller
 
Ritzy2K's Avatar
 
Join Date: Jun 2014
Location: India
Posts: 1,547
Reputation: 170
Default Re: Is there a way if a player fell out of map?

I freeze the player for 3 seconds at "OnPlayerSpawn" but still this issue comes out randomly.
Ritzy2K is offline   Reply With Quote
Old 18/11/2017, 03:04 PM   #5
WillyP
High-roller
 
WillyP's Avatar
 
Join Date: Jul 2010
Location: England
Posts: 2,027
Reputation: 63
Default Re: Is there a way if a player fell out of map?

If your server is public, send me the IP and I'll join and rejoin a few times, what you're saying doesn't really make sense unless it's coding related
__________________
once average now terrible
WillyP is offline   Reply With Quote
Old 18/11/2017, 03:15 PM   #6
Ritzy2K
High-roller
 
Ritzy2K's Avatar
 
Join Date: Jun 2014
Location: India
Posts: 1,547
Reputation: 170
Default Re: Is there a way if a player fell out of map?

Quote:
Originally Posted by WillyP View Post
If your server is public, send me the IP and I'll join and rejoin a few times, what you're saying doesn't really make sense unless it's coding related
I don't have it public yet, I'm working at it.

I've also noticed something strange -
Usually when a player spawns. I send him a ClientMessage.

But when the player falls off the map, the client message doesn't appear either. It's like - OnPlayerSpawn isn't called at all.

The player isn't armed either, but OnPlayerSpawn was supposed to arm him.

Is it a bug that OnPlayerSpawn isn't called everytime?
Ritzy2K is offline   Reply With Quote
Old 18/11/2017, 03:20 PM   #7
WillyP
High-roller
 
WillyP's Avatar
 
Join Date: Jul 2010
Location: England
Posts: 2,027
Reputation: 63
Default Re: Is there a way if a player fell out of map?

Possibly something in your code is conflicting with other parts causing the player to spawn somewhere different to where you have specified, as well as the lack of message and weapons. Can't really decipher the issue without having a go or looking at some coding
__________________
once average now terrible
WillyP is offline   Reply With Quote
Old 18/11/2017, 03:26 PM   #8
Ritzy2K
High-roller
 
Ritzy2K's Avatar
 
Join Date: Jun 2014
Location: India
Posts: 1,547
Reputation: 170
Default Re: Is there a way if a player fell out of map?

Quote:
Originally Posted by WillyP View Post
Possibly something in your code is conflicting with other parts causing the player to spawn somewhere different to where you have specified, as well as the lack of message and weapons. Can't really decipher the issue without having a go or looking at some coding
It was a very very shitty issue.
Earlier the random spawning coordinates were 5
I decreased them to 3 but I forgot to adjust the "random" keyword.
So it was supposed to use 5 random coordinates but was having 3 so it was spawning me in blueberry when other 2 were called.
LOL, Stupid me. But thanks for trying to help means a lot.

Edit: I'm out of reps, I'll make sure to rep you.
Ritzy2K is offline   Reply With Quote
Old 18/11/2017, 03:27 PM   #9
WillyP
High-roller
 
WillyP's Avatar
 
Join Date: Jul 2010
Location: England
Posts: 2,027
Reputation: 63
Default Re: Is there a way if a player fell out of map?

Don't worry, we all make mistakes
__________________
once average now terrible
WillyP is offline   Reply With Quote
Old 18/11/2017, 03:51 PM   #10
wallee
Huge Clucker
 
Join Date: Jan 2017
Posts: 264
Reputation: 40
Default Re: Is there a way if a player fell out of map?

another potential fall out of map:

if you respawn a vehicle while a player is surfing on it he will be teleported to blueberry (0, 0, 0)
wallee is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Detect player when fell at water off leon44 Scripting Help 36 06/10/2017 09:17 PM
how to use dini save online player in to file every time player enter or out Chrisli520 Scripting Help 1 31/10/2013 07:04 AM
[Request] Set(Player)ObjectSize / Size parameters in Create(Player)Object [03]Garsino Help Archive 3 28/11/2010 05:12 PM
I fell on the floor from laughter Saurik Everything and Nothing 8 23/11/2010 10:08 PM


All times are GMT. The time now is 08:20 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.