22.06.2010, 18:26
hola que tal quiero saber como se hace los teleports mediante dialogos
por favor ayuda
por favor ayuda
if (strcmp(cmdtext, "/go", true) == 0) { if(IsPlayerConnected(playerid)) { if (PlayerInfo[playerid][pAdmin] >= 2) { ShowPlayerDialog(playerid, GOTOMENU, DIALOG_STYLE_LIST, "Lista Teleports","LS\nSF\nLV\nJet\nRodeo\nInt\nMC\nSAST\nstad\nPrision\nStadium 2\nHospital\nLCN\nAeropuerto\nGym\nCounty\nFBI\nHitman HQ\nAutoescuela\nKarts ", "Ir", "Cancelar"); } else { SendClientMessage(playerid, COLOR_GRAD1, " No eres Moderador!"); } } return 1; }
if(dialogid == GOTOMENU) { if(response) { if(listitem == 0) // LS { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 1529.6,-1691.2,13.3); TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0; } else { SetPlayerPos(playerid, 1529.6,-1691.2,13.3); } SendClientMessage(playerid, COLOR_GRAD1, " Has sido teleportado !"); SetPlayerInterior(playerid,0); PlayerInfo[playerid][pInt] = 0; } if(listitem == 1) // SF { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, -1417.0,-295.8,14.1); TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0; } else { SetPlayerPos(playerid, -1417.0,-295.8,14.1); } SendClientMessage(playerid, COLOR_GRAD1, " Has sido teleportado"); SetPlayerInterior(playerid,0); PlayerInfo[playerid][pInt] = 0; } if(listitem == 2) // LV { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 1699.2, 1435.1, 10.7); TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0; } else { SetPlayerPos(playerid, 1699.2,1435.1, 10.7); } SendClientMessage(playerid, COLOR_GRAD1, " Has sido teleportado"); SetPlayerInterior(playerid,0); PlayerInfo[playerid][pInt] = 0; } if(listitem == 3) // Jet { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 1.71875, 30.4062, 1200.34); } else { SetPlayerPos(playerid, 1.71875, 30.4062, 1200.34); } SetPlayerInterior(playerid,1); SendClientMessage(playerid, COLOR_GRAD1, " Has sido teleportado"); } if(listitem == 4) // Rodeo { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); SetVehiclePos(vehicleid, 593.0324,-1241.1177,17.9662); SetPlayerPos(playerid, 593.0324,-1241.1177,17.9662); SendClientMessage(playerid, COLOR_ALLDEPT, "Has sido teleportado a Rodeo."); SetPlayerInterior(playerid,0); SetPlayerVirtualWorld(playerid,0); } if(listitem == 5) // Interior { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 1416.107000,0.268620,1000.926000); } else { SetPlayerPos(playerid, 1416.107000,0.268620,1000.926000); } SendClientMessage(playerid, COLOR_GRAD1, " Has sido teleportado"); SetPlayerInterior(playerid,1); } if(listitem == 6) // MC { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, -2310.7483,-1636.6708,483.7031); TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0; } else { SetPlayerPos(playerid, -2310.7483,-1636.6708,483.7031); } SendClientMessage(playerid, COLOR_GRAD1, " Has sido teleportado !"); SetPlayerInterior(playerid,0); PlayerInfo[playerid][pInt] = 0; } if(listitem == 7) // DPD { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 647.6130,-569.1110,16.2114); TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0; } else { SetPlayerPos(playerid, 647.6130,-569.1110,16.2114); } SendClientMessage(playerid, COLOR_GRAD1, " Has sido teleportado !"); SetPlayerInterior(playerid,0); PlayerInfo[playerid][pInt] = 0; } if(listitem == 8) // stad { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, -1435.75, -652.664, 1054.94); } else { SetPlayerPos(playerid, -1435.75, -652.664, 1054.94); } SetPlayerInterior(playerid,4); } if(listitem == 9) // Prison { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 1811.0902,-1576.8265,13.5222); } else { SetPlayerPos(playerid, 1811.0902,-1576.8265,13.5222); } SetPlayerInterior(playerid,0); } if(listitem == 10) // Stadium 2 { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 2685.8931,-1689.8219,9.4348); } else { SetPlayerPos(playerid, 2685.8931,-1689.8219,9.4348); } SetPlayerInterior(playerid,0); } if(listitem == 11) // All Saints { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 1188.4399,-1326.0999,13.5596); } else { SetPlayerPos(playerid, 1188.4399,-1326.0999,13.5596); } SetPlayerInterior(playerid,0); } if(listitem == 12) // Presidents house { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 1137.4019,-2037.7604,69.0078); } else { SetPlayerPos(playerid, 1137.4019,-2037.7604,69.0078); } SetPlayerInterior(playerid,0); } if(listitem == 13) // Airport { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 1962.2400,-2183.4321,13.5469); } else { SetPlayerPos(playerid, 1962.2400,-2183.4321,13.5469); } SetPlayerInterior(playerid,0); } if(listitem == 14) // Gym { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 2232.4585,-1740.8671,13.5507); } else { SetPlayerPos(playerid, 2232.4585,-1740.8671,13.5507); } SetPlayerInterior(playerid,0); } if(listitem == 15) // County { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 2023.4404,-1417.1273,16.9922); } else { SetPlayerPos(playerid,2023.4404,-1417.1273,16.9922); } SetPlayerInterior(playerid,0); } if(listitem == 16) // FBI { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 1521.1025,-1448.7759,13.5391); } else { SetPlayerPos(playerid, 1521.1025,-1448.7759,13.5391); } SetPlayerInterior(playerid,0); } if(listitem == 17) // Hitman HQ { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 2221.9817,-2218.4358,13.5469); } else { SetPlayerPos(playerid, 2221.9817,-2218.4358,13.5469); } SetPlayerInterior(playerid,0); } if(listitem == 18) // DMV { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 1093.7688,-1740.1776,13.5133); } else { SetPlayerPos(playerid, 1093.7688,-1740.1776,13.5133); } SetPlayerInterior(playerid,0); } if(listitem == 19) // Karts { SetPlayerPos(playerid, -2010.0519,-67.8943,37.5307,123.7363); SetPlayerInterior(playerid, 0); } } return 1; }
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/teletransportes", true)) // Comando.
{
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "Teletransportes", "Los Santos\nAeropuerto\nStunts...", "Aceptar", "Cancelar");
//ShowPlayerDialog(playerid, IdDialog, TipoDeDialog, "Cabecero", "Lo que contiene", "Botуn 1", "Botуn 2");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) // Callback.
{
if(dialogid == 0) // Id del dialog.
{
if(response) // Si hace clic en el primer botуn: Aceptar.
{
if(listitem == 0) // Si la primera lнnea es la seleccionada.
{
SetPlayerPos(playerid, 0.0, 0.0, 0.0); // Teletransportarse.
}
if(listitem == 1)
{
SetPlayerPos(playerid, 0.0, 0.0, 0.0);
}
if(listitem == 2)
{
SetPlayerPos(playerid, 0.0, 0.0, 0.0);
}
}
}
return 0;
}
Pues puedes usar de base este codigo:
Код:
if (strcmp(cmdtext, "/go", true) == 0) { if(IsPlayerConnected(playerid)) { if (PlayerInfo[playerid][pAdmin] >= 2) { ShowPlayerDialog(playerid, GOTOMENU, DIALOG_STYLE_LIST, "Lista Teleports","LS\nSF\nLV\nJet\nRodeo\nInt\nMC\nSAST\nstad\nPrision\nStadium 2\nHospital\nLCN\nAeropuerto\nGym\nCounty\nFBI\nHitman HQ\nAutoescuela\nKarts ", "Ir", "Cancelar"); } else { SendClientMessage(playerid, COLOR_GRAD1, " No eres Moderador!"); } } return 1; } Код:
if(dialogid == GOTOMENU) { if(response) { if(listitem == 0) // LS { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 1529.6,-1691.2,13.3); TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0; } else { SetPlayerPos(playerid, 1529.6,-1691.2,13.3); } SendClientMessage(playerid, COLOR_GRAD1, " Has sido teleportado !"); SetPlayerInterior(playerid,0); PlayerInfo[playerid][pInt] = 0; } if(listitem == 1) // SF { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, -1417.0,-295.8,14.1); TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0; } else { SetPlayerPos(playerid, -1417.0,-295.8,14.1); } SendClientMessage(playerid, COLOR_GRAD1, " Has sido teleportado"); SetPlayerInterior(playerid,0); PlayerInfo[playerid][pInt] = 0; } if(listitem == 2) // LV { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 1699.2, 1435.1, 10.7); TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0; } else { SetPlayerPos(playerid, 1699.2,1435.1, 10.7); } SendClientMessage(playerid, COLOR_GRAD1, " Has sido teleportado"); SetPlayerInterior(playerid,0); PlayerInfo[playerid][pInt] = 0; } if(listitem == 3) // Jet { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 1.71875, 30.4062, 1200.34); } else { SetPlayerPos(playerid, 1.71875, 30.4062, 1200.34); } SetPlayerInterior(playerid,1); SendClientMessage(playerid, COLOR_GRAD1, " Has sido teleportado"); } if(listitem == 4) // Rodeo { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); SetVehiclePos(vehicleid, 593.0324,-1241.1177,17.9662); SetPlayerPos(playerid, 593.0324,-1241.1177,17.9662); SendClientMessage(playerid, COLOR_ALLDEPT, "Has sido teleportado a Rodeo."); SetPlayerInterior(playerid,0); SetPlayerVirtualWorld(playerid,0); } if(listitem == 5) // Interior { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 1416.107000,0.268620,1000.926000); } else { SetPlayerPos(playerid, 1416.107000,0.268620,1000.926000); } SendClientMessage(playerid, COLOR_GRAD1, " Has sido teleportado"); SetPlayerInterior(playerid,1); } if(listitem == 6) // MC { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, -2310.7483,-1636.6708,483.7031); TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0; } else { SetPlayerPos(playerid, -2310.7483,-1636.6708,483.7031); } SendClientMessage(playerid, COLOR_GRAD1, " Has sido teleportado !"); SetPlayerInterior(playerid,0); PlayerInfo[playerid][pInt] = 0; } if(listitem == 7) // DPD { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 647.6130,-569.1110,16.2114); TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0; } else { SetPlayerPos(playerid, 647.6130,-569.1110,16.2114); } SendClientMessage(playerid, COLOR_GRAD1, " Has sido teleportado !"); SetPlayerInterior(playerid,0); PlayerInfo[playerid][pInt] = 0; } if(listitem == 8) // stad { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, -1435.75, -652.664, 1054.94); } else { SetPlayerPos(playerid, -1435.75, -652.664, 1054.94); } SetPlayerInterior(playerid,4); } if(listitem == 9) // Prison { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 1811.0902,-1576.8265,13.5222); } else { SetPlayerPos(playerid, 1811.0902,-1576.8265,13.5222); } SetPlayerInterior(playerid,0); } if(listitem == 10) // Stadium 2 { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 2685.8931,-1689.8219,9.4348); } else { SetPlayerPos(playerid, 2685.8931,-1689.8219,9.4348); } SetPlayerInterior(playerid,0); } if(listitem == 11) // All Saints { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 1188.4399,-1326.0999,13.5596); } else { SetPlayerPos(playerid, 1188.4399,-1326.0999,13.5596); } SetPlayerInterior(playerid,0); } if(listitem == 12) // Presidents house { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 1137.4019,-2037.7604,69.0078); } else { SetPlayerPos(playerid, 1137.4019,-2037.7604,69.0078); } SetPlayerInterior(playerid,0); } if(listitem == 13) // Airport { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 1962.2400,-2183.4321,13.5469); } else { SetPlayerPos(playerid, 1962.2400,-2183.4321,13.5469); } SetPlayerInterior(playerid,0); } if(listitem == 14) // Gym { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 2232.4585,-1740.8671,13.5507); } else { SetPlayerPos(playerid, 2232.4585,-1740.8671,13.5507); } SetPlayerInterior(playerid,0); } if(listitem == 15) // County { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 2023.4404,-1417.1273,16.9922); } else { SetPlayerPos(playerid,2023.4404,-1417.1273,16.9922); } SetPlayerInterior(playerid,0); } if(listitem == 16) // FBI { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 1521.1025,-1448.7759,13.5391); } else { SetPlayerPos(playerid, 1521.1025,-1448.7759,13.5391); } SetPlayerInterior(playerid,0); } if(listitem == 17) // Hitman HQ { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 2221.9817,-2218.4358,13.5469); } else { SetPlayerPos(playerid, 2221.9817,-2218.4358,13.5469); } SetPlayerInterior(playerid,0); } if(listitem == 18) // DMV { if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 1093.7688,-1740.1776,13.5133); } else { SetPlayerPos(playerid, 1093.7688,-1740.1776,13.5133); } SetPlayerInterior(playerid,0); } if(listitem == 19) // Karts { SetPlayerPos(playerid, -2010.0519,-67.8943,37.5307,123.7363); SetPlayerInterior(playerid, 0); } } return 1; } |