Thread: [Tutorial] Plugin development guide
View Single Post
Old 14/02/2016, 01:28 PM   #162
kurta999
High-roller
 
kurta999's Avatar
 
Join Date: Apr 2009
Location: Slovakia (HU)
Posts: 1,391
Reputation: 626
Default Re: Plugin development guide

Yashas, Zeex: Thanks for help, it worked. U will see the result in next version of YSF xD

Quote:
Originally Posted by maddinat0r View Post
Dan once made a function to push PAWN references/addresses:
Code:
int AMXAPI amx_PushAddress(AMX *amx, cell *address) 
{
	AMX_HEADER *hdr;
	unsigned char *data;
	cell xaddr;
	/* reverse relocate the address */
	assert(amx != NULL);
	hdr = (AMX_HEADER *) amx->base;
	assert(hdr != NULL);
	assert(hdr->magic == AMX_MAGIC);
	data = (amx->data != NULL) ? amx->data : amx->base + (int) hdr->dat;
	xaddr = (cell) ((unsigned char*) address-data);
	if ((ucell) xaddr >= (ucell) amx->stp) 
	{
		return AMX_ERR_MEMACCESS;
	}
	return amx_Push(amx,xaddr);
}
Thanks, but function crashed for me.
__________________
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