One question... - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: One question... (
/showthread.php?tid=153711)
One question... -
Libra - 10.06.2010
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);
Re: One question... -
DJDhan - 10.06.2010
Код:
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!");
}