[Tutorial] Pickup teleport
#1

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
Reply
#2

Not much of a tutorial, But good job.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)