i read a tutorial about modular programming but I dont understand it.
Код:
#include <a_samp>
new PlayerText:TDEditor_PTD[MAX_PLAYERS][4];
public OnPlayerConnect(playerid)
{
TDEditor_PTD[playerid][0] = CreatePlayerTextDraw(playerid, 21.233411, 432.966857, "NAME");
PlayerTextDrawLetterSize(playerid, TDEditor_PTD[playerid][0], 0.149332, 0.869924);
PlayerTextDrawAlignment(playerid, TDEditor_PTD[playerid][0], 2);
PlayerTextDrawColor(playerid, TDEditor_PTD[playerid][0], -1);
PlayerTextDrawSetShadow(playerid, TDEditor_PTD[playerid][0], 0);
PlayerTextDrawSetOutline(playerid, TDEditor_PTD[playerid][0], 0);
PlayerTextDrawBackgroundColor(playerid, TDEditor_PTD[playerid][0], 255);
PlayerTextDrawFont(playerid, TDEditor_PTD[playerid][0], 2);
PlayerTextDrawSetProportional(playerid, TDEditor_PTD[playerid][0], 1);
PlayerTextDrawSetShadow(playerid, TDEditor_PTD[playerid][0], 0);
TDEditor_PTD[playerid][1] = CreatePlayerTextDraw(playerid, 4.666687, 431.837371, "box");
PlayerTextDrawLetterSize(playerid, TDEditor_PTD[playerid][1], 0.000000, 1.200001);
PlayerTextDrawTextSize(playerid, TDEditor_PTD[playerid][1], 130.000000, 0.000000);
PlayerTextDrawAlignment(playerid, TDEditor_PTD[playerid][1], 1);
PlayerTextDrawColor(playerid, TDEditor_PTD[playerid][1], -1);
PlayerTextDrawUseBox(playerid, TDEditor_PTD[playerid][1], 1);
PlayerTextDrawBoxColor(playerid, TDEditor_PTD[playerid][1], 100);
PlayerTextDrawSetShadow(playerid, TDEditor_PTD[playerid][1], 0);
PlayerTextDrawSetOutline(playerid, TDEditor_PTD[playerid][1], 0);
PlayerTextDrawBackgroundColor(playerid, TDEditor_PTD[playerid][1], 255);
PlayerTextDrawFont(playerid, TDEditor_PTD[playerid][1], 1);
PlayerTextDrawSetProportional(playerid, TDEditor_PTD[playerid][1], 1);
PlayerTextDrawSetShadow(playerid, TDEditor_PTD[playerid][1], 0);
TDEditor_PTD[playerid][2] = CreatePlayerTextDraw(playerid, 6.333343, 433.910980, "box");
PlayerTextDrawLetterSize(playerid, TDEditor_PTD[playerid][2], 0.000000, 0.766664);
PlayerTextDrawTextSize(playerid, TDEditor_PTD[playerid][2], 38.000000, 0.000000);
PlayerTextDrawAlignment(playerid, TDEditor_PTD[playerid][2], 1);
PlayerTextDrawColor(playerid, TDEditor_PTD[playerid][2], -1);
PlayerTextDrawUseBox(playerid, TDEditor_PTD[playerid][2], 1);
PlayerTextDrawBoxColor(playerid, TDEditor_PTD[playerid][2], -1005750197);
PlayerTextDrawSetShadow(playerid, TDEditor_PTD[playerid][2], 0);
PlayerTextDrawSetOutline(playerid, TDEditor_PTD[playerid][2], 0);
PlayerTextDrawBackgroundColor(playerid, TDEditor_PTD[playerid][2], -1005750197);
PlayerTextDrawFont(playerid, TDEditor_PTD[playerid][2], 1);
PlayerTextDrawSetProportional(playerid, TDEditor_PTD[playerid][2], 1);
PlayerTextDrawSetShadow(playerid, TDEditor_PTD[playerid][2], 0);
TDEditor_PTD[playerid][3] = CreatePlayerTextDraw(playerid, 82.566764, 433.066955, "Player_Name");
PlayerTextDrawLetterSize(playerid, TDEditor_PTD[playerid][3], 0.149332, 0.869924);
PlayerTextDrawAlignment(playerid, TDEditor_PTD[playerid][3], 2);
PlayerTextDrawColor(playerid, TDEditor_PTD[playerid][3], -1);
PlayerTextDrawSetShadow(playerid, TDEditor_PTD[playerid][3], 0);
PlayerTextDrawSetOutline(playerid, TDEditor_PTD[playerid][3], 0);
PlayerTextDrawBackgroundColor(playerid, TDEditor_PTD[playerid][3], 255);
PlayerTextDrawFont(playerid, TDEditor_PTD[playerid][3], 2);
PlayerTextDrawSetProportional(playerid, TDEditor_PTD[playerid][3], 1);
PlayerTextDrawSetShadow(playerid, TDEditor_PTD[playerid][3], 0);
PlayerTextDrawShow(playerid, PlayerText:TDEditor_PTD[playerid][0]);
PlayerTextDrawShow(playerid, PlayerText:TDEditor_PTD[playerid][1]);
PlayerTextDrawShow(playerid, PlayerText:TDEditor_PTD[playerid][2]);
PlayerTextDrawShow(playerid, PlayerText:TDEditor_PTD[playerid][3]);
return 1;
}
Instead, include a_samp only in the main file, which is your gamemode, then compile the gamemode, not the filterscript. Use includes for that
or can i use textdraws in a filterscript? i want to seperate them from my main gamemode just so the code looks more clean
thanks a lot.
btw using '/' drops an error. it has to be '\' in #include <YSI\y_hooks>