19.12.2015, 01:16
Textdraws have a problem as well, would be nice if you could fix it; I converted my pawn gamemode to Lua completely but the textdraws are the only issue.
pawn Код:
addEventHandler("onScriptInit", function()
for i=1,MAX_COMMANDS do
Commands[i] = {}
Commands[i].Command = "invalid"
end
dbHandle = mysql_connect("localhost", "root", "", "cop")
if ( not dbHandle ) then
print("\n\nUnable to connect to the MySQL server\n")
else
print("\n\nMySQL connection has been made\n")
end
LoadServerInfo()
disableInteriorEnterExits()
allowInteriorWeapons(false)
enableStuntBonusForAll(false)
showPlayerMarkers(false)
setNameTagDrawDistance(25.0)
playerTD = textDrawCreate(133.233703, 328.633453, "");
textDrawLetterSize(playerTD, 0.315666, 0.952889);
textDrawAlignment(playerTD, 1);
textDrawColor(playerTD, -1);
textDrawSetShadow(playerTD, 1);
textDrawSetOutline(playerTD, 0);
textDrawBackgroundColor(playerTD, 255);
textDrawFont(playerTD, 1);
textDrawSetProportional(playerTD, 1);
textDrawSetShadow(playerTD, 1);
textDrawSetString(playerTD, "");
---------------------- [Timers] --------------------------
secondTimer = setTimer(1000, true, function()
SecondUpdate()
end);
end)
addEventHandler("onScriptExit", function()
killTimer(secondTimer);
end);
function SecondUpdate()
local playerList
for i=0, getPlayerPoolSize() do
if (isPlayerConnected(i)) then
if (getPlayerPoolSize() == 0) then
playerList = string.format("~b~%s [%d]~n~", Player[i].NameEx, i)
textDrawSetString(playerTD, playerList)
else
playerList = string.format("%s~b~%s [%d]~n~", playerList, Player[i].NameEx, i)
textDrawSetString(playerTD, playerList)
end
if (Player[i].showSide ~= nil) then
if (Player[i].showSide > 0) then
Player[i].showSide = Player[i].showSide - 1;
if (Player[i].showSide == 0) then
playerTextDrawHide(i, Player[i].sideText);
end
end
end
end
end
end
function showText(playerid, text, seconds)
Player[playerid].showSide = seconds
playerTextDrawSetString(playerid, Player[playerid].sideText, text)
playerTextDrawShow(playerid, Player[playerid].sideText)
end
addEventHandler("onPlayerConnect", function(playerid)
showPlayerDialog(playerid, -1, 0, " ", " ", " ", " ");
Player[playerid] = {}
setPlayerColor(playerid, tocolor(COLOR_WHITE))
Player[playerid].NameEx = string.gsub(getPlayerName(playerid), "_", " ", 1)
Player[playerid].sideText = createPlayerTextDraw(playerid, 30.000041, 276.563079, "");
playerTextDrawLetterSize(playerid, Player[playerid].sideText, 0.299666, 1.147850);
playerTextDrawAlignment(playerid, Player[playerid].sideText, 1);
playerTextDrawColor(playerid, Player[playerid].sideText, -1);
playerTextDrawSetShadow(playerid, Player[playerid].sideText, 1);
playerTextDrawSetOutline(playerid, Player[playerid].sideText, 0);
playerTextDrawBackgroundColor(playerid, Player[playerid].sideText, 255);
playerTextDrawFont(playerid, Player[playerid].sideText, 1);
playerTextDrawSetProportional(playerid, Player[playerid].sideText, 1);
playerTextDrawSetShadow(playerid, Player[playerid].sideText, 1);
playerTextDrawSetString(playerid, Player[playerid].sideText, "");
end)