SA-MP Forums Archive
Bug neon - 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)
+--- Thread: Bug neon (/showthread.php?tid=513602)



Bug neon - Madalyinn - 17.05.2014

I have a problem to command /neon. When writing neon says installed, but not working.

http://s29.postimg.org/wwcgumtzr/sa_mp_049.png


I can help me ?


Re: Bug neon - Threshold - 17.05.2014

Are you sure it's not installing? Note that it must be night time/dark for you to be able to see neon. It will not work in the day.


Re: Bug neon - Madalyinn - 17.05.2014

Yes I selected a time that we can see


Re: Bug neon - Threshold - 17.05.2014

Well, a good start would be showing us the /neon command.


Re: Bug neon - Madalyinn - 17.05.2014

pawn Код:
//-------------------------------[NEON]--------------------------------------------
if(strcmp(cmdtext, "/neon", true) == 0)
    {
    if(IsPlayerInRangeOfPoint(playerid, 3.0, 1097.5781,-1188.2579,18.3388))
        {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
          if(PlayerInfo[playerid][pNfs] > 0)
            {
                ShowPlayerDialog(playerid, 8899, DIALOG_STYLE_LIST, "Pick neon color", "Neon: Blue, Cost: 5.000$\nNeon: Red, Cost: 5.000$\nNeon: Green, Cost: 5.000$\nNeon: White, Cost: 5.000$\nNeon: Pink, Cost: 5.000$\nNeon: Yellow, Cost: 5.000$\nRemove All Neon, Cost: 10.000$", "Select", "Cancel");
                PlayerPlaySound(playerid, 1133, 0.0, 0.0, 10.0);
            }
          else SendClientMessage(playerid, COLOR_GREY, "You are not a NFS Club member!");
        }
        else SendClientMessage(playerid, COLOR_GREY, "You are not driving any vehicle!");
        }
        return 1;
    }



Re: Bug neon - morha12 - 17.05.2014

Quote:
Originally Posted by Madalyinn
Посмотреть сообщение
pawn Код:
//-------------------------------[NEON]--------------------------------------------
if(strcmp(cmdtext, "/neon", true) == 0)
    {
    if(IsPlayerInRangeOfPoint(playerid, 3.0, 1097.5781,-1188.2579,18.3388))
        {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
          if(PlayerInfo[playerid][pNfs] > 0)
            {
                ShowPlayerDialog(playerid, 8899, DIALOG_STYLE_LIST, "Pick neon color", "Neon: Blue, Cost: 5.000$\nNeon: Red, Cost: 5.000$\nNeon: Green, Cost: 5.000$\nNeon: White, Cost: 5.000$\nNeon: Pink, Cost: 5.000$\nNeon: Yellow, Cost: 5.000$\nRemove All Neon, Cost: 10.000$", "Select", "Cancel");
                PlayerPlaySound(playerid, 1133, 0.0, 0.0, 10.0);
            }
          else SendClientMessage(playerid, COLOR_GREY, "You are not a NFS Club member!");
        }
        else SendClientMessage(playerid, COLOR_GREY, "You are not driving any vehicle!");
        }
        return 1;
    }
Where is the line that should add the neon light?

Post the script of dialog 8899


Re: Bug neon - Threshold - 17.05.2014

