Jump to content

drk

Members
  • Posts

    1,607
  • Joined

  • Last visited

Everything posted by drk

  1. 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.
  2. 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)
  3. Maybe the file don't exists or boxx variable not exists?
  4. drk

    DirectX Anim

    I think it will not be easy for me I'm using GUI Labels / Image functions, the best for noobs
  5. drk

    MySQL Database.

    No problem. I'm here to help
  6. drk

    help

    Dude, it isn't colorCoded, it's the argument. See in Wiki.
  7. drk

    help

    LOL? Your code file. If it's /redo function see race_voting.lua from Race mode.
  8. drk

    help

    see if argument colorCoded is true color codes have to be server-sided https://wiki.multitheftauto.com/wiki/outputChatBox
  9. drk

    help

    output messages with color codes have to be server-sided. If it's, see if argument colorCoded is true.
  10. 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.
  11. drk

    [Help] Buy map

    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 )
  12. drk

    GUI Table

    'Font for image oO?' My bad haha But it's only a example, you understand. So you understand this? Now, yes.
  13. drk

    GUI Table

    '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?
  14. drk

    GUI Table

    I can use like gui_Table['panel'] to set the image alpha, or use like this to change the font.
  15. drk

    GUI Table

    And if I want to change, example, the font I can use gui_Table['panel'] ? Sorry for being noob, I don't understand.
  16. drk

    GUI Table

    Your code, i'm saying here "What the fuck, what is it" LOL haha I can't use parent variable for guiGetVisible?
  17. It not lags the game.. Not for me.
  18. drk

    GUI Table

    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 )
  19. drk

    help over here.

    Really? Solidsnake has said..
  20. drk

    GUI Table

    No problem Aibo, I can change haha I understand now.
  21. drk

    GUI Table

    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 )
  22. drk

    help over here.

    pairs is for non-indexed tables. I tried with pairs too but it don't worked.
×
×
  • Create New...