27.11.2011, 15:53
Hello.
Today i made a script to tune cars. With dialogs, but they don't work. Non of then. If i do /tuning, the first dialog opens (with nitro, velgen). If i choose a option, nothing happens. Can anyone fix this?
Code:
Today i made a script to tune cars. With dialogs, but they don't work. Non of then. If i do /tuning, the first dialog opens (with nitro, velgen). If i choose a option, nothing happens. Can anyone fix this?
Code:
Code:
#include a_samp #define COLOR_MGREEN 0xFF0000AA public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/tuning", true)==0) { ShowPlayerDialog(playerid, 700, DIALOG_STYLE_LIST, "Tuning Menu","Nitro\nHydraulics\nVelgen\nKleuren", "Kies", "Annuleren"); return 1; } return 0; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid==700 && response==1) { switch(listitem) { case 0: { ShowPlayerDialog(playerid, 701, DIALOG_STYLE_LIST, "Tuning Menu","2x Nitro\n5x Nitro\n10xNitro", "Kies", "Annuleren"); return 1; } case 1: { ShowPlayerDialog(playerid, 702, DIALOG_STYLE_LIST, "Tuning Menu","Hydraulics\nVerwijder Hydraulics", "Kies", "Annuleren"); return 1; } case 2: { ShowPlayerDialog(playerid, 703, DIALOG_STYLE_LIST, "Tuning Menu","Offroad\nShadow\nMega\nRimshine\nWires\nClassic\nTwist\nCutter\nSwitch\nGrove\nImport\nDollar\nTrance\nAtomic\nAhab\nVirtual\nAccess\n", "Kies", "Annuleren"); return 1; } case 3: { ShowPlayerDialog(playerid, 704, DIALOG_STYLE_LIST, "Tuning Menu","Zwart\nWit\nRood\nGeel\nBlauw\nGroen\nPaars\nBruin", "Kies", "Annuleren"); return 1; } } } if(dialogid==701 && response==1) { switch(listitem) { case 0: { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1009); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] 2x Nitro geinstaleerd"); return 1; } case 1: { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1008); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] 5x Nitro geinstaleerd"); return 1; } case 2: { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1010); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] 10x Nitro geinstaleerd"); return 1; } } } if(dialogid==702 && response==1) { switch(listitem) { case 0: { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1087); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] Hydraulics geinstaleerd"); return 1; } case 1: { RemoveVehicleComponent(1,1087); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] Hydraulics gedeinstaleerd"); return 1; } } } if(dialogid==703 && response==1) { switch(listitem) { case 0: { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1025); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] Offroad geinstaleerd"); return 1; } case 1: { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1073); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] Shadow Velgen geinstaleerd"); return 1; } case 2: { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1074); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] Mega Velgen geinstaleerd"); return 1; } case 3: { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1075); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] Rimshine Velgen geinstaleerd"); return 1; } case 4: { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1076); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] Wires Velgen geinstaleerd"); return 1; } case 5: { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1077); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] Classic Velgen geinstaleerd"); return 1; } case 6: { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1078); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] Twist Velgen geinstaleerd"); return 1; } case 7: { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1079); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] Cutter Velgen geinstaleerd"); return 1; } case 8: { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1080); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] Switch Velgen geinstaleerd"); return 1; } case 9: { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1081); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] Grove Velgen geinstaleerd"); return 1; } case 10: { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1082); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] Import Velgen geinstaleerd"); return 1; } case 11: { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1083); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] Dollar Velgen geinstaleerd"); return 1; } case 12: { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1084); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] Trance Velgen geinstaleerd"); return 1; } case 13: { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1085); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] Atomic Velgen geinstaleerd"); return 1; } case 14: { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1096); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] Ahab Velgen geinstaleerd"); return 1; } case 15: { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1097); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] Virtual Velgen geinstaleerd"); return 1; } case 16: { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1098); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] Acces Velgen geinstaleerd"); return 1; } } } if(dialogid==704 && response==1) { switch(listitem) { case 0: { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); ChangeVehicleColor(vehicleid, 0, 0); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] Auto-respray: Zwart"); return 1; } case 1: { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); ChangeVehicleColor(vehicleid, 1, 1); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] Auto-respray: Wit"); return 1; } case 2: { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); ChangeVehicleColor(vehicleid, 3, 3); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] Auto-respray: Rood"); return 1; } case 3: { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); ChangeVehicleColor(vehicleid, 6, 6); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] Auto-respray: Geel"); return 1; } case 4: { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); ChangeVehicleColor(vehicleid, 125, 125); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] Auto-respray: Blauw"); return 1; } case 5: { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); ChangeVehicleColor(vehicleid, 149, 149); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] Auto-respray: Paars"); return 1; } case 6: { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); ChangeVehicleColor(vehicleid, 126, 126); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] Auto-respray: Roze"); return 1; } case 7: { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); ChangeVehicleColor(vehicleid, 66, 66); SendClientMessage(playerid,COLOR_MGREEN,"[TUNING] Auto-respray: Bruin"); return 1; } } } return 0; }