SA-MP Forums Archive
[Tutorial] Pickup teleport - 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)
+---- Forum: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] Pickup teleport (/showthread.php?tid=427996)



Pickup teleport - Rimmon - 04.04.2013

This is a basic Pickup Teleport Tutorial for begginers
If we want to make a teleport with pickup,first time we must create a pickup
We can create a pickup with
  1. CreatePickup
CreatePickup(model , type , Float:X , Float:Y , Float:Z , virtualworld = 0);
CreatePickup - Create the pickup
model - pickup model
type - pickup type
Float:X - The X coordinate of the pickup
Float:Y - The Y coordinate of the pickup
Float:Z - The Z coordinate of the pickup
virtualworld - In what virtualworld the pickup will appear(0 for standard world)


First time,we'll create a new variable,i will call it tele(from teleport),you can call this variable how you like
Код:
new tele;
Now,let's go at OnGameModeInit to create the pickup(tele will "mark" the pickup)
Код:
tele = CreatePickup(model , type , Float:X , Float:Y , Float:Z , virtualworld = 0);
Now the pickup it's created.

Go at OnPlayerPickUpPickup,
We'll use pickupid (a parameter from OnPlayerPickUpPickup) to create the action of pickup
Код:
if(pickupid == tele)
{
     SetPlayerPos(playerid,Float:x,Float:y,Float:z);
}
SetPlayerPos(playerid,Float:X , Float:Y , Float:Z);
playerid - The player who we will set the new position
Float:X - The X coordinate of new position
Float:Y - The Y coordinate of new position
Float:Z - The Z coordinate of new position


That's all,i hope i helped you guys


Re: Pickup teleport - zT KiNgKoNg - 04.04.2013

Not much of a tutorial, But good job.