PDA

View Full Version : How to create ?


dundolina
20/11/2011, 11:50 AM
http://www.youtube.com/watch?v=ndY8pserDlY&feature=player_embedded

How to do this "arrow" and through it to go into a room or decor. Please explain to me is very important ..

Alberto_DR
20/11/2011, 11:53 AM
its called int, it depends on your script if its dynamic and can be added IG with a command or if you need to script it in.

IstuntmanI
20/11/2011, 11:59 AM
http://wiki.sa-mp.com/wiki/CreatePickup
http://wiki.sa-mp.com/wiki/OnPlayerPickUpPickup
http://wiki.sa-mp.com/wiki/SetPlayerPos
http://wiki.sa-mp.com/wiki/SetPlayerInterior

SmiT
20/11/2011, 12:00 PM
Using CreatePickup (http://wiki.sa-mp.com/wiki/CreatePickup) function, SetPlayerInterior (http://wiki.sa-mp.com/wiki/SetPlayerInterior) function and OnPlayerPickUpPickup (http://wiki.sa-mp.com/wiki/OnPlayerPickUpPickup) callback!


new
tp_pickup
;

public OnGameModeInit() /* or onfilterscriptinit if it's a filterscript */
{
tp_pickup = CreatePickup( 1318, 23, Float:X, Float:Y, Float:Z, virtualworld = 0 );
/* 1318 - white arrow model */
return ( 1 );
}

public OnPlayerPickUpPickup( playerid, pickupid )
{
if ( pickupid == tp_pickup ) /* if he enteres the arrow */
{
SetPlayerPos( playerid, Float:x, Float:y, Float:z ); /* teleport him */
SetPlayerInterior( playerid, interiorid ); /* set his interior */
}
return ( 1 );
}

Kakioshe22
20/11/2011, 12:06 PM
You need this on "news"
This Defines Your Pickup.
new pickup1;

Under OnGameModeInit:
pickup1 = CreatePickup(model, type, Float:X, Float:Y, Float:Z, Virtualworld);
You go in any server and type /save [text] And Copy X, Y, Z from it, virtual world is mostly 0
Here is an example:
pickup1 = CreatePickup(1239, 19, 2116.7874, -1787.9985, 13.5547, 0);

Go on: http://weedarr.wikidot.com/pickups to see pickups

Now when you create arrow where you want, to use it to enter somewhere or teleport somewhere use this:

public OnPlayerPickUpPickup(playerid, pickupid)
That is called when player picks up any pickup you made.

Then type this.
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == pickup1)
{
SetPlayerPos(playerid,Float:x,Float:y,Float:z);
return 1;
}
That is when player picks up the pickup "pickup1" we made in OnGameModeInit

On SetPlayerPos you can put any location to enter, or if you want him to be in interior use this:

public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == pickup1)
{
SetPlayerPos(playerid,Float:x,Float:y,Float:z);
SetPlayerInterior(playerid, interiorid);
return 1;
}
Interiors at: http://weedarr.wikidot.com/interior

LOL while i was typing explanations and all 3 answered :D

Joshb93
20/11/2011, 12:08 PM
Wtf... I always take the hard way around scripting.. :/

Kakioshe22
20/11/2011, 12:09 PM
This is just an example!


Under OnGameModeInit()

CreateObject( 1239, X, Y, Z, RotX, RotY, RotZ); // fill in the proper coords of where the arrow should go

Under the commands section,

Im going to use ZCMD:

CMD:enter(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, X, Y, Z);
{
SetPlayerPos(playerid, X, Y, Z); // make the X.Y,Z coords inside the building you want them to go in
SetCamerBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid, 1);
TogglePlayerControllable(playerid, 1); // Ive had some freeze bugs when doing this, so, i always add this
}
}

Dude that isn't anything related to this, this is pickup making and entering when he touches it, that what you made isn't close to this, or maybe it is, but that isnt what he asked.