[Help]Pickup Teleport
#1

THANKS FOR EVERY ONE HELP

THIS TOPIC VERY HELPFULL : http://forum.sa-mp.com/showthread.ph...26&postcount=1
Reply
#2

Quote:
Originally Posted by Ihabou
Посмотреть сообщение
Hello Everyone!
I Need Some Script To help me to create a shop with pickup I already create one but it teleport me over and over so i need a stable script to help me with creating dynamic pickup that teleport me to the shop and When i enter the shop another one teleport me to outside Like CnR Servers
see my post here:
http://webcache.******usercontent.co...PvNYerUeGZp7gG
PHP код:
/**
* <summary>
*    example:
*        accessing interiors using pickups.
*
*        We will be using the streamer plugin by Incognito
*        Streamer: https://github.com/samp-incognito/samp-s...0.09231836
* </summary>
*/
#include <a_samp>
#include <streamer>
main(){}
enum
{
    
CLK_BELL_ENTER=1,    //we have to start at 1 (unlike default 0)
    
CLK_BELL_EXIT        //since pickup's don't start at 0 but 1
}
public 
OnGameModeInit()
{
    
//im disabling the vanilla (yellow cone) pickups here
    
DisableInteriorEnterExits();
    
//take note, that the order in which we
    //create the pickups is !essential! here,
    //our way of determining which pickup we're
    //dealing with later on depends on it
    
CreateDynamicPickup(191321928.231933, -1352.93615713.343750);//this will get pickupid 1, e.g CLK_BELL_ENTER
    
CreateDynamicPickup(191321364.994293, -11.1474261001.851562);//this 2 and so on...
    
return 1;
}
public 
OnPlayerSpawn(playerid)
{
    
//for this example, you'll get spawned right in
    //front of the shop so you don't have to search
    
SetPlayerPos(playerid914.7666,-1352.5599,13.3765);
    return 
1;
}
public 
OnPlayerPickUpDynamicPickup(playeridpickupid)
{
    switch(
pickupid)        //'switching' through all the id's, better than if-if else
    
{
        case 
CLK_BELL_ENTER://our enter pickup
        
{
            
//actually moving the player inside...
            
SetPlayerInterior(playerid9);
            
SetPlayerVirtualWorld(playerid,6);
            
SetPlayerPos(playerid364.8642,-8.6897,1001.8516);
            
SetPlayerFacingAngle(playerid,357.55);
        }
        case 
CLK_BELL_EXIT://and the exit one
        
{
            
//aaaand outside
            
SetPlayerInterior(playerid,0);
            
SetPlayerVirtualWorld(playerid,0);
            
SetPlayerFacingAngle(playerid,90.0);
            
SetPlayerPos(playerid924.7666,-1352.5599,13.3765);
        }
    }
    return 
1;

hope this helps as an example
Reply
#3

it's not teleport when i enter it i do it like that
This is script this is building near the bank
the arrow shows but nothing happens

Код:
#include <a_samp>
#include <streamer>

main(){}

enum
{
    LSB_ENTER=1,    //we have to start at 1 (unlike default 0)
    LSB_EXIT        //since pickup's don't start at 0 but 1
}

public OnGameModeInit()
{

    CreateDynamicPickup(19132, 1, 1402.6344, -1697.8345, 13.5533);//this will get pickupid 1, e.g CLK_BELL_ENTER
    CreateDynamicPickup(19132, 1, 1299.14, -794.77, 1084.00);//this 2 and so on...
    return 1;
}

public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
    switch(pickupid)        //'switching' through all the id's, better than if-if else
    {
        case LSB_ENTER://our enter pickup
        {
            //actually moving the player inside...
            SetPlayerInterior(playerid, 9);
            SetPlayerVirtualWorld(playerid,6);
            SetPlayerPos(playerid, 1299.14, -794.77, 1084.00);
            SetPlayerFacingAngle(playerid,357.55);
        }
        case LSB_EXIT://and the exit one
        {
            //aaaand outside
            SetPlayerInterior(playerid,0);
            SetPlayerVirtualWorld(playerid,0);
            SetPlayerFacingAngle(playerid,90.0);
            SetPlayerPos(playerid, 1402.6344, -1697.8345, 13.5533);
        }
    }
    return 1;

}
Reply
#4

