Random Spawn Help
#1

I have set all of my random spawn i believe. My question is, how do i make it not show my original spawn before it randomly spawns me in my created locations? Do i need to open up debug and make other saved positions to add to new Float:RandomSpawns other than using my current spawns? Sorry, i cant explain it well. I made a video and I will post my code.

http://pastebin.com/VnGJ69CL

https://www.youtube.com/watch?v=gtcq...ature=*********

As you can see in the video I spawn at my original location for each player before the random spawn takes effect.

Whats wrong with my code?
Reply
#2

Add this under "onplayerspawn"
pawn Код:
new Random = random(sizeof(RandomSpawns));
SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
reply if u had bugs/problems
Reply
#3

Quote:
Originally Posted by Mzake
Посмотреть сообщение
Add this under "onplayerspawn"
pawn Код:
new Random = random(sizeof(RandomSpawns));
SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
reply if u had bugs/problems
I have that, here is all of my code.

http://pastebin.com/VnGJ69CL
Reply
#4

Quote:
Originally Posted by x4hi
Посмотреть сообщение
I have that, here is all of my code.

http://pastebin.com/VnGJ69CL
Well explaine what u need, i cant watch vid for now sorry..
you are looking for when player spawn he get a black screen before teleporting to random spawn then black screen go after he tele??
Reply
#5

Quote:
Originally Posted by Mzake
Посмотреть сообщение
Well explaine what u need, i cant watch vid for now sorry..
you are looking for when player spawn he get a black screen before teleporting to random spawn then black screen go after he tele??
The problem is I see my AddPlayerClass(143,2504.1306,-1683.9012,13.5469,49.8305,0,0,0,0,0,0); position before it spawns me to a random location,like within a blink of an eye. I think the cords from new Float:RandomSpawns[][4] are interfering with public OnGameModeInit() spawn coords because they are the same.
Reply
#6

Quote:
Originally Posted by x4hi
Посмотреть сообщение
The problem is I see my AddPlayerClass(143,2504.1306,-1683.9012,13.5469,49.8305,0,0,0,0,0,0); position before it spawns me to a random location,like within a blink of an eye. I think the cords from new Float:RandomSpawns[][4] are interfering with public OnGameModeInit() spawn coords because they are the same.
Well idk about this , keep searching :/
Reply
#7

It would help if you slowed down the footage, as I think your camera is moving back to the death position before it gets back to the player... I can't tell as I can't pause it in time as ******* is 30FPS.

If it isn't it would be an issue with your AddPlayerClass, this is because it contains fixed spawn co-ordinates. The only way you can fix that is to set skins with SetPlayerSkin, and not to use AddPlayerClass.

Your issue isn't server crippling anyway.
Reply
#8

Quote:
Originally Posted by IceCube!
Посмотреть сообщение
It would help if you slowed down the footage, as I think your camera is moving back to the death position before it gets back to the player... I can't tell as I can't pause it in time as ******* is 30FPS.

If it isn't it would be an issue with your AddPlayerClass, this is because it contains fixed spawn co-ordinates. The only way you can fix that is to set skins with SetPlayerSkin, and not to use AddPlayerClass.

Your issue isn't server crippling anyway.
how would I go about removing the AddPlayerClass to fix it? Just remove all the addplayerclass and add SetPlayerSkin Function and it would work? Sorry I just woke up and I need that push in the right direction haha.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)