One question...
#1

So, this is a fragment of my script:

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == TUNINGMENU)
	{
		if(response)
		{
			if(listitem == 0) // Hydraulics
			{
			AddVehicleComponent(vehicle, 1087);
			SendClientMessage(playerid, COLOR_GREEN, "You have succesfully added Hydraulics to your vehicle!");
			}
And I need help... You can add hydraulics ONLY in vehicle IDs 511 and 512 (example)... How to make this:

Other ID:

Код:
SendClientMessage(playerid, COLOR_RED, "ERROR: You can't add hydraulics to this vehicle!");
True ID:

Код:
SendClientMessage(playerid, COLOR_GREY, "You have succesfully added hydraulics to your vehicle!");
AddVehicleComponent(vehicle, 1087);
Reply
#2

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == TUNINGMENU)
	{
		if(response)
		{
			if(listitem == 0) // Hydraulics
			{
                         new vehicle= GetPlayerVehicleID(playerid);
                         new model=GetVehicleModel(vehicle);
                         if(model!=511 || model!=512) return SendClientMessage(playerid,0x00ff00aa,"This car cannot be tuned.");
			      AddVehicleComponent(vehicle, 1087);
			      SendClientMessage(playerid, COLOR_GREEN, "You have succesfully added Hydraulics to your vehicle!");
			}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)