Jump to content

Erro com script


Recommended Posts

estou criando um script onde ele tem que mostrar uma tela através do onClientRender, porém quando eu inicio o script ele aparece esse erro:

ERROR: Loading script failed: src_accounts2\assets\script\c.lua:11: '(' expected near 'telaPrinci'

meu código:

 

local sW, sH = guiGetScreenSize()
local resW, resH = 1920,1080
local x, y = (sW/resW), (sH/resH)

PersonagensComprar = {
     {0},
     {25},
     {50}
 },

function telaPrinci ()
     dxDrawRectangle(x*26, y*81, x*409, y*871, tocolor(36, 36, 36, 240), false)
     dxDrawRectangle(x*26, y*81, x*409, y*107, tocolor(17, 17, 17, 240), false)
     dxDrawRoundedRectangle(x*492, y*843, x*246, y*109, tocolor(36, 36, 36, 255), 15)
     dxDrawRoundedRectangle(x*769, y*843, x*246, y*109, tocolor(36, 36, 36, 255), 15)
     dxDrawRoundedRectangle(x*1046, y*843, x*246, y*109, tocolor(36, 36, 36, 255), 15)
     dxDrawRoundedRectangle(x*1323, y*843, x*246, y*109, tocolor(36, 36, 36, 255), 15)
     dxDrawImage(x*1694, y*0, x*226, y*205, "assets/icons/Logo.png", 0, 0, 0, tocolor(0, 0, 0, 255), false)
     dxDrawImage(x*1422, y*874, x*47, y*47, "assets/icons/lock.png", 0, 0, 0, tocolor(0, 0, 0, 255), false)
     dxDrawImage(x*1145, y*874, x*47, y*47, "assets/icons/lock.png", 0, 0, 0, tocolor(0, 0, 0, 255), false)
     dxDrawImage(x*868, y*874, x*47, y*47, "assets/icons/lock.png", 0, 0, 0, tocolor(0, 0, 0, 255), false)
     dxDrawImage(x*591, y*874, x*47, y*47, "assets/icons/add.png", 0, 0, 0, tocolor(0, 0, 0, 255), false)
end

addEventHandler("onClientRender", getRootElement(), telaPrinci)


function dxDrawRoundedRectangle(x, y, rx, ry, color, radius)
     rx = rx - radius * 2
     ry = ry - radius * 2
     x = x + radius
     y = y + radius
     if (rx >= 0) and(ry >= 0) then
         dxDrawRectangle(x, y, rx, ry, color)
         dxDrawRectangle(x, y - radius, rx, radius, color)
         dxDrawRectangle(x, y + ry, rx, radius, color)
         dxDrawRectangle(x - radius, y, radius, ry, color)
         dxDrawRectangle(x + rx, y, radius, ry, color)
         dxDrawCircle(x, y, radius, 180, 270, color, color, 7)
         dxDrawCircle(x + rx, y, radius, 270, 360, color, color, 7)
         dxDrawCircle(x + rx, y + ry, radius, 0, 90, color, color, 7)
         dxDrawCircle(x, y + ry, radius, 90, 180, color, color, 7)
     end
end

 

Link to comment
25 minutes ago, Joao_Preis said:

estou criando um script onde ele tem que mostrar uma tela através do onClientRender, porém quando eu inicio o script ele aparece esse erro:

ERROR: Loading script failed: src_accounts2\assets\script\c.lua:11: '(' expected near 'telaPrinci'

meu código:

 

local sW, sH = guiGetScreenSize()
local resW, resH = 1920,1080
local x, y = (sW/resW), (sH/resH)

PersonagensComprar = {
     {0},
     {25},
     {50}
 },

function telaPrinci ()
     dxDrawRectangle(x*26, y*81, x*409, y*871, tocolor(36, 36, 36, 240), false)
     dxDrawRectangle(x*26, y*81, x*409, y*107, tocolor(17, 17, 17, 240), false)
     dxDrawRoundedRectangle(x*492, y*843, x*246, y*109, tocolor(36, 36, 36, 255), 15)
     dxDrawRoundedRectangle(x*769, y*843, x*246, y*109, tocolor(36, 36, 36, 255), 15)
     dxDrawRoundedRectangle(x*1046, y*843, x*246, y*109, tocolor(36, 36, 36, 255), 15)
     dxDrawRoundedRectangle(x*1323, y*843, x*246, y*109, tocolor(36, 36, 36, 255), 15)
     dxDrawImage(x*1694, y*0, x*226, y*205, "assets/icons/Logo.png", 0, 0, 0, tocolor(0, 0, 0, 255), false)
     dxDrawImage(x*1422, y*874, x*47, y*47, "assets/icons/lock.png", 0, 0, 0, tocolor(0, 0, 0, 255), false)
     dxDrawImage(x*1145, y*874, x*47, y*47, "assets/icons/lock.png", 0, 0, 0, tocolor(0, 0, 0, 255), false)
     dxDrawImage(x*868, y*874, x*47, y*47, "assets/icons/lock.png", 0, 0, 0, tocolor(0, 0, 0, 255), false)
     dxDrawImage(x*591, y*874, x*47, y*47, "assets/icons/add.png", 0, 0, 0, tocolor(0, 0, 0, 255), false)
