19.03.2014, 07:57
(
Последний раз редактировалось rangerxxll; 19.03.2014 в 18:58.
)
I'm creating a dynamic area and I'd like everyone who is within the area to have their name tags shown to the person who created the area. I'm a tad confused on how to do this - Any help would be appreciated.
This is what I have so far:
This is what I have so far:
pawn Код:
public OnPlayerEnterDynamicArea(playerid, areaid)
{
for(new i; i != GetMaxPlayers(); i++)
{
if(areaid == OBJECT_PROXIMITY_AREA[i]) //Just ignore this, as it works properly.
{
SCM(playerid,COLOR_RED, "You've stepped on a proximity bomb.");
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, Float:x, Float:y, Float:z);
CreateExplosion(x, y, z, 2, 10.0);
DestroyDynamicObject(OBJECT_PROXIMITY[i]);
DestroyDynamicArea(OBJECT_PROXIMITY_AREA[i]);
}
if(areaid == OBJECT_SENSOR_AREA[i]) //This is the area we are looking at
{
SCM(playerid,COLOR_RED, "You've entered a monitored area.");
SetPlayerMarkerForPlayer( i, i, ( GetPlayerColor( 1 ) | 0x000000FF )); // <---
}
}
return 1;
}
public OnPlayerLeaveDynamicArea(playerid, areaid)
{
foreach(Player, i)
{
ShowPlayerNameTagForPlayer(i, i, 0);
}
SCM(playerid,COLOR_GREEN, "You've exited a monitored area.");
}
//This is when a player creates the actual area.
if(dialogid == INVENTORY_MOTIONSENSOR) //
{
if(!response) return ShowPlayerDialog(playerid,INVENTORY_MAIN,DIALOG_STYLE_LIST, "Inventory", invstring, "Select", "Cancel");
if(motionsensor[playerid] == 0) return SCM(playerid,COLOR_GREY, "Error: You don't have any motion sensors");
if(listitem == 0) //lay sensor
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, Float:x, Float:y, Float:z);
OBJECT_SENSOR[playerid] = CreateObject(16782, x, y, z-0.8, 0.00000, -90.00000, 0.00000);
OBJECT_SENSOR_AREA[playerid] = CreateDynamicCircle(x, y, 15.0, -1, -1, -1);
TogglePlayerDynamicArea(playerid, OBJECT_SENSOR_AREA[playerid], 1);
SCM(playerid,COLOR_GREEN, "You've activated your motion sensor. Anyone near it will show on your radar.");
motionsensor[playerid] --;
}
}