Jump to content

Captain Cody

Members
  • Posts

    2,753
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Captain Cody

  1. Any ways - Just noticed a few things that I skipped by accident client -- function onRegisterKlick ( ) -- ready local username = guiGetText(GUIEditor.edit[3]) local passwort = guiGetText(GUIEditor.edit[4]) if username ~= "" and passwort ~= "" then if exports.dxgui:dxCheckBoxGetSelected ( checkboxM ) == true then triggerServerEvent("register",resourceRoot,username,passwort,true,false) elseif exports.dxgui:dxCheckBoxGetSelected ( checkboxF ) == true then triggerServerEvent("register",resourceRoot,username,passwort,false,true) -- Resource root uses less resources else checksaveM = false checksaveF = false cancelEvent() end end end addEventHandler("onClientDXClick",GUIEditor.button[4],onRegisterKlick,false) function closeLoginPanelR ( ) exports.dxgui:dxSetVisible(GUIEditor.window[2],false) guiSetVisible(GUIEditor.edit[3],false) guiSetVisible(GUIEditor.edit[4],false) showChat(true) setPlayerHudComponentVisible( "radar", true ) end addEvent("closeLoginPanelR",true) addEventHandler("closeLoginPanelR",localPlayer,closeLoginPanelR) server -- function register_func ( username, passwort, checksaveM, checksaveF) local acc = addAccount(username,passwort) if acc then if checksaveM == true then mann_func (client) elseif checksaveF == true then frau_func (client) else cancelEvent() end logIn(client,acc,passwort) triggerClientEvent(client,"closeLoginPanelR",client) else triggerClientEvent(client,"errorMsg2",client) end end addEvent("register",true) addEventHandler("register",resourceRoot,register_func) function mann_func (player) local playeraccount = getPlayerAccount (player) setAccountData (playeraccount, "gen", mann) setElementModel (player, 78) end function frau_func (player) local playeraccount = getPlayerAccount (player) setAccountData (playeraccount, "gen", frau) setElementModel (player, 77) end
  2. Oh it is? From what I've read before. Using the variable client is the most efficient and safest way of sending a player element between server and client.
  3. Captain Cody

    Delete

    As I said, see yeh later PCI, we don't need people such as you in MTA if you're going to act like that.
  4. Server function register_func ( username, passwort, checksaveM, checksaveF) local acc = addAccount(username,passwort) if acc then if checksaveM == true then mann_func (client) elseif checksaveF == true then frau_func (client) else cancelEvent() end logIn(client,acc,passwort) triggerClientEvent(client,"closeLoginPanelR",client) else triggerClientEvent(client,"errorMsg2",client) end end addEvent("register",true) addEventHandler("register",getRootElement(),register_func) function mann_func (player) local playeraccount = getPlayerAccount (player) setAccountData (playeraccount, "gen", mann) setElementModel (player, 78) end function frau_func (player) local playeraccount = getPlayerAccount (player) setAccountData (playeraccount, "gen", frau) setElementModel (player, 77) end Client - function onRegisterKlick ( ) -- ready local username = guiGetText(GUIEditor.edit[3]) local passwort = guiGetText(GUIEditor.edit[4]) if username ~= "" and passwort ~= "" then if exports.dxgui:dxCheckBoxGetSelected ( checkboxM ) == true then checksaveM = true triggerServerEvent("register",getLocalPlayer(),username,passwort,checkSaveM) elseif exports.dxgui:dxCheckBoxGetSelected ( checkboxF ) == true then checksaveF = true triggerServerEvent("register",getLocalPlayer(),username,passwort,checkSaveF) else checksaveM = false checksaveF = false cancelEvent() end end end addEventHandler("onClientDXClick",GUIEditor.button[4],onRegisterKlick,false) function closeLoginPanelR ( ) exports.dxgui:dxSetVisible(GUIEditor.window[2],false) guiSetVisible(GUIEditor.edit[3],false) guiSetVisible(GUIEditor.edit[4],false) showChat(true) setPlayerHudComponentVisible( "radar", true ) end addEvent("closeLoginPanelR",true) addEventHandler("closeLoginPanelR",getRootElement(),closeLoginPanelR) When you trigger a server side event, the player who sent it is predefined as client and using source in different functions WILL NOT WORK unless source is defined in the previous function. Don't send the player through as an individual argument when triggering client events always use (Client) in the server side.
  5. Encrypting is the proper term for it, dear god please get it right.
  6. Yes set element position, sorry wrote that at 11 pm.
  7. try this - (Remove the setElementFrozen) local x,y,z = -- PUT PEDS X,Y,Z cords here function setItsLocation() setElementLocation(ped,x,y,z) end setTimer ( setItsLocation, 50, 1 ) Ever 50 milsecounds it sets the peds locations
  8. Ohh. What does the bug look like?
  9. Set him unfroozen when you make him walk
  10. Try function movePed() if (source == GUIEditor.button[1]) then -- Walk button setPedAnalogControlState (ped, 'forwards', 1) setPedAnalogControlState (ped, 'walk', 1) elseif (source == GUIEditor.button[2]) then -- Sprint button setPedAnalogControlState (ped, 'forwards', 1) setPedAnalogControlState (ped, 'sprint', 1) elseif (source == GUIEditor.button[3]) then -- Stop button setPedAnalogControlState (ped, 'forwards', 0) end end
  11. team = -- PUT TEAM HERE number = -- PUT NUMBER HERE if countPlayersInTeam(team) < number then
  12. Ended up figuring that a bit after I wrote this then having the rewrite most of the SQL functions in the script I was working on because of some issues. But any ways, thank you.
  13. What would be the correct way of doing this, I'm reviving syntax errors with this. executeSQLQuery("DELETE FROM `HeretricsGunStorage` WHERE `location`=? `weapon`=?" , tostring(location),id )
  14. @sankalp21 if you post here again please, put your code in [lua] [ /lua] brackets
  15. The nightly build of MTA helps some with the LODS. But as for all of the textures and what not, have a custom built loading system for this. But due to how it is set up, it would work for any map if that maps ipls were converted correctly. Would just then have to define all of the TXDs DFFs and COLs Edit: I can attempt to convert your map if you want. I have a full loading system and what not set up.
  16. Sorry Missing somethings --Set Team local inValidTeams = {["Militar"] = true} addEvent("AdminPanel.setTeam", true) function setTeam(plr, getText) if plr and isElement(plr) then if getText then local team = getTeamFromName(getText) if not team then team = getText end if inValidTeams[team] then outputChatBox("#00FF00Este arma es solo para #FF0000[ADM]", source, r, g, b, true) return end setPlayerTeam(plr, team, true) outputChatBox("#FF0000" ..getPlayerName(source).."#00FF00 Ha combiar su team a #0B00FF("..team..") ", plr, r, g, b, true) outputChatBox("#00FF00Combiar #FF0000"..getPlayerName(plr).."#00FF00 team a #0B00FF("..team..") ", source, r, g, b, true) end end end addEventHandler("AdminPanel.setTeam", root, setTeam)
  17. --Set Team local inValidTeams = {"Militar" = true} addEvent("AdminPanel.setTeam", true) function setTeam(plr, getText) if plr and isElement(plr) then if getText then local team = getTeamFromName(getText) if not team then team = getText end if inValidTeams[team] then outputChatBox("#00FF00Este arma es solo para #FF0000[ADM]", source, r, g, b, true) return end setPlayerTeam(plr, team, true) outputChatBox("#FF0000" ..getPlayerName(source).."#00FF00 Ha combiar su team a #0B00FF("..team..") ", plr, r, g, b, true) outputChatBox("#00FF00Combiar #FF0000"..getPlayerName(plr).."#00FF00 team a #0B00FF("..team..") ", source, r, g, b, true) end end end addEventHandler("AdminPanel.setTeam", root, setTeam)
  18. Can you provide a clearer explanation of what you want?
  19. Ah the heck with it, I'm tired some one fix it.
  20. Because there are other things that this depends on
×
×
  • Create New...