Okay, show us OnDialogResponse for dialogid 8899. (Please don't post your whole OnDialogResponse, we only need dialog id 8899..)

This forum requires that you wait 120 seconds between posts. Please try again in 25 seconds.

I swear I posted this? 0_o


Re: Bug neon - Madalyinn - 17.05.2014

pawn Код:
if(dialogid == 8899)
    {
        if(response)
        {
            if(listitem == 0)
            {
                // Blue
                SetPVarInt(playerid, "Status", 1);
                SetPVarInt(playerid, "neon1", CreateDynamicObject(18648,0,0,0,0,0,0));
                SetPVarInt(playerid, "neon2", CreateDynamicObject(18648,0,0,0,0,0,0));
                AttachObjectToVehicle(GetPVarInt(playerid, "neon1"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                AttachObjectToVehicle(GetPVarInt(playerid, "neon2"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                SendClientMessage(playerid, COLOR_GREY, "Neon Shop: Blue neon installed!");
                GivePlayerMoney(playerid, - 5000);
                GameTextForPlayer(playerid, "~w~-~r~5.000~g~$", 5000, 1);
            }
            if(listitem == 1)
            {
                // Red
                SetPVarInt(playerid, "Status", 1);
                SetPVarInt(playerid, "neon3", CreateDynamicObject(18647,0,0,0,0,0,0));
                SetPVarInt(playerid, "neon4", CreateDynamicObject(18647,0,0,0,0,0,0));
                AttachObjectToVehicle(GetPVarInt(playerid, "neon3"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                AttachObjectToVehicle(GetPVarInt(playerid, "neon4"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                SendClientMessage(playerid, COLOR_GREY, "Neon Shop: Red neon installed!");
                GivePlayerMoney(playerid, - 5000);
                GameTextForPlayer(playerid, "~w~-~r~5.000~g~$", 5000, 1);
            }
            if(listitem == 2)
            {
                // Green
                SetPVarInt(playerid, "Status", 1);
                SetPVarInt(playerid, "neon5", CreateDynamicObject(18649,0,0,0,0,0,0));
                SetPVarInt(playerid, "neon6", CreateDynamicObject(18649,0,0,0,0,0,0));
                AttachObjectToVehicle(GetPVarInt(playerid, "neon5"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                AttachObjectToVehicle(GetPVarInt(playerid, "neon6"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                SendClientMessage(playerid, COLOR_GREY, "Neon Shop: Green neon installed!");
                GivePlayerMoney(playerid, - 5000);
                GameTextForPlayer(playerid, "~w~-~r~5.000~g~$", 5000, 1);
            }
            if(listitem == 3)
            {
                // White
                SetPVarInt(playerid, "Status", 1);
                SetPVarInt(playerid, "neon7", CreateDynamicObject(18652,0,0,0,0,0,0));
                SetPVarInt(playerid, "neon8", CreateDynamicObject(18652,0,0,0,0,0,0));
                AttachObjectToVehicle(GetPVarInt(playerid, "neon7"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                AttachObjectToVehicle(GetPVarInt(playerid, "neon8"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                SendClientMessage(playerid, COLOR_GREY, "Neon Shop: White neon installed!");
                GivePlayerMoney(playerid, - 5000);
                GameTextForPlayer(playerid, "~w~-~r~5.000~g~$", 5000, 1);
            }
            if(listitem == 4)
            {
                // Pink
                SetPVarInt(playerid, "Status", 1);
                SetPVarInt(playerid, "neon9", CreateDynamicObject(18651,0,0,0,0,0,0));
                SetPVarInt(playerid, "neon10", CreateDynamicObject(18651,0,0,0,0,0,0));
                AttachObjectToVehicle(GetPVarInt(playerid, "neon9"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                AttachObjectToVehicle(GetPVarInt(playerid, "neon10"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                SendClientMessage(playerid, COLOR_GREY, "Neon Shop: Pink neon installed!");
                GivePlayerMoney(playerid, - 5000);
                GameTextForPlayer(playerid, "~w~-~r~5.000~g~$", 5000, 1);
            }
            if(listitem == 5)
            {
                // Yellow
                SetPVarInt(playerid, "Status", 1);
                SetPVarInt(playerid, "neon11", CreateDynamicObject(18650,0,0,0,0,0,0));
                SetPVarInt(playerid, "neon12", CreateDynamicObject(18650,0,0,0,0,0,0));
                AttachObjectToVehicle(GetPVarInt(playerid, "neon11"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                AttachObjectToVehicle(GetPVarInt(playerid, "neon12"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                SendClientMessage(playerid, COLOR_GREY, "Neon Shop: Yellow neon installed!");
                GivePlayerMoney(playerid, - 5000);
                GameTextForPlayer(playerid, "~w~-~r~5.000~g~$", 5000, 1);
            }
            if(listitem == 6)
            {
                // Removed Neon
                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");
                SendClientMessage(playerid, COLOR_GREY, "Neon Shop: All neon removed!");
                GivePlayerMoney(playerid, - 10000);
                GameTextForPlayer(playerid, "~w~-~r~10.000~g~$", 5000, 1);
            }
        }
    }



Re: Bug neon - Threshold - 17.05.2014

pawn Код:
if(dialogid == 8899)
    {
        if(response)
        {
            switch(listitem)
            {
                case 0:
                {
                    // Blue
                    if(Neon[playerid][0] != INVALID_OBJECT_ID) DestroyObject(Neon[playerid][0]);
                    if(Neon[playerid][1] != INVALID_OBJECT_ID) DestroyObject(Neon[playerid][1]);
                    AttachObjectToVehicle((Neon[playerid][0] = CreateDynamicObject(18648,0,0,0,0,0,0)), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                    AttachObjectToVehicle((Neon[playerid][1] = CreateDynamicObject(18648,0,0,0,0,0,0)), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                    SendClientMessage(playerid, COLOR_GREY, "Neon Shop: Blue neon installed!");
                    GivePlayerMoney(playerid, -5000);
                    GameTextForPlayer(playerid, "~w~-~r~5.000~g~$", 5000, 1);
                }
                case 1:
                {
                    // Red
                    if(Neon[playerid][0] != INVALID_OBJECT_ID) DestroyObject(Neon[playerid][0]);
                    if(Neon[playerid][1] != INVALID_OBJECT_ID) DestroyObject(Neon[playerid][1]);
                    AttachObjectToVehicle((Neon[playerid][0] = CreateDynamicObject(18647,0,0,0,0,0,0)), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                    AttachObjectToVehicle((Neon[playerid][1] = CreateDynamicObject(18647,0,0,0,0,0,0)), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                    SendClientMessage(playerid, COLOR_GREY, "Neon Shop: Red neon installed!");
                    GivePlayerMoney(playerid, -5000);
                    GameTextForPlayer(playerid, "~w~-~r~5.000~g~$", 5000, 1);
                }
                case 2:
                {
                    // Green
                    if(Neon[playerid][0] != INVALID_OBJECT_ID) DestroyObject(Neon[playerid][0]);
                    if(Neon[playerid][1] != INVALID_OBJECT_ID) DestroyObject(Neon[playerid][1]);
                    AttachObjectToVehicle((Neon[playerid][0] = CreateDynamicObject(18649,0,0,0,0,0,0)), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                    AttachObjectToVehicle((Neon[playerid][1] = CreateDynamicObject(18649,0,0,0,0,0,0)), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                    SendClientMessage(playerid, COLOR_GREY, "Neon Shop: Green neon installed!");
                    GivePlayerMoney(playerid, -5000);
                    GameTextForPlayer(playerid, "~w~-~r~5.000~g~$", 5000, 1);
                }
                case 3:
                {
                    // White
                    if(Neon[playerid][0] != INVALID_OBJECT_ID) DestroyObject(Neon[playerid][0]);
                    if(Neon[playerid][1] != INVALID_OBJECT_ID) DestroyObject(Neon[playerid][1]);
                    AttachObjectToVehicle((Neon[playerid][0] = CreateDynamicObject(18652,0,0,0,0,0,0)), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                    AttachObjectToVehicle((Neon[playerid][1] = CreateDynamicObject(18652,0,0,0,0,0,0)), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                    SendClientMessage(playerid, COLOR_GREY, "Neon Shop: White neon installed!");
                    GivePlayerMoney(playerid, -5000);
                    GameTextForPlayer(playerid, "~w~-~r~5.000~g~$", 5000, 1);
                }
                case 4:
                {
                    // Pink
                    if(Neon[playerid][0] != INVALID_OBJECT_ID) DestroyObject(Neon[playerid][0]);
                    if(Neon[playerid][1] != INVALID_OBJECT_ID) DestroyObject(Neon[playerid][1]);
                    AttachObjectToVehicle((Neon[playerid][0] = CreateDynamicObject(18651,0,0,0,0,0,0)), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                    AttachObjectToVehicle((Neon[playerid][1] = CreateDynamicObject(18651,0,0,0,0,0,0)), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                    SendClientMessage(playerid, COLOR_GREY, "Neon Shop: Pink neon installed!");
                    GivePlayerMoney(playerid, -5000);
                    GameTextForPlayer(playerid, "~w~-~r~5.000~g~$", 5000, 1);
                }
                case 5:
                {
                    // Yellow
                    if(Neon[playerid][0] != INVALID_OBJECT_ID) DestroyObject(Neon[playerid][0]);
                    if(Neon[playerid][1] != INVALID_OBJECT_ID) DestroyObject(Neon[playerid][1]);
                    AttachObjectToVehicle((Neon[playerid][0] = CreateDynamicObject(18650,0,0,0,0,0,0)), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                    AttachObjectToVehicle((Neon[playerid][1] = CreateDynamicObject(18650,0,0,0,0,0,0)), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                    SendClientMessage(playerid, COLOR_GREY, "Neon Shop: Yellow neon installed!");
                    GivePlayerMoney(playerid, -5000);
                    GameTextForPlayer(playerid, "~w~-~r~5.000~g~$", 5000, 1);
                }
                case 6:
                {
                    // Removed Neon
                    if(Neon[playerid][0] == INVALID_OBJECT_ID && Neon[playerid][1] == INVALID_OBJECT_ID)
                        return SendClientMessage(playerid, COLOR_GREY, "Neon Shop: You currently have no neon installed.");
                    DestroyObject(Neon[playerid][0]);
                    DestroyObject(Neon[playerid][1]);
                    SendClientMessage(playerid, COLOR_GREY, "Neon Shop: All neon removed!");
                    GivePlayerMoney(playerid, -10000);
                    GameTextForPlayer(playerid, "~w~-~r~10.000~g~$", 5000, 1);
                }
            }
        }
        return 1;
    }
Add this to the top of your script under your defines and includes.
pawn Код:
new Neon[MAX_PLAYERS][2];



Re: Bug neon - Madalyinn - 17.05.2014

pawn Код:
C:\Documents and Settings\Madalin\Desktop\GM\gamemodes\Godfather.pwn(66523) : warning 203: symbol is never used: "Neon"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase

Header size:          11364 bytes
Code size:          2564260 bytes
Data size:          7159492 bytes
Stack/heap size:      16384 bytes; estimated max. usage: unknown, due to recursion
Total requirements: 9751500 bytes

1 Warning.