It doesn't work unfortunately, it says "Unknows commmand" in game.
I have this in a filterscript, cannot find the error though. I've also tried it like that but the result was the same:
pawn Код:
//>> [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
#define FILTERSCRIPT
//>> color's define
#define COLOR_GRAY 0xCECECEFF
#define COLOR_BRIGHTRED 0xFF0000AA
#if defined FILTERSCRIPT
new teleDisabled = 0; // To disable /tele
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Teleport System by giuliocame");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#endif
//---------------------------------------------------------------------------
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
if (strcmp(cmd, "/telesoff", true) == 0) {
teleDisabled = 1; // commands are disabled 1 = disabled
SendClientMessageToAll(0xFF0000FF, "Teleports are now disabled."); // a message for all
return 1;
}
if (strcmp(cmd, "/teleson", true) == 0) {
teleDisabled = 0; // Commands are actived 0 = activated
SendClientMessageToAll(0xFF0000FF, "Teleports are now activated."); // a message for all
return 1;
}
return 0;
}
//------------------------------< ZEEXCOMMANDS >------------------------------//
CMD:tele(playerid, params[])
{
if(teleDisabled == 1) return SendClientMessage(playerid, 0xFF0000FF, "This command is disabled."); // command is disabled, we send a text to player who he uses this command
ShowPlayerDialog(playerid, 1997, DIALOG_STYLE_LIST, "Teleport System in Dialog", "San Fierro\nLos Santos\nLas Venturas\nLos Santos Airport\nLas Venturas Airport\nSan Fierro Airport\nChilliad\nOld Airport\nSan Fierro Stunts\nArea 51\nThe Club\nWaterpark\nNrg Basket\nHay Area\nRoof Area\nNrg Skills\nNrg Skills 2", "Teleport", "Close"); // 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
{
if(response)
{
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_BRIGHTRED, "Teleported to 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_BRIGHTRED, "Teleported to 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_BRIGHTRED, "Teleported to 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_BRIGHTRED, "Teleported to Los Santos!");//this will send u a Message when u was Teleported!. .
}
case 2: //lv 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_BRIGHTRED, "Teleported to 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_BRIGHTRED, "Teleported to Las Venturas!");//this will send u a Message when u was Teleported!. .
}
case 3: //ls air
{
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,1713.8,-2499.3,13.5);//this is the vehicle Pos , Float:X , Float:Y , Float:Z
return SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to Los Santos Airport!");//this will send u a Message when u was Teleported!. .
}
SetPlayerPos(playerid,1713.8,-2499.3,13.5);//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_BRIGHTRED, "Teleported to Los Santos Airport!");//this will send u a Message when u was Teleported!. .
}
case 4: //lv air
{
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,1439,1468,10.82);//this is the vehicle Pos , Float:X , Float:Y , Float:Z
return SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to Las Venturas Airport!");//this will send u a Message when u was Teleported!. .
}
SetPlayerPos(playerid,1439,1468,10.82);//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_BRIGHTRED, "Teleported to Las Venturas Airport!");//this will send u a Message when u was Teleported!. .
}
case 5: //sf air
{
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,-1610,-232,14.15);//this is the vehicle Pos , Float:X , Float:Y , Float:Z
return SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to San Fierro Airport!");//this will send u a Message when u was Teleported!. .
}
SetPlayerPos(playerid,-1610,-232,14.15);//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_BRIGHTRED, "Teleported to San Fierro Airport!");//this will send u a Message when u was Teleported!. .
}
case 6: //chilliad
{
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,-2330.0,-1628.0,483.7);//this is the vehicle Pos , Float:X , Float:Y , Float:Z
return SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to Chilliad!");//this will send u a Message when u was Teleported!. .
}
SetPlayerPos(playerid,-2330.0,-1628.0,483.7);//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_BRIGHTRED, "Teleported to Chilliad!");//this will send u a Message when u was Teleported!. .
}
case 7: //old air
{
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,401,2498,16.48);//this is the vehicle Pos , Float:X , Float:Y , Float:Z
return SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to Old Airport!");//this will send u a Message when u was Teleported!. .
}
SetPlayerPos(playerid,401,2498,16.48);//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_BRIGHTRED, "Teleported to Old Airport!");//this will send u a Message when u was Teleported!. .
}
case 8: //sf stunts
{
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,-2461.9,1490.5,7.2);//this is the vehicle Pos , Float:X , Float:Y , Float:Z
return SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to San Fierro Stunts!");//this will send u a Message when u was Teleported!. .
}
SetPlayerPos(playerid,-2461.9,1490.5,7.2);//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_BRIGHTRED, "Teleported to San Fierro Stunts!");//this will send u a Message when u was Teleported!. .
}
case 9: //area 51
{
SetPlayerPos(playerid,212,1908,17.64);//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_BRIGHTRED, "Teleported to Area 51!");//this will send u a Message when u was Teleported!. .
}
case 10: //club
{
SetPlayerPos(playerid,1070.6584,1336.6307,10.8428);//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_BRIGHTRED, "Teleported to The Club!"); //this will send u a Message when u was Teleported!. .
}
case 11: //waterpark
{
SetPlayerPos(playerid,-2093.0,-2820.3,3.0);//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_BRIGHTRED, "Teleported to Waterpark!");//this will send u a Message when u was Teleported!. .
}
case 12: //nrg basket
{
SetPlayerPos(playerid,1388.5,-1189.0,202.4);//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_BRIGHTRED, "Teleported to NRG Basket!");//this will send u a Message when u was Teleported!. .
}
case 13: //hay area
{
SetPlayerPos(playerid,1450.214966, -1055.654663, 213.38);//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_BRIGHTRED, "Teleported to Hay Area!");//this will send u a Message when u was Teleported!. .
}
case 14: //roof area
{
SetPlayerPos(playerid,1691.64, -1391.87, 88.17);//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_BRIGHTRED, "Teleported to Roof Area!");//this will send u a Message when u was Teleported!. .
}
case 15: //nrg skills
{
SetPlayerPos(playerid,-1537.8,318.1,53.4);//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_BRIGHTRED, "Teleported to Bike Skills!");//this will send u a Message when u was Teleported!. .
}
case 16: //nrg skills 2
{
SetPlayerPos(playerid,837.1,-2035.8,12.8);//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_BRIGHTRED, "Teleported to Bike Skills 2!");//this will send u a Message when u was Teleported!. .
}
}
}
}
return 1;
}