end

addEventHandler("onClientRender", getRootElement(), telaPrinci)


function dxDrawRoundedRectangle(x, y, rx, ry, color, radius)
     rx = rx - radius * 2
     ry = ry - radius * 2
     x = x + radius
     y = y + radius
     if (rx >= 0) and(ry >= 0) then
         dxDrawRectangle(x, y, rx, ry, color)
         dxDrawRectangle(x, y - radius, rx, radius, color)
         dxDrawRectangle(x, y + ry, rx, radius, color)
         dxDrawRectangle(x - radius, y, radius, ry, color)
         dxDrawRectangle(x + rx, y, radius, ry, color)
         dxDrawCircle(x, y, radius, 180, 270, color, color, 7)
         dxDrawCircle(x + rx, y, radius, 270, 360, color, color, 7)
         dxDrawCircle(x + rx, y + ry, radius, 0, 90, color, color, 7)
         dxDrawCircle(x, y + ry, radius, 90, 180, color, color, 7)
     end
end

 

Tem uma virgula após o fechamento da tabela "PersonagensComprar", remova ela.

 

local sW, sH = guiGetScreenSize()
local resW, resH = 1920,1080
local x, y = (sW/resW), (sH/resH)

PersonagensComprar = {
     {0},
     {25},
     {50}
 }

function telaPrinci ()
     dxDrawRectangle(x*26, y*81, x*409, y*871, tocolor(36, 36, 36, 240), false)
     dxDrawRectangle(x*26, y*81, x*409, y*107, tocolor(17, 17, 17, 240), false)
     dxDrawRoundedRectangle(x*492, y*843, x*246, y*109, tocolor(36, 36, 36, 255), 15)
     dxDrawRoundedRectangle(x*769, y*843, x*246, y*109, tocolor(36, 36, 36, 255), 15)
     dxDrawRoundedRectangle(x*1046, y*843, x*246, y*109, tocolor(36, 36, 36, 255), 15)
     dxDrawRoundedRectangle(x*1323, y*843, x*246, y*109, tocolor(36, 36, 36, 255), 15)
     dxDrawImage(x*1694, y*0, x*226, y*205, "assets/icons/Logo.png", 0, 0, 0, tocolor(0, 0, 0, 255), false)
     dxDrawImage(x*1422, y*874, x*47, y*47, "assets/icons/lock.png", 0, 0, 0, tocolor(0, 0, 0, 255), false)
     dxDrawImage(x*1145, y*874, x*47, y*47, "assets/icons/lock.png", 0, 0, 0, tocolor(0, 0, 0, 255), false)
     dxDrawImage(x*868, y*874, x*47, y*47, "assets/icons/lock.png", 0, 0, 0, tocolor(0, 0, 0, 255), false)
     dxDrawImage(x*591, y*874, x*47, y*47, "assets/icons/add.png", 0, 0, 0, tocolor(0, 0, 0, 255), false)
end

addEventHandler("onClientRender", getRootElement(), telaPrinci)


function dxDrawRoundedRectangle(x, y, rx, ry, color, radius)
     rx = rx - radius * 2
     ry = ry - radius * 2
     x = x + radius
     y = y + radius
     if (rx >= 0) and(ry >= 0) then
         dxDrawRectangle(x, y, rx, ry, color)
         dxDrawRectangle(x, y - radius, rx, radius, color)
         dxDrawRectangle(x, y + ry, rx, radius, color)
         dxDrawRectangle(x - radius, y, radius, ry, color)
         dxDrawRectangle(x + rx, y, radius, ry, color)
         dxDrawCircle(x, y, radius, 180, 270, color, color, 7)
         dxDrawCircle(x + rx, y, radius, 270, 360, color, color, 7)
         dxDrawCircle(x + rx, y + ry, radius, 0, 90, color, color, 7)
         dxDrawCircle(x, y + ry, radius, 90, 180, color, color, 7)
     end
end

 

Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...