Okay well here's the difference between creating the textdraws
Код:
PlayerData[playerid][pTextdraws][82] = CreatePlayerTextDraw(playerid, 37.000000, 315.000000, "~b~Loaded:~w~ Retail Supplies~n~~b~Loaded Crates:~w~ 6/6");
PlayerTextDrawBackgroundColor(playerid, PlayerData[playerid][pTextdraws][82], 255);
PlayerTextDrawFont(playerid, PlayerData[playerid][pTextdraws][82], 1);
PlayerTextDrawLetterSize(playerid, PlayerData[playerid][pTextdraws][82], 0.280000, 1.000000);
PlayerTextDrawColor(playerid, PlayerData[playerid][pTextdraws][82], -1);
PlayerTextDrawSetOutline(playerid, PlayerData[playerid][pTextdraws][82], 1);
PlayerTextDrawSetProportional(playerid, PlayerData[playerid][pTextdraws][82], 1);
PlayerTextDrawSetSelectable(playerid, PlayerData[playerid][pTextdraws][82], 0);
Код:
Player[playerid][CreatingZone] = false;
Player[playerid][TDZone][0] = CreatePlayerTextDraw(playerid, 320.000000, 376.666290, "ZONE NAME");
PlayerTextDrawLetterSize(playerid, Player[playerid][TDZone][0], 0.400000, 1.600000);
PlayerTextDrawAlignment(playerid, Player[playerid][TDZone][0], 2);
PlayerTextDrawColor(playerid, Player[playerid][TDZone][0], -1);
PlayerTextDrawSetShadow(playerid, Player[playerid][TDZone][0], 0);
PlayerTextDrawSetOutline(playerid, Player[playerid][TDZone][0], 1);
PlayerTextDrawBackgroundColor(playerid, Player[playerid][TDZone][0], 255);
PlayerTextDrawFont(playerid, Player[playerid][TDZone][0], 3);
PlayerTextDrawSetProportional(playerid, Player[playerid][TDZone][0], 1);
PlayerTextDrawSetShadow(playerid, Player[playerid][TDZone][0], 0);
Here's OnPlayerUpdate
Код:
if ((keys[0] & KEY_FIRE) && (GetVehicleModel(GetPlayerVehicleID(playerid)) == 407 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 544))
{
static
Float:fX,
Float:fY,
Float:fZ,
Float:fVector[3],
Float:fCamera[3];
GetPlayerCameraFrontVector(playerid, fVector[0], fVector[1], fVector[2]);
GetPlayerCameraPos(playerid, fCamera[0], fCamera[1], fCamera[2]);
for (new i = 0; i < sizeof(g_aFireObjects); i ++)
{
GetDynamicObjectPos(g_aFireObjects[i], fX, fY, fZ);
if (IsValidDynamicObject(g_aFireObjects[i]) && IsPlayerInRangeOfPoint(playerid, 3050, fX, fY, fZ))
{
if (++g_aFireExtinguished[i] == 64 && DistanceCameraTargetToLocation(fCamera[0], fCamera[1], fCamera[2], fX, fY, fZ + 2.5, fVector[0], fVector[1], fVector[2]) < 12.0)
{
SetTimerEx("DestroyWater", 2000, false, "d", CreateDynamicObject(18744, fX, fY, fZ - 0.2, 0.0, 0.0, 0.0));
DestroyDynamicObject(g_aFireObjects[i]);
g_aFireExtinguished[i] = 0;
}
}
}
}
Код:
if(Player[playerid][CreatingZone])
{
TogglePlayerControllable(playerid, false);
if(keys[2] == KEY_LEFT)
{
MinPos[playerid][0] -= 8.0;
GangZoneDestroy(PlayerZone[playerid]);
PlayerZone[playerid] = GangZoneCreate(MinPos[playerid][0], MinPos[playerid][1], MaxPos[playerid][0], MaxPos[playerid][1]);
GangZoneShowForPlayer(playerid, PlayerZone[playerid], HexToInt("000000FF"));
}
else if(keys[2] & KEY_LEFT && keys[0] & KEY_FIRE)
{
MinPos[playerid][0] += 8.0;
GangZoneDestroy(PlayerZone[playerid]);
PlayerZone[playerid] = GangZoneCreate(MinPos[playerid][0], MinPos[playerid][1], MaxPos[playerid][0], MaxPos[playerid][1]);
GangZoneShowForPlayer(playerid, PlayerZone[playerid], HexToInt("000000FF"));
}
else if(keys[2] == KEY_RIGHT)
{
MaxPos[playerid][0] += 8.0;
GangZoneDestroy(PlayerZone[playerid]);
PlayerZone[playerid] = GangZoneCreate(MinPos[playerid][0], MinPos[playerid][1], MaxPos[playerid][0], MaxPos[playerid][1]);
GangZoneShowForPlayer(playerid, PlayerZone[playerid], HexToInt("000000FF"));
}
else if(keys[2] & KEY_RIGHT && keys[0] & KEY_FIRE)
{
MaxPos[playerid][0] -= 8.0;
GangZoneDestroy(PlayerZone[playerid]);
PlayerZone[playerid] = GangZoneCreate(MinPos[playerid][0], MinPos[playerid][1], MaxPos[playerid][0], MaxPos[playerid][1]);
GangZoneShowForPlayer(playerid, PlayerZone[playerid], HexToInt("000000FF"));
}
else if(keys[1] == KEY_UP)
{
MaxPos[playerid][1] += 8.0;
GangZoneDestroy(PlayerZone[playerid]);
PlayerZone[playerid] = GangZoneCreate(MinPos[playerid][0], MinPos[playerid][1], MaxPos[playerid][0], MaxPos[playerid][1]);
GangZoneShowForPlayer(playerid, PlayerZone[playerid], HexToInt("000000FF"));
}
else if(keys[1] & KEY_UP && keys[0] & KEY_FIRE)
{
MaxPos[playerid][1] -= 8.0;
GangZoneDestroy(PlayerZone[playerid]);
PlayerZone[playerid] = GangZoneCreate(MinPos[playerid][0], MinPos[playerid][1], MaxPos[playerid][0], MaxPos[playerid][1]);
GangZoneShowForPlayer(playerid, PlayerZone[playerid], HexToInt("000000FF"));
}
else if(keys[1] == KEY_DOWN)
{
MinPos[playerid][1] -= 8.0;
GangZoneDestroy(PlayerZone[playerid]);
PlayerZone[playerid] = GangZoneCreate(MinPos[playerid][0], MinPos[playerid][1], MaxPos[playerid][0], MaxPos[playerid][1]);
GangZoneShowForPlayer(playerid, PlayerZone[playerid], HexToInt("000000FF"));
}
else if(keys[1] & KEY_DOWN && keys[0] & KEY_FIRE)
{
MinPos[playerid][1] += 8.0;
GangZoneDestroy(PlayerZone[playerid]);
PlayerZone[playerid] = GangZoneCreate(MinPos[playerid][0], MinPos[playerid][1], MaxPos[playerid][0], MaxPos[playerid][1]);
GangZoneShowForPlayer(playerid, PlayerZone[playerid], HexToInt("000000FF"));
}
else if(keys[0] & KEY_SECONDARY_ATTACK)
{
TogglePlayerControllable(playerid, true);
Player[playerid][CreatingZone] = false;
Dialog_Show(playerid, DIALOG_SAVEZONE, DIALOG_STYLE_INPUT, "Gang System", "Input gang zone name below, press \"Delete\" to delete current zone", "Save", "Delete");
}
}
There's nothing about OnPlayerClickPlayerTextDraw in the filterscript
This is what's in onplayerconnect
Код:
LoadPlayerGang(playerid);
foreach(new i : GangZones)
{
if(GangZone[i][ZoneOwner] == -1)
GangZoneShowForPlayer(playerid, GangZone[i][ZoneHolder], HexToInt(DEFAULT_ZONE_COLOR));
else
{
new colour[9];
format(colour, 9, "%s50", Gang[GangZone[i][ZoneOwner]][GangColor]);
GangZoneShowForPlayer(playerid, GangZone[i][ZoneHolder], HexToInt(colour));
}
}