10.02.2014, 11:01
(
Last edited by Vanter; 02/04/2016 at 07:43 PM.
)
What is this tutorial? Making simple entries and exits for buildings, ammu-nations, stores..etc
What's the key for it? Checkpoints, Virtual Worlds, Interiors, or Pickups.
What will we use? We're going to use dynamic pickups, if you don't have the streamer installed, just remove the ''Dynamic'' in every word in the script.
Then under OnGameModeInIt(), we're gonna define the creation of them.
Now, we'll come to where's the action of teleporting the player to the interior and virtual world we want.
Where can I get the interior IDs? https://sampwiki.blast.hk/wiki/InteriorIDs
Useful links:
3D Text Label Structure: https://sampwiki.blast.hk/wiki/Create3DTextLabel
I hope this helps you creating entrances and exits in your gamemode
Thank You,
Vanter
What's the key for it? Checkpoints, Virtual Worlds, Interiors, or Pickups.
What will we use? We're going to use dynamic pickups, if you don't have the streamer installed, just remove the ''Dynamic'' in every word in the script.
Here we go
We're going to create the entry and exit pickups, in this case, ammunation.PHP Code:
new AmmuEnt1;
new AmmuExt1;
PHP Code:
//This one is in Come-A-Lot in LV
AmmuEnt1 = CreateDynamicPickup(1317, 1, 2159.53, 943.20, 9.82, 0); //usally make the the Z axis, is -1, so the pickup is slightly up the ground.
Create3DTextLabel("Ammunation\nEnterance", 0xFF0000AA, 2159.53, 943.28, 10.82, 20.0, 0, 1); //3D Text Label to define the entrance.
AmmuExt1 = CreateDynamicPickup(1317, 1, 315.71, -143.66, 998.0, 1); //Ammu-nation exit to the world. the last ''1'' is the Virtual world. which we will be setting as our first virtual world.
//What is a virtual world? It's a world where only people assigned to it be able to see each other.
PHP Code:
public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
if(pickupid == AmmuEnt1) //incase of Ammunation entry.
{
SetPlayerInterior(playerid, 7); //which is the Ammu-nation Interior.
SetPlayerVirtualWorld(playerid, 1); //which is the first virtual world we create for players, if you want to make another ammu-nation, make sure the virtual world is 2, or any number not repeated.
SetPlayerPos(playerid, 315.24, -140.89, 999.60); // Coordinates in Ammu-Nation
SetPlayerFacingAngle(playerid, 0); // You can edit the player's facing angle whatever you like.
return 1;
}
if(pickupid == AmmuExt1) //Incase of the ammu-nation exit
{
SetPlayerInterior(playerid, 0); //Setting the player to interior 0, which is the world.
SetPlayerVirtualWorld(playerid, 0); //As usual, normal virtual worlds are always 0.
SetPlayerPos(playerid, 2154.62, 942.78, 10.82); //Setting the player position, which must be outside the ammu-nation.
SetPlayerFacingAngle(playerid, 90); //Setting player's facing angle.
return 1;
}
return 1;
}
Useful links:
3D Text Label Structure: https://sampwiki.blast.hk/wiki/Create3DTextLabel
I hope this helps you creating entrances and exits in your gamemode
Thank You,
Vanter