Problem With Simple Neons
#1

i have made below code of neons with simple variables but problem it that when i add neon and then remove it and now again if i add neon they are not attached with vehicle please help??

pawn Код:
#define FILTERSCRIPT
#define COLOR_WHITE 0xFFFFFFAA
#include <a_samp>
#define NEON 1166
#if defined FILTERSCRIPT
#include <zcmd>
new Blue, Blue1;
public OnFilterScriptInit()
{
    Blue = CreateObject(18648,0,0,0,0,0,0,0.0);
    Blue1 = CreateObject(18648,0,0,0,0,0,0,0.0);
    return 1;
}
#endif
CMD:neon(playerid, params[])
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
            {
                SendClientMessage(playerid, COLOR_WHITE, "You are not the driver");
                return 1;
            }
            ShowPlayerDialog(playerid, NEON, DIALOG_STYLE_LIST, "Choose your neon colour","Blue\nTurn off Neon","Add","Close");
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, " You are not in a vehicle");
        }
        return 1;
    }

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == NEON)
    {
        if(response)
        {
            if(listitem == 0)
            {
                AttachObjectToVehicle(Blue, GetPlayerVehicleID(playerid), -0.9055, -0.1298, -0.46, 0.0, 0.0, 0.00);
                AttachObjectToVehicle(Blue1, GetPlayerVehicleID(playerid), 0.7705, -0.1172, -0.46, 0.0, 0.0, 0.00);
                GameTextForPlayer(playerid, "~b~ Blue ~w~Neon has been added to your vehicle",3500,5);
            }
            if(listitem == 1)
            {
                DestroyObject(Blue);
                DestroyObject(Blue1);
                GameTextForPlayer(playerid, "~g~Neon was deleted from your vehicle",3500,5);
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
Problem With Simple Neons - by shaikh007 - 13.09.2011, 06:27
Re: Problem With Simple Neons - by [MG]Dimi - 13.09.2011, 07:54

Forum Jump:


Users browsing this thread: 1 Guest(s)