CreatePickup Issue(s)
#1

Alright idunno if its a bug or what maybe its just me and bad scripting..anyways heres my problem;

I got a gamemode with pickups and at least 2 FS using pickups all made with CreatePickup.

Everything worked fine untill i decided to use a pickup for vehicles only (spawn type 14) into the FilterScript number1.
One of my other FS creates pickups ingame.(lets call it FS number 2) and when it does the vehicle pickup from the FS number 1 is bugged
it responds like it is the ingame created pickup from the FS.

all pickups already created or not are listening to there own value made like exactly like the wiki says;

Код:
new pickup; // Create a variable to store the pickup ID in
 
public OnGameModeInit()(or filterscriptinit)
{
    pickup = CreatePickup(model, pickup type, 1503.3359, 1432.3585, 10.1191, -1);
    // Create an armour pickup and store the ID in 'pickup'
    return 1;
}
 
// Later..
DestroyPickup(pickup); // Example of using the pickup ID
I tried return 0; on both FS thought that would work but no.

So any suggestions to fix this would be nice

(now im thinking about it im going to try static pickups for the ones that i dont have to create and destroy ingame)
Edit: static pickup wont change anything
Reply
#2

bump and Merry Christmas!!!
Reply
#3

you used the same variable for each pickup?
It looks as if your server is just mixing up the different pickups...

(in case you don't use the same variable for all pickups, then try getting them all into 1 script)
Reply
#4

Quote:

(in case you don't use the same variable for all pickups, then try getting them all into 1 script)

no i didnt use the same variables, and getting them into one script is exactly what i dont want.
you are correct that the server seems to mix the pickups somehow it just only happens on pickup spawn type 14.

about the variables...could it be a problem that i added a variable to a pickup that doesnt excist 'yet' ? ( but its gonna
be created later ingame)
Reply
#5

you mean you wrote "example = CreatePickup(.........);" at OnFilterScriptInit (or however it is called again)..
and somewhere later "new example"?

if yes then that's the problem, as the "example" is defined as a local variable only then, that means it is only defined between the { and the } where you put it...
Reply
#6

its like this

somewhere above OnFilterScriptInit
just new example;

then when something ingame happens a pickup will appear...to not get confused lets say it will
appear after using OndialogResponse...so a player clicks an option in a dialog and then a pickup will appear

looks something like this;

Код:
	if(response==1)	{
		
                             if(listitem == 0)
		{
                             example = CreatePickup(1274, 1, 2054.7205,1680.2982,166.7625,1);
                             }
               }
(srry brackets are messed up here)
after that some vehicle pickup i already have in the gamemode is messed up and listening to the example pickup just created.

mmh.. you did gave me another idea to try btw..gonna test the idea now thanks
Reply
#7

well the variable is right then... you checked the dialog? maybe you have doubled a dialog ID?
Reply
#8

I had the same problem, problem is not in the pickup, it's in the dialog, try to put OnDialogResponse as your first public.
Reply
#9

Quote:

I had the same problem, problem is not in the pickup, it's in the dialog, try to put OnDialogResponse as your first public.

Ah, good to hear this happens to other people to i tried what you said it didnt work after that i tried creating the pickup with a command. I found out now that the bug also happens when the pickup isnt even created yet.
Reply
#10

happens with command, too or only the dialog?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)