/places
#10

I decide to use this structure, but i dont know if its the correct way:

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(playeridCOLOR_CORRECTION"You are not authorized to use this command !");
       }
       return 
1;
    } 
PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 200)
    {
          if(
response)
          {
            if(
listitem == 0)
            {
               
SetPlayerInterior(playerid0);
               
SetPlayerPos(playerid1258.7352,-2036.7100,59.4561);
               
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Los Santos !" );
            }
            if(
listitem == 1)
            {
               
SetPlayerInterior(playerid0);
               
SetPlayerPos(playerid, -2018.0339,145.6004,27.9839);
               
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to San Fierro !" );
            }
            if(
listitem == 2)
            {
               
SetPlayerInterior(playerid0);
               
SetPlayerPos(playerid2028.8151,1007.9219,10.8203);
               
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Las Venturas !" );
            }
            if(
listitem == 3)
            {
               
SetPlayerInterior(playerid0);
               
SetPlayerPos(playerid700.7490,-464.1175,16.3359);
               
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Dillimore !" );
            }
            if(
listitem == 4)
            {
               
SetPlayerInterior(playerid0);
               
SetPlayerPos(playerid175.4555,-148.2676,1.5781);
               
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Blueberry !" );
            }
            if(
listitem == 5)
            {
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid1355.9956,252.8677,19.5547);
            
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Montgomery !");
            }
            if(
listitem == 6)
            {
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid2273.0762,-84.6477,26.5138);
            
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Palomino Creek !");
            }
            if(
listitem == 7)
            {
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid, -2164.1357,-2388.7588,30.6250);
            
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Angel Pine !");
            }
            if(
listitem == 8)
            {
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid, -2262.6235,2319.2014,4.8125);
            
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Bayside !");
            }
            if(
listitem == 9)
            {
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid, -1485.6838,2662.0139,55.8359);
            
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to El Quebrado !");
            }
            if(
listitem == 10)
            {
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid, -836.9157,1526.6680,21.5830);
            
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Las Barrancas !");
            }
            if(
listitem == 11)
            {
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid, -201.8772,1119.2716,19.7422);
            
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Fort Carson !");
            }
            if(
listitem == 12)
            {
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid, -236.2037,2626.6682,62.7411);
            
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Las Payasadas !");
            }
            if(
listitem == 13)
            {
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid, -2234.0476,-1736.3102,480.8173);
            
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Mount Chiliad !");
            }
            if(
listitem == 14)
            {
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid2041.7695,-1413.9603,17.1708);
            
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to County General Hospital !");
            }
               if(
listitem == 15)
            {
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid1184.2737,-1316.9083,13.5732);
            
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to All Saints General Hospital !");
            }
            if(
listitem == 16)
            {
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid, -706.1820,965.1531,12.4496);
            
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Hitman Head Quarters !");
            }
            if(
listitem == 17)
            {
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid261.7835,2899.4849,8.7624);
            
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Hitman Secondary Head Quarters !");
            }
            if(
listitem == 18)
            {
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid107.2300,1920.6311,18.5208);
            
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Fort DeMorgan !");
            }
        }
    }

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.
Reply


Messages In This Thread
/places - by Jaua10 - 03.08.2018, 09:10
Re: /places - by Florin48 - 03.08.2018, 09:32
Re: /places - by GRiMMREAPER - 03.08.2018, 09:36
Re: /places - by coool - 03.08.2018, 09:40
Re: /places - by Jaua10 - 03.08.2018, 17:54
Re: /places - by GRiMMREAPER - 03.08.2018, 18:06
Re: /places - by Jaua10 - 03.08.2018, 18:07
Re: /places - by Jaua10 - 03.08.2018, 18:31
Re: /places - by Sew_Sumi - 03.08.2018, 19:24
Re: /places - by Jaua10 - 04.08.2018, 18:25

Forum Jump:


Users browsing this thread: 6 Guest(s)