SkatCh

Members
  • Content Count

    366
  • Joined

  • Last visited

Everything posted by SkatCh

  1. Show me your GUI. also here : addEventHandler("OnClientGUIClick", root, buttonHandling) it should be like this: addEventHandler("onClientGUIClick", root, buttonHandling)
  2. You need to add un other end : addEventHandler('onClientPlayerJoin', root, function () local flag = exports.admin:getPlayerCountry ( source ) if flag then AddingS("join", getPlayerName(source).."#FFFFFF has joined the game#FF4000[#FFFFFF :admin/client/images/flags/"..flag..".png #FF4000]") else flag = "N/A" end end )
  3. ??? all what you need is function jump() local vehicle = getPedOccupiedVehicle(localPlayer) local Controller = getVehicleController ( localPlayer ) if getVehicleController(getPedOccupiedVehicle(localPlayer)) == localPlayer then if ( isElement(vehicle) ) and (isVehicleOnGround( vehicle )) then local sx,sy,sz = getElementVelocity ( vehicle ) setElementVelocity( vehicle ,sx, sy, sz+0.7) end end end bindKey ( "z","down", jump)
  4. you can use this function isPlayerInACL ( player, acl ) local account = getPlayerAccount ( player ) if ( isGuestAccount ( account ) ) then return false end return isObjectInACLGroup ( "user."..getAccountName ( account ), aclGetGroup ( acl ) ) end
  5. SkatCh

    Water level

    addCommandHandler( "waterlevel", function ( plr, cmd, newlevel ) if not newlevel then outputChatBox("Please type the level you want",plr,255,0,0) return end if newlevel and tonumber ( newlevel ) then setWaterLevel( tonumber( newlevel ) ); outputChatBox("Water level successfully change to "..newlevel,plr,255,0,0) return end end );
  6. SkatCh

    Area Name in alpha

    local alpha = 150 setTimer( function () if (dx ) then destroyElement(dx) end local playerX, playerY, playerZ = getElementPosition( getLocalPlayer()) local playerZoneName = getZoneName( playerX, playerY, playerZ ) local dx = dxDrawRectangle(sW*70, sH*1355/2, sW*150, sH*35/2, tocolor(0, 0, 0, alpha), false) dxDrawBorderedText(playerZoneName,sW*75, sH*1360/2, sW*515/2, sH*30/2,tocolor(255,255,255,alpha),1.0,"default-bold","left","top",false,false,false) alpha = alpha + 1 if ( alpha >= 254 ) then alpha = 0 end end,10000,0)
  7. Yes you can just change the postGUI value to true.
  8. SkatCh

    [Help] Bind Key

    function reczny1 ( player ) local auto = getPedOccupiedVehicle ( player ) if auto then if isElementFrozen ( auto ) then setElementFrozen ( auto, false ) outputChatBox ( "Freno de mano liberado", player, 0, 0, 125 ) exports.chat:me( player, "quita el freno de mano.") else setElementFrozen ( auto, true ) outputChatBox ( "((Freno de mano puesto", player, 0, 0, 125 ) exports.chat:me( player, "pone el freno de mano.") end else outputChatBox ( "((No estás en un vehiculo))", player, 255, 0, 0 ) end end addCommandHandler ( "frenodemano", reczny1 ) bindKey ("num_0", "down", reczny1)
  9. Why you need to use 2 function ??? addEventHandler('onClientPlayerJoin', root, function () local flag = exports.admin:getPlayerCountry ( source ) if flag then AddingS("join", getPlayerName(source).." has joined the game":admin/client/images/flags/"..flag..".png") else flag = "N/A" end )
  10. lol just add this ')' . function vehicleJump() bindKey(source, "z", "down", "jump", -- like this bindKey(source, "z", "down", jump) local vehicle = getPedOccupiedVehicle(source) if (isVehicleOnGround(vehicle) == true) then local sx,sy,sz = getElementVelocity(vehicle) setElementVelocity(vehicle ,sx, sy, sz+0.4) end end ) addEvent("onSpecialEvent", true) addEventHandler("onSpecialEvent", root, vehicleJump)
  11. SkatCh

    Editor

    Simply try to use TCT resource.
  12. -- Server Side addCommandHandler ( "lock", function(player) if not isPedInVehicle ( player ) then return end local veh = getPedOccupiedVehicle ( player ) setVehicleLocked ( veh , not isVehicleLocked ( veh ) ) triggerClientEvent(player,"playSound",player) end) -- Client side addEvent("playSound", true) addEventHandler("playSound",getRootElement(), function () local volume = 1.0 -- 100% local LoginSound = playSound ( "Sound/...........mp3" ) setSoundVolume(LoginSound, volume) end)
  13. here you go : addCommandHandler ( "lock", function(player) if not isPedInVehicle ( player ) then return end local veh = getPedOccupiedVehicle ( player ) setVehicleLocked ( veh , not isVehicleLocked ( veh ) ) local sound = playSound("sounds/............mp3") --Play from the sounds folder setSoundVolume(sound, 0.5) -- set the sound volume to 50% end)
  14. You must add an other end to close the function that's all : local gateOpen = false function createTheGate1 () myGate1 = createObject ( 987, 2500.7998046875, -1520.400390625, 22.700000762939, 270, 90, 90 ) myGate2 = createObject ( 987, 2500.7998046875, -1525.400390625, 22.700000762939, 270, 90, 90 ) myGate3 = createObject ( 987, 2500.7998046875, -1531.2001953125, 22.700000762939, 270, 90, 90 ) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate1 ) function openMyGate1 () if (gateOpen == false) then moveObject ( myGate1, 1500, 2500.7998046875, -1520.400390625, 19.5, 0, 0, 0 ) moveObject ( myGate2, 1500, 2500.7998046875, -1525.400390625, 17.700000762939, 0, 0, 0 ) moveObject ( myGate3, 1500, 2500.7998046875, -1531.2001953125, 16, 0, 0, 0 ) gateOpen = true else moveObject ( myGate1, 1500, 2500.7998046875, -1520.400390625, 22.700000762939, 0, 0, 0 ) moveObject ( myGate2, 1500, 2500.7998046875, -1525.400390625, 22.700000762939, 0, 0, 0 ) moveObject ( myGate3, 1500, 2500.7998046875, -1531.2001953125, 22.700000762939, 0, 0, 0 ) gateOpen = false end end addCommandHandler("yourcommand",openMyGate1)
  15. Try to use colshape example : local LS = createColRectangle (-800.81671, -2990.10657, 5100, 3330) function LSzone ( thePlayer ) if getElementType ( thePlayer ) == "player" then -- if the element that left was player killPlayer ( thePlayer ) -- kill the player outputChatBox ( "You are not allowed to leave Los Santos!", thePlayer ) end end addEventHandler ( "onColShapeLeave", LS, LSzone )
  16. bro i already fixed it, Thank you anyway
  17. SkatCh

    outputChatBox

    it's just an advice so yes the last code is the most efficient way possible.
  18. SkatCh

    outputChatBox

    you must read the conclusion : Conclusion: Don't use pairs() or ipairs() in critical code! Try to save the table-size somewhere and use for i=1,x do!
  19. yes i know it's the only one solution because there is no function make the player exit the game.
  20. SkatCh

    outputChatBox

    as i told you ipairs is for indexed tables, it means every item <<<<>>>> in the table has it's own number: 1 is the index of the first value 2 is the index ot the second's and so on: local table1 = { 1, 2, 3, 4 } -- First type local table2 = { [1] = 1, [2] = 2, [3] = 3,[4] = 4} -- Second type for i, v in ipairs( table1 ) do --both pairs and ipairs will work in those tables: for i, v in pairs( table1 ) do but if you have a table like this local table = { ["Yes"] = 1, [1] = "Table", ["example"] = 2014, [2] = "me", } -- ipairs won't work in this case. So try to use pairs all the time.
  21. function Save () if not ( isGuestAccount(getPlayerAccount( source ) ) ) then local money = getPlayerMoney( source ) local occupation = getElementData( source, "Occupation") local team = getPlayerTeam( source ) local teamname = getTeamName( team ) local x,y,z = getElementPosition( source ) local dimension = getElementDimension( source ) local interior = getElementInterior( source ) local skin = getElementModel( source ) local account = getPlayerAccount( source ) local accountname = getAccountName( account ) local save = mysql_query(moduledb,"UPDATE playerinfo SET money=?, occupation=?, team=?, wanted=?, x=?, y=?, z=?, interior=?, dimension=?, skin=?, account=?, accountName=?" ,money ,occupation ,team ,wanted ,x ,y ,z ,interior ,dimension ,skin ,account ,accountname ) end end addEventHandler ( "onPlayerQuit", root, Save )
  22. addEventHandler("onClientResourceStart", resourceRoot, function() Window = guiCreateWindow(188, 157, 452, 187, "", false) guiWindowSetSizable(Window, false) guiSetVisible (window ,false) label = guiCreateLabel(20, 35, 103, 28, "Character Name :", false, Window) edit = guiCreateEdit(128, 31, 166, 26, "Firstname_Lastname", false, Window) button = guiCreateButton(343, 139, 94, 38, "Spawn", false, Window) end )
  23. You can use this : redirectPlayer(player,"",0)