How to create ? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to create ? (
/showthread.php?tid=298356)
How to create ? -
dundolina - 20.11.2011
[ame]http://www.youtube.com/watch?v=ndY8pserDlY&feature=player_embedded[/ame]
How to do this "arrow" and through it to go into a room or decor. Please explain to me is very important ..
Re: How to create ? -
Alberto_DR - 20.11.2011
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.
Re: How to create ? -
IstuntmanI - 20.11.2011
https://sampwiki.blast.hk/wiki/CreatePickup
https://sampwiki.blast.hk/wiki/OnPlayerPickUpPickup
https://sampwiki.blast.hk/wiki/SetPlayerPos
https://sampwiki.blast.hk/wiki/SetPlayerInterior
Re: How to create ? -
SmiT - 20.11.2011
Using
CreatePickup function,
SetPlayerInterior function and
OnPlayerPickUpPickup callback!
pawn Код:
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 );
}
Re: How to create ? -
Kakioshe22 - 20.11.2011
You need this on "news"
This Defines Your Pickup.
Under OnGameModeInit:
PHP код:
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:
PHP код:
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:
PHP код:
public OnPlayerPickUpPickup(playerid, pickupid)
That is called when player picks up any pickup you made.
Then type this.
PHP код:
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:
PHP код:
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
Re: How to create ? -
Joshb93 - 20.11.2011
Wtf... I always take the hard way around scripting.. :/
Re: How to create ? -
Kakioshe22 - 20.11.2011
Quote:
Originally Posted by Joshb93
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.