Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //>> [Tutorial]:How to make a "Teleport in Dialog" - ZCMD
- //>> Credit to , Zeex -ZCMD , SA-MP Dev Team - a_samp
- //>> include's
- #include a_samp
- #include zcmd
- //>> color's define
- #define COLOR_GRAY 0xCECECEFF
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Teleport in Dialog");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #endif
- //------------------------------< ZEEXCOMMANDS >------------------------------//
- CMD:teleport(playerid, params[])
- {
- ShowPlayerDialog(playerid, 1997, DIALOG_STYLE_LIST, "Teleport System by Sanel", "San Fierro\nLos Santos\nLas Venturas", "Teleport", "Izadji"); // Dialogid 1997 ? you can change it or maybe define it . .
- //ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[]);
- return 1;
- }
- //----------------------------------------------------------------------------//
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 1997) // Check the Dialogid
- {
- switch(listitem) //the list of the item you have in the Dialog ..
- {
- case 0: // case 0; is for San Fierro teleport . .
- {
- new vehicleid = GetPlayerVehicleID(playerid); // check the vehicleID
- new State = GetPlayerState(playerid); // Get the playerState
- if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER) // this will teleport you & your car if you are the driver...
- //if you are not the driver or you maybe a passenger u will just teleport without car ..
- {
- LinkVehicleToInterior(vehicleid,0); //Linkvehicle to interior,this is like SetPlayerInterior . .
- SetPlayerInterior(playerid,0); //this will set the playerinterior
- SetVehicleZAngle(vehicleid,227.2756); //this is the angle of your vehicle
- SetCameraBehindPlayer(playerid); //this will set the camera behind you
- SetVehiclePos(vehicleid,-1986.5483,305.5474,35.0071); //this is the vehicle Pos , Float:X , Float:Y , Float:Z
- return SendClientMessage(playerid, COLOR_GRAY, "[BG-RP]:Teleportovo si se do San Fierro!");//this will send u a Message when u was Teleported!. .
- }
- SetPlayerPos(playerid,-1969.0593,294.0901,35.1719);//this is the Player Pos , Float:X , Float:Y , Float:Z
- SetPlayerFacingAngle(playerid,89.9102); //this is the angle of your player
- SetPlayerInterior(playerid,0);//this will set the playerinterior
- SetCameraBehindPlayer(playerid);//this will set the camera behind you
- SendClientMessage(playerid, COLOR_GRAY, "[BG-RP]:Teleportovo si se do San Fierro!"); //this will send u a Message when u was Teleported!. .
- }
- case 1: // case 1; is for Los Santos teleport . .
- {
- new vehicleid = GetPlayerVehicleID(playerid);// check the vehicleID
- new State = GetPlayerState(playerid);// Get the playerState
- if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER) // this will teleport you & your car if you are the driver...
- //if you are not the driver or you maybe a passenger u will just teleport without car ..
- {
- LinkVehicleToInterior(vehicleid,0);//Linkvehicle to interior,this is like SetPlayerInterior . .
- SetPlayerInterior(playerid,0);//this will set the playerinterior
- SetVehicleZAngle(vehicleid,179.2136);//this is the angle of your vehicle
- SetCameraBehindPlayer(playerid);//this will set the camera behind you
- SetVehiclePos(vehicleid,1608.3900,-1719.7670,13.3786); //this is the vehicle Pos , Float:X , Float:Y , Float:Z
- return SendClientMessage(playerid, COLOR_GRAY, "[BG-RP]:Teleportovo si se do Los Santos!");//this will send u a Message when u was Teleported!. .
- }
- SetPlayerPos(playerid,1606.3514,-1739.5194,13.5469);//this is the Player Pos , Float:X , Float:Y , Float:Z
- SetPlayerFacingAngle(playerid,42.2198); //this is the angle of your player
- SetPlayerInterior(playerid,0);//this will set the playerinterior
- SetCameraBehindPlayer(playerid);//this will set the camera behind you
- SendClientMessage(playerid, COLOR_GRAY, "[BG-RP]:Teleportovo si se do Los Santos!");//this will send u a Message when u was Teleported!. .
- }
- case 2: // case 2; is for Las Venturas teleport . .
- {
- new vehicleid = GetPlayerVehicleID(playerid);// check the vehicleID
- new State = GetPlayerState(playerid);// Get the playerState
- if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)// this will teleport you & your car if you are the driver...
- //if you are not the driver or you maybe a passenger u will just teleport without car ..
- {
- LinkVehicleToInterior(vehicleid,0);//Linkvehicle to interior,this is like SetPlayerInterior . .
- SetPlayerInterior(playerid,0);//this will set the playerinterior
- SetVehicleZAngle(vehicleid,88.7952);//this is the angle of your vehicle
- SetCameraBehindPlayer(playerid);//this will set the camera behind you
- SetVehiclePos(vehicleid,2128.2754,1333.6340,10.6558);//this is the vehicle Pos , Float:X , Float:Y , Float:Z
- return SendClientMessage(playerid, COLOR_GRAY, "[BG-RP]:Teleportovo si se do Las Venturas!");//this will send u a Message when u was Teleported!. .
- }
- SetPlayerPos(playerid,2096.9543,1322.6205,10.8203);//this is the Player Pos , Float:X , Float:Y , Float:Z
- SetPlayerFacingAngle(playerid,52.1985); //this is the angle of your player
- SetPlayerInterior(playerid,0);//this will set the playerinterior
- SetCameraBehindPlayer(playerid);//this will set the camera behind you
- SendClientMessage(playerid, COLOR_GRAY, "[BG-RP]:Teleportovo si se do Las Venturas!");//this will send u a Message when u was Teleported!. .
- }
- //Case 3: //add your other tp
- }
- //your code
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement