
drk
Members-
Posts
1,607 -
Joined
-
Last visited
Everything posted by drk
-
I'm trying to save profile data ( player type the data in the memos and I want to save it in the SQL by the account name ) but when I restart the resource the data don't appear in the memo The code: Client: addEventHandler('onClientGUIClick',root, function() if source == profile['save_label'] then triggerServerEvent('onClickSave',localPlayer,getPlayerName(localPlayer),guiGetText(profile['name_memo']),guiGetText(profile['birthday_m']),guiGetText(profile['birthday_d']),guiGetText(profile['birthday_y']),guiGetText(profile['mail_memo'])) triggerServerEvent('onSaveSettings',localPlayer) end end ) addEventHandler('onLoginLoad',root, function(name,month,day,year,mail) guiSetText(profile['name_memo'],name) guiSetText(profile['birthday_m'],month) guiSetText(profile['birthday_d'],day) guiSetText(profile['birthday_y'],year) guiSetText(profile['mail_memo'],mail) end ) Server: local table = executeSQLQuery("CREATE TABLE IF NOT EXISTS Profile ( player TEXT, name TEXT, month NUMBER, day NUMBER, year NUMBER, mail TEXT )") addEvent('onSaveOutput',true) addEvent('onClickSave',true) addEventHandler('onSaveOutput',root, function() outputChatBox('#ABCDEF* #ffffffYour settings have been saved!',source,255,255,255,true) end ) addEventHandler('onPlayerLogin',root, function() local select = executeSQLQuery("SELECT * FROM Profile WHERE player = '"..getAccountName(getPlayerAccount(source)).."'") if not result or #result == 0 then local result = executeSQLQuery("INSERT INTO Profile VALUES ( '"..getAccountName(getPlayerAccount(source)).."', '', 'Month', 'Day', 'Year', '' )") else local resultt = executeSQLQuery("SELECT * FROM Profile WHERE player = "..getAccountName(getPlayerAccount(source)).."'") triggerClientEvent('onLoginLoad',source,tostring(resultt[1]['name']),tostring(resultt[1]['month']),tostring(resultt[1]['day']),tostring(resultt[1]['year']),tostring(resultt[1]['mail'])) end end ) addEventHandler('onClickSave',root, function(thePlayer,name,month,day,year,mail) local update = executeSQLQuery("UPDATE Profile SET name='"..name.."', month='"..month.."', day='"..day.."', year='"..year.."', mail='"..mail.."' WHERE player='"..getAccountName(getPlayerAccount(source)).."'") triggerEvent('onSaveOutput',source) end ) I get no errors.
-
Maybe because you are setting the player position, not the vehicle? function teleport_areabase_gate1(thePlayer,hitElement) local skin = getElementModel(thePlayer) if skin == 130 or skin == 160 then if source == marker_areabase_gate_in then local vehicle = getPedOccupiedVehicle(thePlayer) if vehicle then setElementPosition(vehicle,2509.3999023438, 2773.5, 11,false) else setElementPosition(thePlayer,2509.3999023438, 2773.5, 11,false) end end end end addEventHandler('onMarkerHit',root,teleport_areabase_gate1)
-
Maybe the file don't exists or boxx variable not exists?
-
I think it will not be easy for me I'm using GUI Labels / Image functions, the best for noobs
-
addCommandHandler ( "jetpack", function () local playerTeam = getPlayerTeam ( source ) if not playerTeam then return end local name = getTeamName ( playerTeam ) if name == "Owner" or name == "Admin" then local px, py, pz = getElementPosition ( source ) createPickup ( px, py, pz, "3", "370", "30000" ) end end ) You have to be a team member. If not, function return end. Next time use lua code tags.
-
Stop. Create a .lua file and put the code in. Save it. Then create a meta.xml like <meta> <script src="yourfilename.lua" type="server" /> </meta> And put it in your server resources folder. ( put the files in a folder or zip file )
-
'Font for image oO?' My bad haha But it's only a example, you understand. So you understand this? Now, yes.
-
'Font for image oO?' My bad haha But it's only a example, you understand. But If I want to set a font to a label in the main function can you show me a example?
-
I can use like gui_Table['panel'] to set the image alpha, or use like this to change the font.
-
And if I want to change, example, the font I can use gui_Table['panel'] ? Sorry for being noob, I don't understand.
-
Your code, i'm saying here "What the fuck, what is it" LOL haha I can't use parent variable for guiGetVisible?
-
It not lags the game.. Not for me.
-
Can you explain me this: return panel end; __visible = function( el,state ) return guiSetVisible( el, state ) end; __destroy = function( el ) if isElement( el ) then return destroyElement( el ) end return false end; } local parent = gui_Table.__main( ) gui_Table.__visible( parent,false )
-
Really? Solidsnake has said..
-
No problem Aibo, I can change haha I understand now.
-
I don't want to someone fix it.. Only to explain me how to add gui elements into a table and using the table name to show / hide the elements like in race mode ( race_client.lua )
-
pairs is for non-indexed tables. I tried with pairs too but it don't worked.