CreateDynamicPickupEx syntax wrong?
#1

Hello
I have never worked with CreateDynamicPickupEx until few days ago. I decided to start using this function because I need only one pickup for several specific virtual worlds.
The problem is that it doesn't work fine, sometimes the pickups don't appear, this happen randomly, sometimes the pickups are shown sometimes no, so I am asking if I'm using the right syntax, here is an example:
CreateDynamicPickupEx(GetWeaponModel(WEAPON_SHOTGS PA), 1, 187.9778,389.8757,2369.1978, 100.0, {14, 15, 16, 17, 18, 19})
Here is the native:
native CreateDynamicPickupEx(modelid, type, Float, Float:y, Float:z, Floattreamdistance = 100.0, worlds[] = { -1 }, interiors[] = { -1 }, players[] = { -1 }, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players);
Also the pickups aren't shown if I use a command to change my virtual world inside the place where pickups are placed, eg:
http://*********/nhymyWOVKcs
I'm in the place where the pickups are placed, I can see them
My current virtual world is 14
I type /changeworld 15
My virtualworld is changed to 15, but the pickups have dissapeared
I type /changeworld 14
The pickups are shown again
I leave the place, my virtualworld is now 0
I pick up a pickup that teleports me to the place (IT ONLY does that), and sets me the virtual world 15, then I see the pickups and my virtual world is 15!
What the hell?
Thanks if you can help me.
Reply
#2

pawn Код:
new v_worlds[6] = {14, 15, 16, 17, 18, 19};
CreateDynamicPickupEx(GetWeaponModel(WEAPON_SHOTGS PA), 1, 187.9778, 389.8757, 2369.1978, 100.0, v_worlds);
Reply
#3

No, it doesn't work, it seems that there is a problem with the streamer
Here is my code
Код:
new v_worlds[6] = {14, 15, 16, 17, 18, 19};
	w_b[0] = CreateDynamicPickupEx(GetWeaponModel(WEAPON_ROCKETLAUNCHER), 1, 177.7305,388.8920,2369.1978, 100.0, v_worlds ,{-1}, {-1}, 20, 50, MAX_J);
	w_b[1] = CreateDynamicPickupEx(GetWeaponModel(WEAPON_FLAMETHROWER), 1, 177.7605,391.8044,2369.1978, 100.0, v_worlds);
	w_b[2] = CreateDynamicPickupEx(GetWeaponModel(WEAPON_MINIGUN), 1, 177.6964,395.1643,2369.1978, 100.0, v_worlds);
	w_b[3] = CreateDynamicPickupEx(GetWeaponModel(WEAPON_UZI), 1, 179.4166,396.9809,2369.2051, 100.0, v_worlds);
	w_b[4] = CreateDynamicPickupEx(GetWeaponModel(WEAPON_DEAGLE), 1, 180.9496,389.3947,2369.1978, 100.0, v_worlds);
	w_b[5] = CreateDynamicPickupEx(GetWeaponModel(WEAPON_MP5), 1, 183.1679,389.3450,2369.1978, 100.0, v_worlds);
	w_b[6] = CreateDynamicPickupEx(GetWeaponModel(WEAPON_M4), 1, 185.6865,389.0992,2369.1978, 100.0, v_worlds);
	w_b[7] = CreateDynamicPickupEx(GetWeaponModel(WEAPON_AK47), 1, 188.8052,394.2271,2369.1978, 100.0, v_worlds);
	w_b[8] = CreateDynamicPickupEx(GetWeaponModel(WEAPON_GRENADE), 1, 181.6125,392.0222,2369.1978, 100.0, v_worlds);
	w_b[9] = CreateDynamicPickupEx(GetWeaponModel(WEAPON_MOLTOV), 1, 181.1880,394.3564,2369.1978, 100.0, v_worlds);
	w_b[10] = CreateDynamicPickupEx(GetWeaponModel(WEAPON_KATANA), 1, 183.3931,393.2608,2369.1978, 100.0, v_worlds);
	w_b[11] = CreateDynamicPickupEx(GetWeaponModel(WEAPON_SNIPER), 1, 185.8799,393.1145,2369.1978, 100.0, v_worlds);
	w_b[12] = CreateDynamicPickupEx(GetWeaponModel(WEAPON_SAWEDOFF), 1, 181.6936,396.9494,2369.2051, 100.0, v_worlds);
	w_b[13] = CreateDynamicPickupEx(GetWeaponModel(WEAPON_SHOTGSPA), 1, 187.9778,389.8757,2369.1978, 100.0, v_worlds);

//The function that teleports you when a key is pressed:
else if(GetPlayerVirtualWorld(playerid) == 0)
		{
			switch(gTeam[playerid])
			{
				case UNITEDSTATES:
				{
					if(IsPlayerInRangeOfPoint(playerid, 2.0, 242.9333,-1804.4381,4.4580))
					{
						SetPlayerVirtualWorld(playerid, 14);//HERE.
						SetPlayerPos(playerid, 189.9007,390.7557,2369.1978);
						SetPlayerFacingAngle(playerid, 3.2096);
						SetCameraBehindPlayer(playerid);
						FreezeP(playerid, 2);
					}
				}
And the video where no one pikcup is shown.
http://*********/nhymyWOVKcs
Reply
#4

Bump
Reply
#5

You cannot pass an array to worldid parameter.

Do you know what happens when you use v_world as an argument?It passes the address of the first element of the array.

You need to use CreateDynamicPickupEx for each world.
Reply
#6

Yes, I know it because I have used pointers in C++ but I have no idea what about pawn, I think it's very similar. Furthermore with the the address of the first element you can access to all the elements of an array, am I wrong? Also I think you need pass the size of the array? I don't understand this function at all, I am not familiar with the "worlds[] = { -1 }" as a parameter. So I have no idea what is the difference between CreateDynamicPickup and CreateDynamicPickupEx if I should use this function a lot of times with more variables to create pickups in different virtual worlds.
Thanks for your help!
Reply
#7

Bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)