27.06.2012, 01:28
hey guys i need a ingame teleport maker becuase i make maps in the water and i dont know how to get there in debug soooooo ya...i need a system or something...
//in OnDialogResponse
case DIALOG_TELEPORTS :
{
if(!response) return SendClientMessage(playerid, 0xFFFFFFFF, "You canceled!");
if(GetPlayerVehicleID(playerid))
{
SetVehiclePos(GetPlayerVehicleID(playerid),aPlayerTeleports[listitem][ePT_X],aPlayerTeleports[listitem][ePT_Y],aPlayerTeleports[listitem][ePT_Z]);
} else {
SetPlayerPos(playerid,aPlayerTeleports[listitem][ePT_X],aPlayerTeleports[listitem][ePT_Y],aPlayerTeleports[listitem][ePT_Z]);
}
return 1;
}
//the code for the teleports
#define DIALOG_TELEPORTS 5545
enum ePlayerTeleports
{
ePT_Name[14],
Float:ePT_X,
Float:ePT_Y,
Float:ePT_Z
}
new aPlayerTeleports[][ePlayerTeleports]=
{
{"the strip" , 2133.2334 , 1140.0221 , 13.1362},
//{"skydive" , 102.1095 , 2586.7051 , 214.77629},
{"lsair" , 1939.0291 , -2235.8638 , 13.5469},
{"quarry" , 809.9111 , 843.4572 , 9.8722},
{"aair" , 339.7693 , 2545.0022 , 16.7897},
{"grove" , 2481.0984 , -1699.1428 , 13.5266}
//add more here
};
//the command using y_commands if you need it zcmd just ask.
YCMD:tele(playerid, params[], help)
{
#pragma unused params
if(help){SendClientMessage(playerid, 0xFFCC33AA, "/tele : Teleport");}
else
{
new i,aSize,strDialog[1024];
aSize = sizeof(aPlayerTeleports);
for (i=0;i<aSize;i++){
if (i==0) format(strDialog, sizeof (strDialog), "%s", aPlayerTeleports[i][ePT_Name]);
else format(strDialog, sizeof (strDialog), "%s\n%s",strDialog, aPlayerTeleports[i][ePT_Name]);
}
ShowPlayerDialog(playerid, DIALOG_TELEPORTS, DIALOG_STYLE_LIST, "Teleport", strDialog, "Go!!", "Cancel");
}
return 1;
}
/save Drift