Custom player spawning
#1

How to make custom player spawning:
When you connect to server, you will appear in train, who is driving to somewhere, and when he reaches station, player will spawn there. Player see train from custom cam point.
Reply
#2

pawn Код:
public OnPlayerSpawn(playerid)
{
     new randomspawn = random( number of your spawns );
     switch ( randomspawn )
     {
          case 1 : SetPlayerPos( playerid , x , y , z ) ; // Random Spawn 1
          case 2 : SetPlayerPos( playerid , x , y , z ) ; // Random Spawn 2
          // add more if you want
     }
     return 1;
}
or just follow the samp wiki one

https://sampwiki.blast.hk/wiki/Random
Reply
#3

Quote:
Originally Posted by Yordan_Kronos
Посмотреть сообщение
pawn Код:
public OnPlayerSpawn(playerid)
{
     new randomspawn = random( number of your spawns );
     switch ( randomspawn )
     {
          case 1 : SetPlayerPos( playerid , x , y , z ) ; // Random Spawn 1
          case 2 : SetPlayerPos( playerid , x , y , z ) ; // Random Spawn 2
          // add more if you want
     }
     return 1;
}
or just follow the samp wiki one

https://sampwiki.blast.hk/wiki/Random
Did you even read what i wrote?
Reply
#4

Quote:
Originally Posted by Micius
Посмотреть сообщение
Did you even read what i wrote?
Maybe he didn't. HOWEVER, I won't be giving you the code, because it's just long I guess, I mean it's not hard, but it needs a little bit of work put into it. FIRST, you need an NPC driving a train(you record the route, you stop at whatever station/point you wish). You need a function to get the train's speed, because if a player connects, and immediatly 1 min or so later another one does, he won't have to wait for the train, but he will get teleported inside it, and stop at the station togheter with the other player. About the camera, you may attach it to the vehicle at a point above the train and change its angle, that is absolutely up to your wish. SO, yeah, that's all. When you get at the station, check the train's speed, and if it's ), just eject the player. USEFUL link:

https://sampwiki.blast.hk/wiki/Category:NPC
Reply
#5

Quote:
Originally Posted by Cjgogo
Посмотреть сообщение
Maybe he didn't. HOWEVER, I won't be giving you the code, because it's just long I gues, I mean it's not hard, but it needs a little bit of work put into it. FIRST, you need an NPC driving a train(you record the route, you stop at whatever station/point you wish). You need a function to get the train's speed, because if a player connects, and immediatly 1 min or so later another one does, he won't have to wait for the train, but he will get teleported inside it, and stop at the station togheter with the other player. About the camera, you may attach it to the vehicle at a point above the train and change its angle, that is absolutely up to your wish. SO, yeah, that's all. When you get at the station, check the train's speed, and if it's ), just eject the player. USEFUL link:

https://sampwiki.blast.hk/wiki/Category:NPC
Can you send me example, im not newbie at scripting, so i will know how to do that.
Im new in creating npcs, and controlling them.
Reply
#6

Yes, here you go, for the train. Also, use PutPlayerInVehicle, after the player logs in, and RemovePlayerFromVehicle, when he stops at the station. SO, yeah, the train:

https://sampforum.blast.hk/showthread.php?tid=95034
https://sampforum.blast.hk/showthread.php?tid=170545
Reply
#7

Thanks! +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)