Invalid Function or Declaration
#1

This is my code

pawn Код:
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\nGreen\nYellow\nWhite\nPink\nTurn off Neon","Add","Close");
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "You are not in a vehicle");
        }
        return 1;
    }
    return 0;
}
.


This is the line that's acting like a hoe. ( It's the return 0; )
pawn Код:
}
    return 0;
}
Reply
#2

if you use zcmd you dont need to return 0; it so here you go

pawn Код:
CMD:neon(playerid, params[])
{
    if(!IsPlayerInAnyVehicle(playerid))
        return SendClientMessage(playerid, COLOR_WHITE, "You are not in a vehicle");
    if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
        return SendClientMessage(playerid, COLOR_WHITE, "You are not the driver");

    ShowPlayerDialog(playerid, NEON, DIALOG_STYLE_LIST, "Choose your neon colour","Blue\nGreen\nYellow\nWhite\nPink\nTurn off Neon","Add","Close");
    return 1;
}
Invalid Function or Declaration - extra brackets
Reply
#3

Okay. But, i go in-game, and when i type /neon and pick a color, it says it's applied, but i see no neon.

I think it may be related to my OnDialogResponse. Because, when i try to place the below under OnDialogResponse, my compiler crashes. It's hard to explain but, if you're interested, pm me and i'll send you my Team View ID + Pass.

pawn Код:
if(dialogid == NEON)
    {
        if(response)
        {
            if(listitem == 0)
            {
                SetPVarInt(playerid, "neon", 1);
                SetPVarInt(playerid, "blue", CreateObject(18648,0,0,0,0,0,0));
                SetPVarInt(playerid, "blue1", CreateObject(18648,0,0,0,0,0,0));
                AttachObjectToVehicle(GetPVarInt(playerid, "blue"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                AttachObjectToVehicle(GetPVarInt(playerid, "blue1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                GameTextForPlayer(playerid, "~b~ Blue ~w~Neon has been added to your vehicle",3500,5);
            }
            if(listitem == 1)
            {
                SetPVarInt(playerid, "neon", 1);
                SetPVarInt(playerid, "green", CreateObject(18649,0,0,0,0,0,0));
                SetPVarInt(playerid, "green1", CreateObject(18649,0,0,0,0,0,0));
                AttachObjectToVehicle(GetPVarInt(playerid, "green"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                AttachObjectToVehicle(GetPVarInt(playerid, "green1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                GameTextForPlayer(playerid, "~g~Green ~w~Neon has been added to your vehicle",3500,5);
            }
            if(listitem == 2)
            {
                SetPVarInt(playerid, "neon", 1);
                SetPVarInt(playerid, "yellow", CreateObject(18650,0,0,0,0,0,0));
                SetPVarInt(playerid, "yellow1", CreateObject(18650,0,0,0,0,0,0));
                AttachObjectToVehicle(GetPVarInt(playerid, "yellow"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                AttachObjectToVehicle(GetPVarInt(playerid, "yellow1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                GameTextForPlayer(playerid, "~y~Yellow~w~ Neon has been added to your vehicle",3500,5);
            }
            if(listitem == 3)
            {
                SetPVarInt(playerid, "neon", 1);
                SetPVarInt(playerid, "white", CreateObject(18652,0,0,0,0,0,0));
                SetPVarInt(playerid, "white1", CreateObject(18652,0,0,0,0,0,0));
                AttachObjectToVehicle(GetPVarInt(playerid, "white"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                AttachObjectToVehicle(GetPVarInt(playerid, "white1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                GameTextForPlayer(playerid, "~w~White~w~ Neon has been added to your vehicle",3500,5);
            }
            if(listitem == 4)
            {
                SetPVarInt(playerid, "neon", 1);
                SetPVarInt(playerid, "pink", CreateObject(18651,0,0,0,0,0,0));
                SetPVarInt(playerid, "pink1", CreateObject(18651,0,0,0,0,0,0));
                AttachObjectToVehicle(GetPVarInt(playerid, "pink"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                AttachObjectToVehicle(GetPVarInt(playerid, "pink1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                GameTextForPlayer(playerid, "~p~Pink~w~ Neon has been added to your vehicle",3500,5);
            }
            if(listitem == 5)
            {
                DestroyObject(GetPVarInt(playerid, "blue"));
                DeletePVar(playerid, "neon");
                DestroyObject(GetPVarInt(playerid, "blue1"));
                DeletePVar(playerid, "neon");
                DestroyObject(GetPVarInt(playerid, "green"));
                DeletePVar(playerid, "neon");
                DestroyObject(GetPVarInt(playerid, "green1"));
                DeletePVar(playerid, "neon");
                DestroyObject(GetPVarInt(playerid, "yellow"));
                DeletePVar(playerid, "neon");
                DestroyObject(GetPVarInt(playerid, "yellow1"));
                DeletePVar(playerid, "neon");
                DestroyObject(GetPVarInt(playerid, "white"));
                DeletePVar(playerid, "neon");
                DestroyObject(GetPVarInt(playerid, "white1"));
                DeletePVar(playerid, "neon");
                DestroyObject(GetPVarInt(playerid, "pink"));
                DeletePVar(playerid, "neon");
                DestroyObject(GetPVarInt(playerid, "pink1"));
                DeletePVar(playerid, "neon");
                GameTextForPlayer(playerid, "~g~Neon was deleted from your vehicle",3500,5);
            }
  }
    }
    return 1;
}
Reply
#4

remember neon doesnt work with all cars and sometimes neons a pain in the ass and only works when the time is night.. so make sure of that.
Reply
#5

I dragged this neon script from a filterscript, to my gamemode.

It seems that if i put "#if defined filterscript" above my OnDialogResponse, then it compiles fine, but the neon still does not show.

And, i'm pretty sure the neon works on all cars, considering it even works on a hydra, and yes i tried it in night time = no luck.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)