ahwheels command
#1

Hey all I have thsi awheels command that brings up a dialog with all wheels but when i click on the wheel it wont install, heres all parts of the script realted too it.

Код:
//define;

#define 	Menu 8898


//OnDialogResponse code;

if(dialogid == Menu)
    	{
   	 		new vehicleid = GetPlayerVehicleID(playerid);
            if(!response)
            {
            	SendClientMessage(playerid, 0xFF0000FF, "{AAAAAA}You cancelled.");
            	return 1;
            }
			if(response)
         	{
          		if (vehicleid)
            	{
              		if(listitem == 0) return AddVehicleComponent(vehicleid, 1073);
               		if(listitem == 1) return AddVehicleComponent(vehicleid, 1074);
          			if(listitem == 2) return AddVehicleComponent(vehicleid, 1075);
             		if(listitem == 3) return AddVehicleComponent(vehicleid, 1076);
               		if(listitem == 4) return AddVehicleComponent(vehicleid, 1077);
                 	if(listitem == 5) return AddVehicleComponent(vehicleid, 1078);
                  	if(listitem == 6) return AddVehicleComponent(vehicleid, 1079);
                   	if(listitem == 7) return AddVehicleComponent(vehicleid, 1080);
                   	if(listitem == 8) return AddVehicleComponent(vehicleid, 1081);
                   	if(listitem == 9) return AddVehicleComponent(vehicleid, 1082);
                    if(listitem == 10) return AddVehicleComponent(vehicleid, 1083);
                    if(listitem == 11) return AddVehicleComponent(vehicleid, 1084);
                    if(listitem == 12) return AddVehicleComponent(vehicleid, 1085);
                    if(listitem == 13) return AddVehicleComponent(vehicleid, 1096);
                    if(listitem == 14) return AddVehicleComponent(vehicleid, 1097);
                    if(listitem == 15) return AddVehicleComponent(vehicleid, 1098);
                }
             }
            return 1;
        }

//Command;

CMD:awheels(playerid, params[])
{
    if(GetAdminLevel(playerid)>= 1 || IsPlayerAdmin(playerid))
	{
		if(IsPlayerInAnyVehicle(playerid))
 		{
    		ShowPlayerDialog(playerid, Menu, DIALOG_STYLE_LIST, "Admin Wheels System", "Shadow\nMega\nRimshine\nWires\nClassic\nTwist\nCutter\nSwitch\nGrove\nImport\nDollar\nTrance\nAtomic\nAhab\nVirtual\nAccess", "Ok", "Exit");
   		}
   		else
    	{
  			SendClientMessage(playerid, -1, "{F23A0D}ERROR: {AAAAAA}You need to be in a vehcile to use this command!");
    	}
	}
	else
 	{
  		SendClientMessage(playerid, -1, NO_PERM);
	}
    return 1;
}
Reply
#2

PHP код:
#define     Menu 8898
       
if(dialogid == Menu)
       {
               new 
vehicleid GetPlayerVehicleID(playerid);
            if(
response == 0)
            {
                
SendClientMessage(playerid0xFF0000FF"{AAAAAA}You cancelled.");
                return 
1;
            }
            if(
response == 1)
             {
                  if(
IsPlayerInVehicle(playerid))
                {
                      if(
listitem == 0AddVehicleComponent(vehicleid1073);
                       else if(
listitem == 1AddVehicleComponent(vehicleid1074);
                      else if(
listitem == 2AddVehicleComponent(vehicleid1075);
                     else if(
listitem == 3AddVehicleComponent(vehicleid1076);
                       else if(
listitem == 4AddVehicleComponent(vehicleid1077);
                     else if(
listitem == 5AddVehicleComponent(vehicleid1078);
                      else if(
listitem == 6AddVehicleComponent(vehicleid1079);
                       else if(
listitem == 7AddVehicleComponent(vehicleid1080);
                       else if(
listitem == 8AddVehicleComponent(vehicleid1081);
                       else if(
listitem == 9AddVehicleComponent(vehicleid1082);
                    else if(
listitem == 10AddVehicleComponent(vehicleid1083);
                    else if(
listitem == 11AddVehicleComponent(vehicleid1084);
                    else if(
listitem == 12AddVehicleComponent(vehicleid1085);
                    else if(
listitem == 13AddVehicleComponent(vehicleid1096);
                    else if(
listitem == 14AddVehicleComponent(vehicleid1097);
                    else if(
listitem == 15AddVehicleComponent(vehicleid1098);
                }
            }
        }
CMD:awheels(playeridparams[])
{
    if(
GetAdminLevel(playerid)>= || IsPlayerAdmin(playerid))
    {
        if(
IsPlayerInAnyVehicle(playerid))
         {
            
ShowPlayerDialog(playeridMenuDIALOG_STYLE_LIST"Admin Wheels System""Shadow\nMega\nRimshine\nWires\nClassic\nTwist\nCutter\nSwitch\nGrove\nImport\nDollar\nTrance\nAtomic\nAhab\nVirtual\nAccess""Ok""Exit");
           }
           else
        {
              
SendClientMessage(playerid, -1"{F23A0D}ERROR: {AAAAAA}You need to be in a vehcile to use this command!");
        }
    }
    else
     {
          
SendClientMessage(playerid, -1NO_PERM);
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)