[Plugin] Lua in SA-MP v0.1 (Alpha)
#58

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)
Reply


Messages In This Thread
Lua in SA-MP v0.2.5 - by Drake1994 - 02.07.2015, 14:43
Re: Lua in SA-MP v0.1 (Alpha) - by Michael B - 02.07.2015, 14:54
Re: Lua in SA-MP v0.1 (Alpha) - by codectile - 02.07.2015, 15:17
Re: Lua in SA-MP v0.1 (Alpha) - by J0sh... - 02.07.2015, 15:21
Re: Lua in SA-MP v0.1 (Alpha) - by riajedA - 02.07.2015, 15:23
Re: Lua in SA-MP v0.1 (Alpha) - by Drake1994 - 02.07.2015, 15:28
Re: Lua in SA-MP v0.1 (Alpha) - by codectile - 02.07.2015, 15:54
Re: Lua in SA-MP v0.1 (Alpha) - by GWMPT - 02.07.2015, 15:57
Re: Lua in SA-MP v0.1 (Alpha) - by vannesenn - 02.07.2015, 16:04
Re: Lua in SA-MP v0.1 (Alpha) - by zSuYaNw - 02.07.2015, 16:15
Re: Lua in SA-MP v0.1 (Alpha) - by Abagail - 02.07.2015, 16:28
Re: Lua in SA-MP v0.1 (Alpha) - by n0minal - 02.07.2015, 16:36
Re: Lua in SA-MP v0.1 (Alpha) - by DRIFT_HUNTER - 02.07.2015, 17:21
Re: Lua in SA-MP v0.1 (Alpha) - by Sanady - 02.07.2015, 18:00
Lua in SA-MP v0.1.2 (Alpha) - by Drake1994 - 03.07.2015, 17:34
AW: Lua in SA-MP v0.1 (Alpha) - by Mellnik - 03.07.2015, 17:50
Re: Lua in SA-MP v0.1 (Alpha) - by Onfroi - 03.07.2015, 18:04
Re: Lua in SA-MP v0.1 (Alpha) - by cm666 - 04.07.2015, 20:37
Re: Lua in SA-MP v0.1 (Alpha) - by Coystark - 06.07.2015, 10:31
Re: Lua in SA-MP v0.1 (Alpha) - by Drake1994 - 06.07.2015, 10:35
Re: Lua in SA-MP v0.1 (Alpha) - by Coystark - 06.07.2015, 10:46
Re: Lua in SA-MP v0.1 (Alpha) - by Drake1994 - 06.07.2015, 10:50
Re: Lua in SA-MP v0.1 (Alpha) - by Drake1994 - 10.07.2015, 21:25
Re: Lua in SA-MP v0.1 (Alpha) - by Lorenc_ - 11.07.2015, 01:10
Re: Lua in SA-MP v0.1 (Alpha) - by Drake1994 - 11.07.2015, 01:37
Re: Lua in SA-MP v0.1 (Alpha) - by Drake1994 - 18.07.2015, 22:07
Re: Lua in SA-MP v0.1 (Alpha) - by KayJ - 19.07.2015, 05:57
Re: Lua in SA-MP v0.1 (Alpha) - by HardWar - 20.07.2015, 18:36
Re: Lua in SA-MP v0.1 (Alpha) - by Drake1994 - 20.07.2015, 20:27
Re: Lua in SA-MP v0.1 (Alpha) - by HardWar - 20.07.2015, 20:47
Re: Lua in SA-MP v0.1 (Alpha) - by Drake1994 - 20.07.2015, 22:06
Re: Lua in SA-MP v0.1 (Alpha) - by HardWar - 21.07.2015, 01:24
Re: Lua in SA-MP v0.1 (Alpha) - by Drake1994 - 21.07.2015, 22:52
Re: Lua in SA-MP v0.1 (Alpha) - by HardWar - 22.07.2015, 02:47
Lua in SA-MP v0.2.5 - by Drake1994 - 22.07.2015, 19:43
Re: Lua in SA-MP v0.1 (Alpha) - by czop1223 - 19.08.2015, 22:22
Re: Lua in SA-MP v0.1 (Alpha) - by SkittlesAreFalling - 25.08.2015, 01:38
Re: Lua in SA-MP v0.1 (Alpha) - by SkittlesAreFalling - 25.08.2015, 02:03
Re: Lua in SA-MP v0.1 (Alpha) - by Drake1994 - 25.08.2015, 18:41
Re: Lua in SA-MP v0.1 (Alpha) - by SkittlesAreFalling - 25.08.2015, 21:17
Re: Lua in SA-MP v0.1 (Alpha) - by Logofero - 26.08.2015, 16:08
Re: Lua in SA-MP v0.1 (Alpha) - by SkittlesAreFalling - 28.08.2015, 07:38
Re: Lua in SA-MP v0.1 (Alpha) - by Logofero - 28.08.2015, 14:24
Re: Lua in SA-MP v0.1 (Alpha) - by SkittlesAreFalling - 28.08.2015, 23:56
Re: Lua in SA-MP v0.1 (Alpha) - by Rancho - 29.08.2015, 12:06
Re: Lua in SA-MP v0.1 (Alpha) - by Logofero - 29.08.2015, 16:47
Re: Lua in SA-MP v0.1 (Alpha) - by Drake1994 - 29.08.2015, 23:27
Re: Lua in SA-MP v0.1 (Alpha) - by YuKki1 - 30.08.2015, 00:21
Re: Lua in SA-MP v0.1 (Alpha) - by MD15 - 30.08.2015, 19:16
Re: Lua in SA-MP v0.1 (Alpha) - by Inn0cent - 31.08.2015, 10:15
Re: Lua in SA-MP v0.1 (Alpha) - by IllidanS4 - 18.11.2015, 11:53
Re: Lua in SA-MP v0.1 (Alpha) - by Leka74 - 04.12.2015, 20:18
Re: Lua in SA-MP v0.1 (Alpha) - by SkittlesAreFalling - 05.12.2015, 08:04
Re: Lua in SA-MP v0.1 (Alpha) - by Leka74 - 05.12.2015, 15:56
Re: Lua in SA-MP v0.1 (Alpha) - by SkittlesAreFalling - 17.12.2015, 16:22
Re: Lua in SA-MP v0.1 (Alpha) - by Leka74 - 17.12.2015, 17:06
Re: Lua in SA-MP v0.1 (Alpha) - by PaulDinam - 18.12.2015, 12:09
Re: Lua in SA-MP v0.1 (Alpha) - by PaulDinam - 19.12.2015, 01:16
Re: Lua in SA-MP v0.1 (Alpha) - by Drake1994 - 19.12.2015, 12:28
Re: Lua in SA-MP v0.1 (Alpha) - by PaulDinam - 19.12.2015, 12:35
Re: Lua in SA-MP v0.1 (Alpha) - by SkittlesAreFalling - 21.12.2015, 22:44
Re: Lua in SA-MP v0.1 (Alpha) - by PaulDinam - 22.12.2015, 11:59
Re: Lua in SA-MP v0.1 (Alpha) - by SkittlesAreFalling - 22.12.2015, 12:16
Re: Lua in SA-MP v0.1 (Alpha) - by PaulDinam - 22.12.2015, 12:47
Re: Lua in SA-MP v0.1 (Alpha) - by SkittlesAreFalling - 22.12.2015, 13:07
Re: Lua in SA-MP v0.1 (Alpha) - by Leka74 - 07.01.2016, 22:11
Re: Lua in SA-MP v0.1 (Alpha) - by Ankris - 06.08.2016, 00:38
Re: Lua in SA-MP v0.1 (Alpha) - by Drake1994 - 06.08.2016, 21:30
Re: Lua in SA-MP v0.1 (Alpha) - by Jabern - 18.08.2016, 09:34
Re: Lua in SA-MP v0.1 (Alpha) - by HardWar - 27.08.2016, 18:34

Forum Jump:


Users browsing this thread: 7 Guest(s)