SA-MP Forums Archive
OnPlayerEnterDynamicArea - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerEnterDynamicArea (/showthread.php?tid=631709)



OnPlayerEnterDynamicArea - OwlIT - 03.04.2017

Is this callback triggered when a player inside a vehicle enters in a dynamic area? If yes, I don't know why it doesn't work for me.

Код:
//Callback
public OnPlayerEnterDynamicArea(playerid, areaid)
{
    new
		i;

	lastPlayerAreaID[playerid] = areaid;
	i = Streamer_GetIntData(STREAMER_TYPE_AREA, areaid, E_STREAMER_EXTRA_ID) - HOUSE_MAGIC;		
 	if(0 <= i < MAX_HOUSES)
 	{
 	    if(HouseInfo[i][hPrice] != 0 && HouseInfo[i][hOwnerID] != -1 && !IsPlayerInCheckpoint(playerid))
			SetPlayerCheckpoint(playerid, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ], 2.0);

		localCheckPointType[playerid] = TYPE_HOUSE;
		localCheckPointID[playerid] = i;
		return 1;
 	} 	
        return 1;
}

//Creation
HouseInfo[id][hEnterArea] = CreateDynamicSphere(HouseInfo[id][hEnterX], HouseInfo[id][hEnterY], HouseInfo[id][hEnterZ], 1.5, HouseInfo[id][hVW], HouseInfo[id][hEnterInt]);
Streamer_SetIntData(STREAMER_TYPE_AREA, HouseInfo[id][hEnterArea], E_STREAMER_EXTRA_ID, id + HOUSE_MAGIC);
All works fine when the player is outside a vehicle.


Re: OnPlayerEnterDynamicArea - OwlIT - 04.04.2017

Anyone?


Re: OnPlayerEnterDynamicArea - Toroi - 04.04.2017

I try to comprehend your code but it seems like I'm kinda stupid. Where are you checking if the player is entering the respective areaid?


Re: OnPlayerEnterDynamicArea - OwlIT - 04.04.2017

Quote:
Originally Posted by Troydere
Посмотреть сообщение
I try to comprehend your code but it seems like I'm kinda stupid. Where are you checking if the player is entering the respective areaid?
Код:
i = Streamer_GetIntData(STREAMER_TYPE_AREA, areaid, E_STREAMER_EXTRA_ID) - HOUSE_MAGIC;		
if(0 <= i < MAX_HOUSES)
Here.


Re: OnPlayerEnterDynamicArea - Vin Diesel - 04.04.2017

I think this is house system related.


Re: OnPlayerEnterDynamicArea - DRIFT_HUNTER - 04.04.2017

Just send client message when player enters dynamic area (before any check's)