Quote:
Originally Posted by CutX
Посмотреть сообщение
see my post here:
http://webcache.******usercontent.co...PvNYerUeGZp7gG
PHP код:
/**
* <summary>
*    example:
*        accessing interiors using pickups.
*
*        We will be using the streamer plugin by Incognito
*        Streamer: https://github.com/samp-incognito/samp-s...5.43435959
* </summary>
*/
#include <a_samp>
#include <streamer>
main(){}
enum
{
    
CLK_BELL_ENTER=1,    //we have to start at 1 (unlike default 0)
    
CLK_BELL_EXIT        //since pickup's don't start at 0 but 1
}
public 
OnGameModeInit()
{
    
//im disabling the vanilla (yellow cone) pickups here
    
DisableInteriorEnterExits();
    
//take note, that the order in which we
    //create the pickups is !essential! here,
    //our way of determining which pickup we're
    //dealing with later on depends on it
    
CreateDynamicPickup(191321928.231933, -1352.93615713.343750);//this will get pickupid 1, e.g CLK_BELL_ENTER
    
CreateDynamicPickup(191321364.994293, -11.1474261001.851562);//this 2 and so on...
    
return 1;
}
public 
OnPlayerSpawn(playerid)
{
    
//for this example, you'll get spawned right in
    //front of the shop so you don't have to search
    
SetPlayerPos(playerid914.7666,-1352.5599,13.3765);
    return 
1;
}
public 
OnPlayerPickUpDynamicPickup(playeridpickupid)
{
    switch(
pickupid)        //'switching' through all the id's, better than if-if else
    
{
        case 
CLK_BELL_ENTER://our enter pickup
        
{
            
//actually moving the player inside...
            
SetPlayerInterior(playerid9);
            
SetPlayerVirtualWorld(playerid,6);
            
SetPlayerPos(playerid364.8642,-8.6897,1001.8516);
            
SetPlayerFacingAngle(playerid,357.55);
        }
        case 
CLK_BELL_EXIT://and the exit one
        
{
            
//aaaand outside
            
SetPlayerInterior(playerid,0);
            
SetPlayerVirtualWorld(playerid,0);
            
SetPlayerFacingAngle(playerid,90.0);
            
SetPlayerPos(playerid924.7666,-1352.5599,13.3765);
        }
    }
    return 
1;

hope this helps as an example
I compile it with no changes and i go to the store (clukin bell In Ls)
and nothing happens
Reply
#5

Quote:
Originally Posted by Ihabou
Посмотреть сообщение
I compile it with no changes and i go to the store (clukin bell In Ls)
and nothing happens
hmm this is weird... as it totally works for me and others (that person in other thread)

idk, there might be something else interfering with it on your end

i also tested the one for LS bank you did and also works fine, i get teleportet in and out
but what i've noticed is that there's a vanilla pickup there (inside) already
you should DisableInteriorEnterExits like i suggested in my example
over here http://webcache.******usercontent.co...PvNYerUeGZp7gG

//EDIT: Well im off shoveling snow now, hope you get it right eventually
Reply
#6

anyOne Help O.o ? Please !
Reply
#7

[Tutorial] Pickup Teleport

This Might Help you out.
Reply
#8

I already Do that But It Teleport Me over and Over You know what i mean
Reply
#9

Quote:
Originally Posted by RyderX
Посмотреть сообщение
[Tutorial] Pickup Teleport

This Might Help you out.
Код:
#include <a_samp>

new casino; // for example
new casinoext;
 // for example // also u can change the name for e.g. to ( new samp; ) but you have to change every name

public OnFilterScriptInit()
{
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}
public OnGameModeInit()
{
	casino = CreatePickup(1318, 1, 1402.6344, -1697.8345, 13.5533,0); // so that's the : ls = CreatePickup(model, type, Float:X, Float:Y, Float:Z, Virtualworld); which i told you in the tut
	casinoext = CreatePickup(1318, 1, 2019.0698, 1017.8581, 996.8750,1);
	return 1;
}

public OnGameModeExit()
{
	return 1;
}


public OnPlayerPickUpPickup(playerid, pickupid)// <---- that's when the player picks the pickup // Also X, Y, Z are the coords where the player will teleport to
{
	if(pickupid == casino) SetPlayerPos(playerid,2016.2699,1017.7790,996.8750);
    SetPlayerInterior(playerid,10);
    if(pickupid == casinoext) SetPlayerPos(playerid,1402.6344,-1697.8345,13.5533);
    SetPlayerInterior(playerid,0);
	return 1;
}
When i go to the game and enter it spawn's me in the air but without the ext checkpoint it work's normal wtf ?
Reply
#10

Quote:
Originally Posted by Ihabou
Посмотреть сообщение
I already Do that But It Teleport Me over and Over You know what i mean
ok... i just noticed this, you teleport the player at the exact same position where your exit pickup is!

public OnGameModeInit()
{

CreateDynamicPickup(19132, 1, 1402.6344, -1697.8345, 13.5533);//this will get pickupid 1, e.g CLK_BELL_ENTER
CreateDynamicPickup(19132, 1, 1299.14, -794.77, 1084.00);//this 2 and so on...
return 1;
}

public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
switch(pickupid) //'switching' through all the id's, better than if-if else
{
case LSB_ENTER://our enter pickup
{
//actually moving the player inside...
SetPlayerInterior(playerid, 9);
SetPlayerVirtualWorld(playerid,6);
SetPlayerPos(playerid, 1299.14, -794.77, 1084.00);
SetPlayerFacingAngle(playerid,357.55);
}
case LSB_EXIT://and the exit one
{
//aaaand outside
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
SetPlayerFacingAngle(playerid,90.0);
SetPlayerPos(playerid, 1402.6344, -1697.8345, 13.5533);
}
}
return 1;

}


and what happens then is that the code for the exit pickup gets executed and you teleport the player
at the exact position of the enter pickup..... you created a "teleport-loop" :P

to fix this, simply teleport to another location, do not use the coords of your exit/enter pickup
but rather like maybe 5ft in front of it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)