20.07.2016, 05:46
first OnPlayerSpawn is not the correct place for creating a player textdraw...
So put it under OnPlayerConnect
When player spawn u have to show up the textdraw..
Now you have to hide it on OnPlayerDeath..
If Zone_update is Global then put it under OnGamemodeInit and if not then put it under OnPlayerConnect
It would be better if u repeat it after every 1 sec not not in every 1/2 sec.
So put it under OnPlayerConnect
PHP код:
public OnPlayerConnect(playerid)
{
Zones[playerid] = CreatePlayerTextDraw(playerid,6.5, 425.4, "_");
PlayerTextDrawLetterSize(playerid, Zones[playerid], 0.65, 2.1);
PlayerTextDrawSetOutline(playerid, Zones[playerid], 1);
}
PHP код:
public OnPlayerSpawn(playerid)
{
PlayerTextDrawShow(playerid,Zones[playerid]);
}
PHP код:
public OnPlayerDeath(playerid)
{
PlayerTextDrawHide(playerid,Zones[playerid]);
}
PHP код:
public OnplayerConnect(playerid)
{
SetTimerEx("Zone_Update", 500, 1, "i", playerid);
}