OnPlayerEnterDynamicArea
#1

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.
Reply
#2

Anyone?
Reply
#3

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?
Reply
#4

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.
Reply
#5

I think this is house system related.
Reply
#6

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


Forum Jump:


Users browsing this thread: 1 Guest(s)