SA-MP Forums

Go Back   SA-MP Forums > SA-MP DL Edition > SA-MP 0.3.DL

Reply
 
Thread Tools Display Modes
Old 27/12/2017, 02:00 PM   #1
AdrianGraber
Big Clucker
 
AdrianGraber's Avatar
 
Join Date: Mar 2013
Location: Germany
Posts: 100
Reputation: 102
Default Pickups outside normal map don't get created

Bug relating to 0.3.8 new objects was fixed in latest RCs. But still, pickups that are outside of the normal 4096 range won’t get created. Given the 0.3.8 update that will allow custom objects (and therefor, maps), it would only make sense to get the pickups fixed so scripters can take advantage of it.

An unofficial fix is already available, this proves the issue can be fixed.
Quote:
Originally Posted by ][Noname][ View Post
pickup coord stored in short int 16 bit value

Code:
float x;
short int savex=short int(x*8)
limit - (2^16)/8/2=65536/8/2=8192/2=4096

set limit to 32768 without changing structure format will change coord accuracy step to 1.0

test with limit 4096*2=8192
but accuracy - 0.25

PickupCoordTest.asi
source

I don't know is there any incompatible with other mods or what Kalcor will change

use only for testing!
Please!

Last edited by AdrianGraber; 05/01/2018 at 10:46 PM.
AdrianGraber is online now   Reply With Quote
Old 28/12/2017, 10:48 AM   #2
Jochemd
High-roller
 
Jochemd's Avatar
 
Join Date: Jul 2009
Location: The Netherlands
Posts: 2,503
Reputation: 844
Default Re: Pickups outside normal map don't get created

They do get created, they're just not visible. Try to walk through the position you created them and you'll notice they work as expected.
Jochemd is offline   Reply With Quote
Old 28/12/2017, 11:17 AM   #3
Locky_
High-roller
 
Locky_'s Avatar
 
Join Date: Jul 2012
Posts: 1,578
Reputation: 313
Default Re: Pickups outside normal map don't get created

In the case what he requests that this be corrected. For example, the player's animation has been corrected when exiting a vehicle on created maps. I think correcting the visibility of the pickup would also be a good fix.
__________________
Locky_ is offline   Reply With Quote
Old 28/12/2017, 12:28 PM   #4
d0
Beta Tester
 
d0's Avatar
 
Join Date: Oct 2007
Location: Germany
Posts: 810
Reputation: 135
Default Re: Pickups outside normal map don't get created

Quote:
- Vehicle exiting should work properly on server created objects.
as far as i know, this fix also fixes pickups on server created objects.
Just try it
__________________
<3
d0 is offline   Reply With Quote
Old 28/12/2017, 12:48 PM   #5
AdrianGraber
Big Clucker
 
AdrianGraber's Avatar
 
Join Date: Mar 2013
Location: Germany
Posts: 100
Reputation: 102
Default Re: Pickups outside normal map don't get created

Quote:
Originally Posted by Jochemd View Post
They do get created, they're just not visible. Try to walk through the position you created them and you'll notice they work as expected.
Nope. I use a script which has pickup based enter/exits (so it doesn’t loop through all enter/exits) using the last pickupid. It doesn’t trigger OnPlayerPickUpPickup where it should

Quote:
Originally Posted by d0 View Post
as far as i know, this fix also fixes pickups on server created objects.
Just try it
Unfortunately, it doesn’t. I just tried it out before making this post.
AdrianGraber is online now   Reply With Quote
Old 28/12/2017, 01:10 PM   #6
adri1
Banned
 
Join Date: Oct 2010
Posts: 1,938
Reputation: 955
Default Re: Pickups outside normal map don't get created

the only thing that occurs to me is an area and rotating object
Code:
CreateDynamicCylinder(Float:x, Float:y, Float:minz, Float:maxz, Float:size, worldid = -1, interiorid = -1, playerid = -1, priority = 0);
Edit:
you can do some like this:
(no tested)

Code:
#define AREA_TYPE_FIXED_PICKUP 1000
forward OnPlayerEnterFixedPickup(playerid, pickupid);
forward OnPlayerLeaveFixedPickup(playerid, pickupid);

Fixed_CreatePickup(model, Float:x, Float:y, Float:z, worldid = -1, interiorid = -1, playerid = -1)
{
	CreateDynamicObject(model, x, y, z, 0.0, 0.0, 0.0, worldid, interiorid, playerid);
	new areaid = CreateDynamicCylinder(x, y, z - 1.0, z + 3.0, 1.0, worldid, interiorid, playerid);
	Streamer_SetIntData(STREAMER_TYPE_AREA, areaid, E_STREAMER_EXTRA_ID, AREA_TYPE_FIXED_PICKUP); 
	return areaid;
}

public OnPlayerEnterDynamicArea(playerid, areaid)
{
	if(Streamer_GetIntData(STREAMER_TYPE_AREA, areaid, E_STREAMER_EXTRA_ID) == AREA_TYPE_FIXED_PICKUP)
	{
		OnPlayerEnterFixedPickup(playerid, areaid);
	}
	return 1;
}

public OnPlayerLeaveDynamicArea(playerid, areaid)
{
	if(Streamer_GetIntData(STREAMER_TYPE_AREA, areaid, E_STREAMER_EXTRA_ID) == AREA_TYPE_FIXED_PICKUP)
	{
		OnPlayerLeaveFixedPickup(playerid, areaid);
	}
	return 1;
}


//inc
public OnPlayerEnterFixedPickup(playerid, pickupid)
{
	new str[45];
	format(str, sizeof str, "OnPlayerEnterFixedPickup, ID: %d", pickupid);
	SendClientMessage(playerid, -1, str);
	return 1;
}

public OnPlayerLeaveFixedPickup(playerid, pickupid)
{
	new str[45];
	format(str, sizeof str, "OnPlayerLeaveFixedPickup, ID: %d", pickupid);
	SendClientMessage(playerid, -1, str);
	return 1;
}
the object has to be rotated to seem like a original pickup
adri1 is offline   Reply With Quote
Old 28/12/2017, 01:27 PM   #7
kurta999
High-roller
 
kurta999's Avatar
 
Join Date: Apr 2009
Location: Slovakia (HU)
Posts: 1,423
Reputation: 626
Default Re: Pickups outside normal map don't get created

This should be fixed normally in client, not server sided. (already possiblr.with limit adjuster)
__________________
I don't play and have ANY interest in SA:MP anymore! Please do not ask for help, because I'm not going to reply.
kurta999 is offline   Reply With Quote
Old 28/12/2017, 04:30 PM   #8
adri1
Banned
 
Join Date: Oct 2010
Posts: 1,938
Reputation: 955
Default Re: Pickups outside normal map don't get created

I made an experimental include, its working, but object pickup rotation is not too smooth
Code:
/*
	By adri1
*/

//cpickup
#if defined _inc_cpickup
	#endinput
#endif
#define _inc_cpickup

//streamer
#if !defined _streamer_included
	#error "no streamer include"
#endif

//yhooks
#include <YSI-Includes\YSI\y_hooks>

//
#define CUSTOM_PICKUP_UNIQUE_ID 1000
#define INVALID_CUSTOM_PICKUP_ID INVALID_STREAMER_ID
forward OnPlayerEnterCustomPickup(playerid, pickupid);
forward OnPlayerLeaveCustomPickup(playerid, pickupid);

stock CreateDynamicCustomPickup(model, Float:x, Float:y, Float:z, Float:rx = 0.0, Float:ry = 0.0, worldid = -1, interiorid = -1, playerid = -1)
{
	//create
	new objectid = CreateDynamicObject(model, x, y, z + 1.0, rx, ry, 0.0, worldid, interiorid, playerid),
		areaid = CreateDynamicCylinder(x, y, z - 1.0, z + 3.0, 0.5, worldid, interiorid, playerid);
	
	//move object
	SetDynamicObjectPos(objectid, x, y, z - 0.001);
	MoveDynamicObject(objectid, x, y, z, 0.005, rx, ry, 179.0);

	//object
	Streamer_SetIntData(STREAMER_TYPE_OBJECT, objectid, E_STREAMER_EXTRA_ID, CUSTOM_PICKUP_UNIQUE_ID); 

	//area
	new streamer_info[2];
	streamer_info[0] = CUSTOM_PICKUP_UNIQUE_ID;
	streamer_info[1] = objectid;
	Streamer_SetArrayData(STREAMER_TYPE_AREA, areaid, E_STREAMER_EXTRA_ID, streamer_info);
	return areaid;
}

stock DestroyDynamicCustomPickup(pickupid)
{
	if(pickupid == INVALID_CUSTOM_PICKUP_ID) return 0;

	new streamer_info[2];
	Streamer_GetArrayData(STREAMER_TYPE_AREA, pickupid, E_STREAMER_EXTRA_ID, streamer_info);
	if(streamer_info[0] != CUSTOM_PICKUP_UNIQUE_ID) return 0;

	DestroyDynamicObject(streamer_info[1]);
	DestroyDynamicArea(pickupid);
	return 1;
}

hook OnPlayerEnterDynArea(playerid, areaid)
{
	new streamer_info[2];
	Streamer_GetArrayData(STREAMER_TYPE_AREA, areaid, E_STREAMER_EXTRA_ID, streamer_info);
	if(streamer_info[0] == CUSTOM_PICKUP_UNIQUE_ID) CallLocalFunction("OnPlayerEnterCustomPickup", "dd", playerid, areaid);
	return 1;
}

hook OnPlayerLeaveDynArea(playerid, areaid)
{
	new streamer_info[2];
	Streamer_GetArrayData(STREAMER_TYPE_AREA, areaid, E_STREAMER_EXTRA_ID, streamer_info);
	if(streamer_info[0] == CUSTOM_PICKUP_UNIQUE_ID) CallLocalFunction("OnPlayerLeaveCustomPickup", "dd", playerid, areaid);
	return 1;
}

hook OnDynamicObjectMoved(objectid)
{
	if(Streamer_GetIntData(STREAMER_TYPE_OBJECT, objectid, E_STREAMER_EXTRA_ID) == CUSTOM_PICKUP_UNIQUE_ID)
	{
		new Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz;
		GetDynamicObjectPos(objectid, x, y, z);
		GetDynamicObjectRot(objectid, rx, ry, rz);
		

		if(rz == 179.0) rz = 359.0;
		else rz = 179.0;

		SetDynamicObjectPos(objectid, x, y, z - 0.001);
		MoveDynamicObject(objectid, x, y, z, 0.001, rx, ry, rz);
	}
	return 1;
}
adri1 is offline   Reply With Quote
Old 28/12/2017, 05:57 PM   #9
Dice_
Huge Clucker
 
Dice_'s Avatar
 
Join Date: Sep 2015
Location: Indonesia
Posts: 494
Reputation: 56
Default Re: Pickups outside normal map don't get created

Yes,this should be fixed.
__________________
Dice_ is offline   Reply With Quote
Old 28/12/2017, 06:32 PM   #10
ModGuy
Banned
 
Join Date: Nov 2017
Posts: 15
Reputation: 0
Default Re: Pickups outside normal map don't get created

Also this rotation bug should be fixed "SetDynamicObjectPos(objectid, x, y, z - 0.001);", it's annoying
ModGuy is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] [MySQL]Pickups Manager Module (Full Control on pickups) TitanX Filterscripts 5 13/03/2017 07:02 PM
pickups dont get created... niels44 Scripting Help 12 12/12/2012 07:16 PM
Pickups acting as other pickups [HELP] ShawtyyMacJunior Scripting Help 2 12/08/2012 11:50 AM
Pickups/3DTexts don't show on house pickups - Help ! Edvin Scripting Help 1 21/06/2012 07:50 PM
[URGENT] I need a list of pickups with thier ids The new 0.3c pickups AMEENAMEEN Scripting Help 1 14/04/2012 05:12 PM


All times are GMT. The time now is 10:39 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.