04.08.2018, 18:25
I decide to use this structure, but i dont know if its the correct way:
I dont know if i missed any thing, i would like if you help me, but the code have no errors for the moment and its working, but like i said before im new in this lenguage so i want to learn how can i do a better work.
PHP код:
CMD:places(playerid)
{
if(PlayerInfo[playerid][pAdmin] >= 420)
{
ShowPlayerDialog(playerid,200,DIALOG_STYLE_LIST, " {0092FF}Admin Places Menu", "Los Santos \nSan Fierro \nLas Venturas \nDillimore \nBlueberry \nMontgomery \nPalomino Creek \nAngel Pine \nBayside \nEl Quebrado \nLas Barrancas \nFort Carson \nLas Payasadas \nMount Chiliad \nCounty General Hospital \nAll Saints General Hospital \nHitman Head Quarters \nHitman Secondary Head Quarters \nFort DeMorgan", "Go", "Cancel");
}
else
{
SendClientMessage(playerid, COLOR_CORRECTION, "You are not authorized to use this command !");
}
return 1;
}
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 200)
{
if(response)
{
if(listitem == 0)
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1258.7352,-2036.7100,59.4561);
SendClientMessage(playerid, COLOR_SUCCESS, "You have been teleported to Los Santos !" );
}
if(listitem == 1)
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, -2018.0339,145.6004,27.9839);
SendClientMessage(playerid, COLOR_SUCCESS, "You have been teleported to San Fierro !" );
}
if(listitem == 2)
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 2028.8151,1007.9219,10.8203);
SendClientMessage(playerid, COLOR_SUCCESS, "You have been teleported to Las Venturas !" );
}
if(listitem == 3)
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 700.7490,-464.1175,16.3359);
SendClientMessage(playerid, COLOR_SUCCESS, "You have been teleported to Dillimore !" );
}
if(listitem == 4)
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 175.4555,-148.2676,1.5781);
SendClientMessage(playerid, COLOR_SUCCESS, "You have been teleported to Blueberry !" );
}
if(listitem == 5)
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1355.9956,252.8677,19.5547);
SendClientMessage(playerid, COLOR_SUCCESS, "You have been teleported to Montgomery !");
}
if(listitem == 6)
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 2273.0762,-84.6477,26.5138);
SendClientMessage(playerid, COLOR_SUCCESS, "You have been teleported to Palomino Creek !");
}
if(listitem == 7)
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, -2164.1357,-2388.7588,30.6250);
SendClientMessage(playerid, COLOR_SUCCESS, "You have been teleported to Angel Pine !");
}
if(listitem == 8)
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, -2262.6235,2319.2014,4.8125);
SendClientMessage(playerid, COLOR_SUCCESS, "You have been teleported to Bayside !");
}
if(listitem == 9)
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, -1485.6838,2662.0139,55.8359);
SendClientMessage(playerid, COLOR_SUCCESS, "You have been teleported to El Quebrado !");
}
if(listitem == 10)
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, -836.9157,1526.6680,21.5830);
SendClientMessage(playerid, COLOR_SUCCESS, "You have been teleported to Las Barrancas !");
}
if(listitem == 11)
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, -201.8772,1119.2716,19.7422);
SendClientMessage(playerid, COLOR_SUCCESS, "You have been teleported to Fort Carson !");
}
if(listitem == 12)
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, -236.2037,2626.6682,62.7411);
SendClientMessage(playerid, COLOR_SUCCESS, "You have been teleported to Las Payasadas !");
}
if(listitem == 13)
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, -2234.0476,-1736.3102,480.8173);
SendClientMessage(playerid, COLOR_SUCCESS, "You have been teleported to Mount Chiliad !");
}
if(listitem == 14)
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 2041.7695,-1413.9603,17.1708);
SendClientMessage(playerid, COLOR_SUCCESS, "You have been teleported to County General Hospital !");
}
if(listitem == 15)
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1184.2737,-1316.9083,13.5732);
SendClientMessage(playerid, COLOR_SUCCESS, "You have been teleported to All Saints General Hospital !");
}
if(listitem == 16)
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, -706.1820,965.1531,12.4496);
SendClientMessage(playerid, COLOR_SUCCESS, "You have been teleported to Hitman Head Quarters !");
}
if(listitem == 17)
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 261.7835,2899.4849,8.7624);
SendClientMessage(playerid, COLOR_SUCCESS, "You have been teleported to Hitman Secondary Head Quarters !");
}
if(listitem == 18)
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 107.2300,1920.6311,18.5208);
SendClientMessage(playerid, COLOR_SUCCESS, "You have been teleported to Fort DeMorgan !");
}
}
}
}