05.02.2012, 06:41
Creating a Teleport (Supports with Angle)
Brought you by Mr.SmileWinky!
Introduction:
Need a tutorial that teach you about teleport command that supports with angle? this is for you.
This is commonly use in RP/Stunt/DM
Step by Step:
I'm gonna use ZCMD you can also use strcmp for this tutorial.
ZCMD can be download at Filterscript & Include Section.
ok i'm gonna put the command on the bottom of my script.
heres the full command
Sorry for my bad english .
I hope i helped you
once again Brought you by Mr.SmileWinky!
Brought you by Mr.SmileWinky!
Introduction:
Need a tutorial that teach you about teleport command that supports with angle? this is for you.
This is commonly use in RP/Stunt/DM
Step by Step:
I'm gonna use ZCMD you can also use strcmp for this tutorial.
ZCMD can be download at Filterscript & Include Section.
ok i'm gonna put the command on the bottom of my script.
heres the full command
pawn Code:
CMD:lsair(playerid, params[])
{
new string[128],pname[MAX_PLAYER_NAME]; //string 128 is the max string value/pname will be part of the code later.
GetPlayerName(playerid, pname, sizeof(pname)); //pname was define.
format(string, sizeof(string), "%s has teleport to Los Santos Airport (/lsair)", pname); //%s will be the name of player. Pname is used here as %s
SendClientMessageToAll(COLOR_TELEPORT, string); //string (format) is used here, the message will sent to all
if(IsPlayerInAnyVehicle(playerid)) //checks if player is riding on any vehicle
{
/* if player is in any vehicle the SetVehiclePos and SetVehicleZAngle will be called */
SetVehiclePos(GetPlayerVehicleID(playerid), 1910.9939,-2393.6472,13.1090); //Player's Vehicle Position will be set at coordinate 1910.9939,-2393.6472,13.1090
SetVehicleZAngle(GetPlayerVehicleID(playerid), 188.5087); //Player's Vehicle Position will be face at angle coordinate 188.5087
}
else //checks if player is not riding on vehicle
{
/* SetPlayerPos and SetPlayerFacingAngle will be called */
SetPlayerPos(playerid, 1883.2531,-2401.4688,13.5547); //Player's Position will be set at coordinate 1883.2531,-2401.4688,13.5547
SetPlayerFacingAngle(playerid, 204.4409); //Player's Position will be face at angle coordinate 204.4409
}
return 1; //without this the server will read it as "SERVER: Unknown Command"
}
I hope i helped you
once again Brought you by Mr.SmileWinky!