[Tutorial] Creating Simple Neon
#1

Hello sa-mp forum , meet me again hahaha

i want to show you how to create simple neon with simple script

First you must have zcmd and a_samp include
pawn Код:
#include <a_samp>
#include <zcmd>
and define for neon dialog
pawn Код:
#define NEONMENU 7
the command will make player able to create neon , /neon , will show the dialog for player for the neon
pawn Код:
CMD:neon(playerid,params[])
{
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
        ShowPlayerDialog(playerid, NEONMENU, DIALOG_STYLE_LIST, "Pick Neon Color", "Blue\nRed\nGreen\nWhite\nPink\nYellow\nPolice Strobe\nInterior Lights\nBack Neon\nFront neon\nUndercover Roof Light\nRemove All Neon", "Select", "Cancel");
}
else SendClientMessage(playerid, 0x00FFFFAA, "You Are Not Inside Vehicle");
return 1;
}
its for the dialog for the neon iam using switch so , you can change it as what you want
AttachObjectToVehicle will attach the object to the vehicle , setpvar will set player variable
Destroyobject will destroy the object neon on the vehicle and delete player variable
pawn Код:
case NEONMENU:
        {
        if(response)
        {
            if(listitem == 0)
            {
                //blue
                SetPVarInt(playerid, "Status", 1);
                SetPVarInt(playerid, "neon", CreateObject(18648,0,0,0,0,0,0));
                SetPVarInt(playerid, "neon1", CreateObject(18648,0,0,0,0,0,0));
                AttachObjectToVehicle(GetPVarInt(playerid, "neon"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                AttachObjectToVehicle(GetPVarInt(playerid, "neon1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
            }
            if(listitem == 1)
            {
                //red
                SetPVarInt(playerid, "Status", 1);
                SetPVarInt(playerid, "neon2", CreateObject(18647,0,0,0,0,0,0));
                SetPVarInt(playerid, "neon3", CreateObject(18647,0,0,0,0,0,0));
                AttachObjectToVehicle(GetPVarInt(playerid, "neon2"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                AttachObjectToVehicle(GetPVarInt(playerid, "neon3"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                SendClientMessage(playerid, 0xFFFFFFAA, "neon installed");
            }
            if(listitem == 2)

            {
                //green
                SetPVarInt(playerid, "Status", 1);
                SetPVarInt(playerid, "neon4", CreateObject(18649,0,0,0,0,0,0));
                SetPVarInt(playerid, "neon5", CreateObject(18649,0,0,0,0,0,0));
                AttachObjectToVehicle(GetPVarInt(playerid, "neon4"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                AttachObjectToVehicle(GetPVarInt(playerid, "neon5"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                SendClientMessage(playerid, 0xFFFFFFAA, "neon installed");
            }
            if(listitem == 3)

            {
                //white
                SetPVarInt(playerid, "Status", 1);
                SetPVarInt(playerid, "neon6", CreateObject(18652,0,0,0,0,0,0));
                SetPVarInt(playerid, "neon7", CreateObject(18652,0,0,0,0,0,0));
                AttachObjectToVehicle(GetPVarInt(playerid, "neon6"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                AttachObjectToVehicle(GetPVarInt(playerid, "neon7"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                SendClientMessage(playerid, 0xFFFFFFAA, "neon installed");
            }
            if(listitem == 4)
            {
                //pink
                SetPVarInt(playerid, "Status", 1);
                SetPVarInt(playerid, "neon8", CreateObject(18651,0,0,0,0,0,0));
                SetPVarInt(playerid, "neon9", CreateObject(18651,0,0,0,0,0,0));
                AttachObjectToVehicle(GetPVarInt(playerid, "neon8"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                AttachObjectToVehicle(GetPVarInt(playerid, "neon9"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                SendClientMessage(playerid, 0xFFFFFFAA, "neon installed");
            }
            if(listitem == 5)
            {
                //yellow
                SetPVarInt(playerid, "Status", 1);
                SetPVarInt(playerid, "neon10", CreateObject(18650,0,0,0,0,0,0));
                SetPVarInt(playerid, "neon11", CreateObject(18650,0,0,0,0,0,0));
                AttachObjectToVehicle(GetPVarInt(playerid, "neon10"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                AttachObjectToVehicle(GetPVarInt(playerid, "neon11"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                SendClientMessage(playerid, 0xFFFFFFAA, "neon installed");
            }
            if(listitem == 6)
            {
                //police
                SetPVarInt(playerid, "Status", 1);
                SetPVarInt(playerid, "neon12", CreateObject(18646,0,0,0,0,0,0));
                SetPVarInt(playerid, "neon13", CreateObject(18646,0,0,0,0,0,0));
                AttachObjectToVehicle(GetPVarInt(playerid, "neon12"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                AttachObjectToVehicle(GetPVarInt(playerid, "neon13"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                SendClientMessage(playerid, 0xFFFFFFAA, "neon installed");
            }
            if(listitem == 7)
            {
                SetPVarInt(playerid, "Status", 1);
                SetPVarInt(playerid, "interior", CreateObject(18646,0,0,0,0,0,0));
                SetPVarInt(playerid, "interior1", CreateObject(18646,0,0,0,0,0,0));
                AttachObjectToVehicle(GetPVarInt(playerid, "interior"), GetPlayerVehicleID(playerid), 0, -0.0, 0, 2.0, 2.0, 3.0);
                AttachObjectToVehicle(GetPVarInt(playerid, "interior1"), GetPlayerVehicleID(playerid), 0, -0.0, 0, 2.0, 2.0, 3.0);
                SendClientMessage(playerid, 0xFFFFFFAA, "Interior lights installed");
            }
            if(listitem == 8)
            {
                //back
                SetPVarInt(playerid, "Status", 1);
                SetPVarInt(playerid, "back", CreateObject(18646,0,0,0,0,0,0));
                SetPVarInt(playerid, "back1", CreateObject(18646,0,0,0,0,0,0));
                AttachObjectToVehicle(GetPVarInt(playerid, "back"), GetPlayerVehicleID(playerid), -0.0, -1.5, -1, 2.0, 2.0, 3.0);
                AttachObjectToVehicle(GetPVarInt(playerid, "back1"), GetPlayerVehicleID(playerid), -0.0, -1.5, -1, 2.0, 2.0, 3.0);
                SendClientMessage(playerid, 0xFFFFFFAA, "Back neon installed");
            }
            if(listitem == 9)
            {
                //front
                SetPVarInt(playerid, "Status", 1);
                SetPVarInt(playerid, "front", CreateObject(18646,0,0,0,0,0,0));
                SetPVarInt(playerid, "front1", CreateObject(18646,0,0,0,0,0,0));
                AttachObjectToVehicle(GetPVarInt(playerid, "front"), GetPlayerVehicleID(playerid), -0.0, 1.5, -0.6, 2.0, 2.0, 3.0);
                AttachObjectToVehicle(GetPVarInt(playerid, "front1"), GetPlayerVehicleID(playerid), -0.0, 1.5, -0.6, 2.0, 2.0, 3.0);
                SendClientMessage(playerid, 0xFFFFFFAA, "Front neon installed");
            }
            if(listitem == 10)
            {
                //undercover
                SetPVarInt(playerid, "Status", 1);
                SetPVarInt(playerid, "undercover", CreateObject(18646,0,0,0,0,0,0));
                SetPVarInt(playerid, "undercover1", CreateObject(18646,0,0,0,0,0,0));
                AttachObjectToVehicle(GetPVarInt(playerid, "undercover"), GetPlayerVehicleID(playerid), -0.5, -0.2, 0.8, 2.0, 2.0, 3.0);
                AttachObjectToVehicle(GetPVarInt(playerid, "undercover1"), GetPlayerVehicleID(playerid), -0.5, -0.2, 0.8, 2.0, 2.0, 3.0);
                SendClientMessage(playerid, 0xFFFFFFAA, "Undercover lights installed");
            }
            if(listitem == 11)
            {
                //remove neon
                DestroyObject(GetPVarInt(playerid, "neon"));
                DeletePVar(playerid, "Status");
                DestroyObject(GetPVarInt(playerid, "neon1"));
                DeletePVar(playerid, "Status");
                DestroyObject(GetPVarInt(playerid, "neon2"));
                DeletePVar(playerid, "Status");
                DestroyObject(GetPVarInt(playerid, "neon3"));
                DeletePVar(playerid, "Status");
                DestroyObject(GetPVarInt(playerid, "neon4"));
                DeletePVar(playerid, "Status");
                DestroyObject(GetPVarInt(playerid, "neon5"));
                DeletePVar(playerid, "Status");
                DestroyObject(GetPVarInt(playerid, "neon6"));
                DeletePVar(playerid, "Status");
                DestroyObject(GetPVarInt(playerid, "neon7"));
                DeletePVar(playerid, "Status");
                DestroyObject(GetPVarInt(playerid, "neon8"));
                DeletePVar(playerid, "Status");
                DestroyObject(GetPVarInt(playerid, "neon9"));
                DeletePVar(playerid, "Status");
                DestroyObject(GetPVarInt(playerid, "neon10"));
                DeletePVar(playerid, "Status");
                DestroyObject(GetPVarInt(playerid, "neon11"));
                DeletePVar(playerid, "Status");
                DestroyObject(GetPVarInt(playerid, "neon12"));
                DeletePVar(playerid, "Status");
                DestroyObject(GetPVarInt(playerid, "neon13"));
                DeletePVar(playerid, "Status");
                DestroyObject(GetPVarInt(playerid, "interior"));
                DeletePVar(playerid, "Status");
                DestroyObject(GetPVarInt(playerid, "interior1"));
                DeletePVar(playerid, "Status");
                DestroyObject(GetPVarInt(playerid, "back"));
                DeletePVar(playerid, "Status");
                DestroyObject(GetPVarInt(playerid, "back1"));
                DeletePVar(playerid, "Status");
                DestroyObject(GetPVarInt(playerid, "front"));
                DeletePVar(playerid, "Status");
                DestroyObject(GetPVarInt(playerid, "front1"));
                DeletePVar(playerid, "Status");
                DestroyObject(GetPVarInt(playerid, "undercover"));
                DeletePVar(playerid, "Status");
                DestroyObject(GetPVarInt(playerid, "undercover1"));

                DeletePVar(playerid, "Status");
                }
            }
        }
It working for me , if on you not working maybe you wrong on the tutorial try , yours i just give the method and the script you can use my script but , edit your own script , there's no bug
sorry for my bad english , hope you like it



Mine ,thats neon using this script , Correct me if i wrong
Reply
#2

1. didn't explain at ALL.
2. stop coping scripts (or) stealing
Reply
#3

Quote:
Originally Posted by newbie scripter
Посмотреть сообщение
1. didn't explain at ALL.
2. stop coping scripts (or) stealing
lol , i have a bad english i cant explait too much , you will confused with my english , and this my 100% work , i can release my Need for speed GM If i want but. i must complete it first
Reply
#4

nice
Reply
#5

sorry, i was confused that u didn't explain, so mostly some ppl will steal scripts and won't explain much here and say they made it to gain rep.

EDIT: even if u have bad english, try to explain with the english u know.
Reply
#6

Quote:
Originally Posted by newbie scripter
Посмотреть сообщение
sorry, i was confused that u didn't explain, so mostly some ppl will steal scripts and won't explain much here and say they made it to gain rep.

EDIT: even if u have bad english, try to explain with the english u know.
no , iam creating this script by myself btw , iam not stealer
Reply
#7

Be Carefull Yosep, another Script maybe have same code with your script. but nice
Reply
#8

Not much of a tutorial but good job.
Reply
#9

Quote:

CMD:neon(playerid,params[])
{
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
ShowPlayerDialog(playerid, NEONMENU, DIALOG_STYLE_LIST, "Pick Neon Color", "Blue\nRed\nGreen\nWhite\nPink\nYellow\nPolice Strobe\nInterior Lights\nBack Neon\nFront neon\nUndercover Roof Light\nRemove All Neon", "Select", "Cancel");
}
else SendClientMessage(playerid, 0x00FFFFAA, "You Are Not Inside Vehicle");
return 1;
}

You've added 2 checks that actually are valid both at the same time when the player is inside a vehicle as driver.

If the player is a driver, he's also automatically inside a vehicle, so no need to check for both.
You cannot have a state as driver when you're not inside a vehicle.
This will suffice:

pawn Код:
CMD:neon(playerid,params[])
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
        ShowPlayerDialog(playerid, NEONMENU, DIALOG_STYLE_LIST, "Pick Neon Color", "Blue\nRed\nGreen\nWhite\nPink\nYellow\nPolice Strobe\nInterior Lights\nBack Neon\nFront neon\nUndercover Roof Light\nRemove All Neon", "Select", "Cancel");
}
else SendClientMessage(playerid, 0x00FFFFAA, "You Are Not Inside Vehicle");
return 1;
}
Reply
#10

Quote:
Originally Posted by PowerPC603
Посмотреть сообщение
You've added 2 checks that actually are valid both at the same time when the player is inside a vehicle as driver.

If the player is a driver, he's also automatically inside a vehicle, so no need to check for both.
You cannot have a state as driver when you're not inside a vehicle.
This will suffice:

pawn Код:
CMD:neon(playerid,params[])
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
        ShowPlayerDialog(playerid, NEONMENU, DIALOG_STYLE_LIST, "Pick Neon Color", "Blue\nRed\nGreen\nWhite\nPink\nYellow\nPolice Strobe\nInterior Lights\nBack Neon\nFront neon\nUndercover Roof Light\nRemove All Neon", "Select", "Cancel");
}
else SendClientMessage(playerid, 0x00FFFFAA, "You Are Not Inside Vehicle");
return 1;
}
Oh thanks for your suggestion i will change it later
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)