20.02.2019, 22:12
Quote:
It is good looking and well done, but why split into several filterscripts? Even for two lines of code lol?
|
Quote:
Well there is some stuff here......
1.) No textdraw create in OnFilterScriptInit() for connected players. 2.) Using textdraws that should be global as player textdraws only textdraws with per-player output should be player textdraws. 3.) Lacking clean up code in OnFilterScriptExit() 4.) Major fuck-up with OnPlayerSpawn() that continually creates textdraws without destroying. Textdraws should never be destroyed unless the filterscript is unloaded. Your textdraws need to be created when a player connects ideally when they actually login. 5.) Useless OnPlayerDisconnect() code all of it. 6.) Why bother updating anything if nothing actually changed? Save the last CHANGE in a variable if it is the same then don't update. Code:
if(angle >= 355.0 || angle <= 5.0) PlayerTextDrawSetString(playerid, p_DirectionTextdraw[playerid], "N"); else if(angle >= 265.0 && angle <= 275.0) PlayerTextDrawSetString(playerid, p_DirectionTextdraw[playerid], "E"); else if(angle >= 175.0 && angle <= 185.0) PlayerTextDrawSetString(playerid, p_DirectionTextdraw[playerid], "S"); else if(angle >= 85.0 && angle <= 95.0) PlayerTextDrawSetString(playerid, p_DirectionTextdraw[playerid], "W"); |
I think it is not necessary to do this:
OnPlayerLeaveDynamicArea
"if (!IsPlayerInAnyDynamicArea(playerid)) "
I don't understand what you tried to do with this.
PHP Code:
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid) {
if(playertextid == p_DirectionTextdraw[playerid]) {
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Player Location Display", "Player Location Display\nCreated by Infinity\n\
With help from Gravityfalls!", "Okay", "");
}
return 1;
}