Jump to content

2 Questions... T_T


#Paper

Recommended Posts

Why this doesn't work? (Don't show any error)

  
------------------Client Side 
function showHide() 
if guiGetVisible(GUIEditor_Window[1]) == false then 
showCursor(true) 
guiSetVisible(GUIEditor_Window[1], true) 
triggerServerEvent("onGetForPlanel", getLocalPlayer(), getLocalPlayer()) 
else 
showCursor(false) 
guiSetVisible(GUIEditor_Window[1], false) 
end 
end 
bindKey("F7", "down", showHide) 
------------------Server Side 
addEvent("onGetForPlanel", true) 
function getForPanel(thePlayer) 
local theSerial = getPlayerSerial(thePlayer) 
local getRaceAtp = executeSQLSelect("system_racApt", "raceaptemps", "serial='"..theSerial.."'") 
local getRaceW = executeSQLSelect("system_racWin", "racewins", "serial='"..theSerial.."'") 
local getRaceL = executeSQLSelect("system_racLose", "racelose", "serial='"..theSerial.."'") 
triggerClientEvent("onSetText", thePlayer, getRaceW, getRaceL, getRaceAtp) 
end 
addEvent("onGetForPlanel", getRootElement(), getForPanel) 
------------------Client Side 
addEvent("onSetText", true) 
function setText(theW, theL, theA) 
guiSetText(GUIEditor_Label[1], tonumber(theA)) 
guiSetText(GUIEditor_Label[2], tonumber(theW)) 
guiSetText(GUIEditor_Label[3], tonumber(theL)) 
guiSetText(GUIEditor_Label[6], tonumber(getElementData(getLocalPlayer(), "Points"))) 
guiSetText(GUIEditor_Label[7], tonumber(getElementData(getLocalPlayer(), "Money"))) 
guiSetText(GUIEditor_Label[8], tonumber(getElementData(getLocalPlayer(), "Skill Points"))) 
end 
addEventHandler("onSetText", getRootElement(), setText) 

And this other doesn't show any error:

local skins = {0,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,30,31,32,33,34,35,36,37,38,39,40,41,43,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,62,63,64,65,66,67,68,69,70} 
for v,skin in ipairs(skins) do 
row = guiGridListAddRow(GUIEditor_Grid[1]) 
guiGridListSetItemText(GUIEditor_Grid[1], row, clm, tonumber(skin), false, false) 
end 

Link to comment
  • Moderators

--------------------------------------------------------------------------- 1st Script: -------------------------------------------------------------------

Try to replace by this:

triggerClientEvent(thePlayer, "onSetText", getRaceW, getRaceL, getRaceAtp) 

And this (tostring instead of tonumber ):

addEvent("onSetText", true) 
function setText(theW, theL, theA) 
    guiSetText(GUIEditor_Label[1], tostring(theA)) 
    guiSetText(GUIEditor_Label[2], tostring(theW)) 
    guiSetText(GUIEditor_Label[3], tostring(theL)) 
    guiSetText(GUIEditor_Label[6], tostring(getElementData(getLocalPlayer(), "Points"))) 
    guiSetText(GUIEditor_Label[7], tostring(getElementData(getLocalPlayer(), "Money"))) 
    guiSetText(GUIEditor_Label[8], tostring(getElementData(getLocalPlayer(), "Skill Points"))) 
end 
addEventHandler("onSetText", getRootElement(), setText) 

--------------------------------------------------------------------------- 2nd Script: -------------------------------------------------------------------

Here is the tonumber too ! And the true at the end of guiGridListSetItemText ( Not really important ^^ ):

local skins = {0,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,30,31,32,33,34,35,36,37,38,39,40,41,43,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,62,63,64,65,66,67,68,69,70} 
for v,skin in ipairs(skins) do 
    row = guiGridListAddRow(GUIEditor_Grid[1]) 
    guiGridListSetItemText(GUIEditor_Grid[1], row, clm, tostring(skin), false, true) 
end 

clm is your column right ? ( I mean this ( not local ): clm = guiGridListAddColumn ( ... ) )

Link to comment

--------------------------------------------------------------------------- 2nd Script: -------------------------------------------------------------------

Here is the tonumber too ! And the true at the end of guiGridListSetItemText ( Not really important ^^ ):

local skins = {0,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,30,31,32,33,34,35,36,37,38,39,40,41,43,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,62,63,64,65,66,67,68,69,70} 
for v,skin in ipairs(skins) do 
    row = guiGridListAddRow(GUIEditor_Grid[1]) 
    guiGridListSetItemText(GUIEditor_Grid[1], row, clm, tostring(skin), false, true) 
end 

clm is your column right ? ( I mean this ( not local ): clm = guiGridListAddColumn ( ... ) )

Yes, it is :D

EDIT: The 1° script doesn't work

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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