[Help]Pickup Teleport
#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...9.02119595
* </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


Messages In This Thread
[Help]Pickup Teleport - by Ihabou - 05.01.2017, 11:08
Re: [Help]Pickup Teleport - by CutX - 05.01.2017, 11:46
Re: [Help]Pickup Teleport - by Ihabou - 05.01.2017, 12:13
Re: [Help]Pickup Teleport - by Ihabou - 05.01.2017, 14:14
Re: [Help]Pickup Teleport - by CutX - 05.01.2017, 14:19
Re: [Help]Pickup Teleport - by Ihabou - 05.01.2017, 15:25
Re: [Help]Pickup Teleport - by RyderX - 05.01.2017, 15:28
Re: [Help]Pickup Teleport - by Ihabou - 05.01.2017, 15:34
Re: [Help]Pickup Teleport - by Ihabou - 05.01.2017, 16:08
Re: [Help]Pickup Teleport - by CutX - 05.01.2017, 16:28

Forum Jump:


Users browsing this thread: 2 Guest(s)