[FilterScript] Car Neon Tuning
#1

Car Neon Tuning V 1.1

Hello SA-MP Community!
I tried my hand at scripting,and this is my first released FS on SA-MP forum.
Features:
Well,you can tune your car with neon lights,but also,seeing as this may not work on some vehicles,I made it available for vehicles that support it.
As I said,this is my first (released)FS,so,please,refrain from comments "Too simple" etc. Although,I would appreciate criticism,so I can see where I can improve.
PHP Code:
#include <a_samp>
#include <dini>
#define DIALOG_TUNING 64
#define COLOUR_RED 0xFF00FFFF
#define COLOUR_WHITE 0xFFFFFFFF
new Float:pxFloat:pyFloat:pzFloat:prxFloat:pryFloat:prz;
new 
Float:xFloat:yFloat:zFloat:z_angle;
new 
vehicleidVehicleObject[15];
stock _AttachObjectToVehicle(objectidvehidFloat:oxFloat:oyFloat:ozFloat:rox=0.0Float:roy=0.0Float:roz=0.0)
{
    
AttachObjectToVehicle(objectidvehidoxoyoz0.00.00.0);
    
#pragma unused rox
    #pragma unused roy
    #pragma unused roz
}
#define AttachObjectToVehicle _AttachObjectToVehicle
public OnPlayerCommandText(playeridcmdtext[])
{
 if(!
strcmp("/neontuning"cmdtext)) 
 {
    if(!
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playeridCOLOUR_RED"You are not in a vehicle"); 
    switch(
GetVehicleModel(GetPlayerVehicleID(playerid)))
    {
      case 
445,602,429,496,504,401,518,402,541,527,415,542,589,507,562,585,419,526,466,492,474,494,502,503,411,546,559,551,516,467,603,426,436,547,405,580,560,550,506,549,451,558,540,491,421,477,529:
       {
       
ShowPlayerDialog(playerid,DIALOG_TUNING,DIALOG_STYLE_LIST,"Tuning","\n1.Red\n2.Blue\n3.Green\n4.Yellow\n5.Pink\n6.White","Select","Exit");
       }
       default: return 
SendClientMessage(playeridCOLOUR_RED"You are not in a tunable vehicle");
    }
    return 
1;
 }
 return 
0;
}
public 
OnDialogResponse(playeriddialogidresponselistitem)
{
    if(
dialogid == DIALOG_TUNING && response)
    {
        switch(
listitem)
        {
            case 
1:
            {
                
GetVehiclePos(vehicleid,Float:x,Float:y,Float:z);
                
GetVehicleZAngle(vehicleid,Float:z_angle);
                
VehicleObject[1] = CreateObject(18647,px,py,pz,prx,pry,prz,10);
                
VehicleObject[2] = CreateObject(18647,px,py,pz,prx,pry,prz,10);
                
AttachObjectToVehicle(VehicleObject[1],vehicleid,0.90040.1164, -0.4655,0);
                
AttachObjectToVehicle(VehicleObject[2],vehicleid,-0.87060.0570, -0.4655,0);
                
GivePlayerMoney(playerid,-1500);
                
SendClientMessage(playerid,0x83BFBFAA,"You succesfully added neon to your car!");
            }
            case 
2:
            {
                
GetVehiclePos(vehicleid,Float:x,Float:y,Float:z);
                
GetVehicleZAngle(vehicleid,Float:z_angle);
                
VehicleObject[3] = CreateObject(18648,px,py,pz,prx,pry,prz,10);
                
VehicleObject[4] = CreateObject(18648,px,py,pz,prx,pry,prz,10);
                
AttachObjectToVehicle(VehicleObject[3],vehicleid,0.90040.1164, -0.4655,0);
                
AttachObjectToVehicle(VehicleObject[4],vehicleid,-0.87060.0570, -0.4655,0);
                
GivePlayerMoney(playerid,-1500);
                
SendClientMessage(playerid,0x83BFBFAA,"You succesfully added neon to your car!");
            }
            case 
3:
            {
                
GetVehiclePos(vehicleid,Float:x,Float:y,Float:z);
                
GetVehicleZAngle(vehicleid,Float:z_angle);
                
VehicleObject[5] = CreateObject(18649,px,py,pz,prx,pry,prz,10);
                
VehicleObject[6] = CreateObject(18649,px,py,pz,prx,pry,prz,10);
                
AttachObjectToVehicle(VehicleObject[5],vehicleid,0.90040.1164, -0.4655,0);
                
AttachObjectToVehicle(VehicleObject[6],vehicleid,-0.87060.0570, -0.4655,0);
                
GivePlayerMoney(playerid,-1500);
                
SendClientMessage(playerid,0x83BFBFAA,"You succesfully added neon to your car!");
            }
            case 
4:
            {
                
GetVehiclePos(vehicleid,Float:x,Float:y,Float:z);
                
GetVehicleZAngle(vehicleid,Float:z_angle);
                
VehicleObject[7] = CreateObject(18650,px,py,pz,prx,pry,prz,10);
                
VehicleObject[8] = CreateObject(18650,px,py,pz,prx,pry,prz,10);
                
AttachObjectToVehicle(VehicleObject[7],vehicleid,0.90040.1164, -0.4655,0);
                
AttachObjectToVehicle(VehicleObject[8],vehicleid,-0.87060.0570, -0.4655,0);
                
GivePlayerMoney(playerid,-1500);
                
SendClientMessage(playerid,0x83BFBFAA,"You succesfully added neon to your car!");
            }
            case 
5:
            {
                
GetVehiclePos(vehicleid,Float:x,Float:y,Float:z);
                
GetVehicleZAngle(vehicleid,Float:z_angle);
                
VehicleObject[9] = CreateObject(18651,px,py,pz,prx,pry,prz,10);
                
VehicleObject[10] = CreateObject(18651,px,py,pz,prx,pry,prz,10);
                
AttachObjectToVehicle(VehicleObject[9],vehicleid,0.90040.1164, -0.4655,0);
                
AttachObjectToVehicle(VehicleObject[10],vehicleid,-0.87060.0570, -0.4655,0);
                
GivePlayerMoney(playerid,-1500);
                
SendClientMessage(playerid,0x83BFBFAA,"You succesfully added neon to your car!");
            }
            case 
6:
            {
                
GetVehiclePos(vehicleid,Float:x,Float:y,Float:z);
                
GetVehicleZAngle(vehicleid,Float:z_angle);
                
VehicleObject[11] = CreateObject(18652,px,py,pz,prx,pry,prz,10);
                
VehicleObject[12] = CreateObject(18652,px,py,pz,prx,pry,prz,10);
                
AttachObjectToVehicle(VehicleObject[11],vehicleid,0.90040.1164, -0.4655,0);
                
AttachObjectToVehicle(VehicleObject[12],vehicleid,-0.87060.0570, -0.4655,0);
                
GivePlayerMoney(playerid,-1500);
                
SendClientMessage(playerid,0x83BFBFAA,"You succesfully added neon to your car!");
            }
        }
    }
    return 
0;

If you spot any bugs,post it bellow.
UPDATE:Added the cost for neon installing(1.5k)
Reply
#2

Ok, its cool! But pics, vid? And where the heck is "Remove" option
Reply
#3

Remove option is in progress
About the pics,they are comming too
Reply
#4

Great work!
Reply
#5

Nice work, but I think need this code:
+

PHP Code:
GivePlayerMoney(playerid, -CASH); 
Reply
#6

Quote:
Originally Posted by skaTim
View Post
Great work!
Thanks )

Quote:
Originally Posted by ZAM
View Post
Nice work, but I think need this code:
+

PHP Code:
GivePlayerMoney(playerid, -CASH); 
I`m on it!
Reply
#7

Quote:
Originally Posted by AleXandeR[SRB]
View Post
I`m on it!
Just define it
pawn Code:
#define CASH 50000

// On Your Code
GivePlayerMoney(playerid, -CASH);
Reply
#8

Nice
Reply
#9

If the remove process is out, please PM me.
Reply
#10

nice
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)