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 |
/**
* <summary>
* example:
* accessing interiors using pickups.
*
* We will be using the streamer plugin by Incognito
* Streamer: https://github.com/samp-incognito/samp-streamer-plugin
* </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(19132, 1, 928.231933, -1352.936157, 13.343750);//this will get pickupid 1, e.g CLK_BELL_ENTER
CreateDynamicPickup(19132, 1, 364.994293, -11.147426, 1001.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(playerid, 914.7666,-1352.5599,13.3765);
return 1;
}
public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
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(playerid, 9);
SetPlayerVirtualWorld(playerid,6);
SetPlayerPos(playerid, 364.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(playerid, 924.7666,-1352.5599,13.3765);
}
}
return 1;
}
#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; }
see my post here:
http://webcache.******usercontent.co...PvNYerUeGZp7gG PHP код:
|
I compile it with no changes and i go to the store (clukin bell In Ls)
and nothing happens |
#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; }
I already Do that But It Teleport Me over and Over You know what i mean
|