Neon bug -.- [rep+1]
#1

Hey guys..
i've made neon system so when you type /neon you choose wut color you want. and it works fine
i 've got removeneon in /neon menu and it works fine too after 1-2 hours when all players (30-40) get neons and u need new car u type example /car elegy and it spawns with neons? watta f is?
thanks
Repping +1!
___________________
IP : 188.40.57.132:7777
Drift - Generation
Reply
#2

Show me Your Code?
Reply
#3

Save neons per vehicleid, then when vehicle is spawned, destroy these neons.
Reply
#4

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp(cmdtext, "/neon", true)==0)
    {
    if(IsPlayerInAnyVehicle(playerid))
    {
    ShowPlayerDialog(playerid, neondialog, DIALOG_STYLE_LIST, "{00FFFF}Drift Generation {FF0000}Neon {00FF73}Garage{FFFFFF}", "Blue\nRed\nGreen\nWhite\nPink\nYellow\nRemove Neon", "Select", "Cancel");
    SendClientMessage(playerid, 0xFFFFFFAA, "With selecting neon automatically will set your time at 0 o'clock!");
    }
    return 1;
    }
    return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{

    if(dialogid == neondialog)
    {
        if(response)
        {
            if(listitem == 0)
            {
                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);
                SendClientMessage(playerid, 0xFFFFFFAA, "Neon installed");
                SetPlayerTime(playerid,0,0);
            }
            if(listitem == 1)
            {
                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");
                SetPlayerTime(playerid,0,0);

            }
            if(listitem == 2)
            {
                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");
                SetPlayerTime(playerid,0,0);

                }
            if(listitem == 3)
            {
                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");
                SetPlayerTime(playerid,0,0);

            }
            if(listitem == 4)
            {
                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");
                SetPlayerTime(playerid,0,0);

            }
            if(listitem == 5)
            {
                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");
                SetPlayerTime(playerid,0,0);

            }
   if(listitem == 6){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, "neon13"));
            DeletePVar(playerid, "Status");
            SetPlayerTime(playerid,13,0);
            }
        }
    }
    return 0;
}
    public OnPlayerConnect()
        {
        new playerid;
        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, "neon13"));
            DeletePVar(playerid, "Status");
        return 1;
        }
        public OnPlayerSpawn(playerid)
{
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, "neon13"));
            DeletePVar(playerid, "Status");
    return 1;
}
Reply
#5

Quote:
Originally Posted by costel_nistor96
Посмотреть сообщение
Save neons per vehicleid, then when vehicle is spawned, destroy these neons.
i make this when player spawn but how about ur idea? HELP!
Reply
#6

Код:
new Neon[ MAX_VEHICLES ] = { -1, ... };

CMD:neon( playerid, params[ ] )
{
    Neon[ GetPlayerVehicleID( playerid ) ] = CreateObject( ... );
    AttachObjectToVehicle( Neon[ GetPlayerVehicleID( playerid ) ] ), GetPlayerVehicleID( playerid ), ... );
    return 1;
}

public OnVehicleSpawn( vehicleid )
{
    if( Neon[ vehicleid ] != -1 )
        DestroyObject( Neon[ vehicleid ] ), Neon[ vehicleid ] = -1;

    return 1;
}
If you want more neons per vehicle, use Neon[ vehicleid ][ 0, 1, 2, 3 ... ] and variable as new Neon[ MAX_VEHICLES ][ How_many_neons ].

I hope you get it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)