SA-MP Forums Archive
[FilterScript] Tuning System - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Tuning System (/showthread.php?tid=501886)



Tuning System - sampplayer12 - 20.03.2014

I decided to release a tuning system, made from scratch by sampplayer12. Enjoy


PasteBin: http://pastebin.com/jSguXSGy


Re: Tuning System - NewerthRoleplay - 20.03.2014

It's pretty simple and could be improved since it's better practice to use switch and handle it that way rather than using an if statement each time:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 30000)
    {
        if(response)
        {
            switch(listitem)
            {
                case 0: {
                    AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
                    SendClientMessage(playerid,0xFF0606FF,"You Have Added 10x Nos Onto Your Vehicle");
                }
                case 1: {
                    AddVehicleComponent(GetPlayerVehicleID(playerid), 1079);
                    SendClientMessage(playerid,0xFF0606FF,"You Have Added Cutter Rims Onto Your Vehicle");
                }
                case 2: {
                    AddVehicleComponent(GetPlayerVehicleID(playerid), 1080);
                    SendClientMessage(playerid,0xFF0606FF,"You Have Added Golden Rims Onto Your Vehicle");
                }
                case 3: {
                    AddVehicleComponent(GetPlayerVehicleID(playerid), 1087);
                    SendClientMessage(playerid,0xFF0606FF,"You Have Added Hydraulics Onto Your Vehicle");
                }
            }
        }
        return 1;
    }
 
    return 0;
}