Spawn player in nearest position

Started by vito, Sep 10, 2016, 02:22 PM

Previous topic - Next topic

vito

There is a very tiny trick to help to you spawn player in nearest safe position in the city (not in water/inside building and so on):

function SpawnInNearestPos(x, y){
return Vector(x, y, -99999);
}

// Example to use:
FindPlayer(0).Pos = SpawnInNearestPos(12345,6789);
FindPlayer(0).Pos = SpawnInNearestPos(-9876,-54321);

Vice city is using it even for singleplayer to respawn player if he fall under the map.

Since EC implemented it I decided to share it for public.

Actually it has at least one bug with wrong spawn location near north point mall, but I think you can fix it yourself in your own script.

W3aPoN^

Thanks but Can you Please Make a Script When a Player Kill Me then i spawn at where i was killed Understand? my English is Bad
if you Understand then can you make it? Thanks in Advance for You Next Replay :D

Cool

Quote from: =NK=RazaCharan** on Dec 07, 2016, 11:53 AMThanks but Can you Please Make a Script When a Player Kill Me then i spawn at where i was killed Understand? my English is Bad
if you Understand then can you make it? Thanks in Advance for You Next Replay :D
Here is a search Button Use it

Mötley

Motley points @Stormeus and @Thijn at regards that I think the script/contenet request board was a bad Idea as individuals without the desire to find fun in scripting does not want to do something as simply tiny as

Quote from: =NK=RazaCharan** on Dec 07, 2016, 11:53 AMThanks but Can you Please Make a Script When a Player Kill Me then i spawn at where i was killed Understand?

This is ridicules, I understand it when referring to something you would like to learn more into like

http://forum.vc-mp.org/?topic=3838.msg29414#msg29414

But something so tiny that you could add the players position into an array on death then spawn the player with the coordinates, This is terrible. This is either a kid society where as it is give me - give me, Or they just don't want to learn anything.. I dunno This was a really cool topic that got spamed. In other words It's a fast way to lose respect when needing future help..

Please do not remove the board instead please set a rule that will get your account flagged upon such bs, When the individual hits max flags let the moderators/site admins deal with him