Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Means that "hou" is returning false or nil.
  2. function MarkerHit1 ( player ) local playerGang = getElementData ( player, "gang" ) local turfGang = getElementData ( marker1, "getTurfGang" ) if ( turfGang == playerGang ) then outputChatBox ( "Esta base ya pertence a ".. turfGang, player, 0, 255, 0, false ) else if ( not getPlayerTeam ( player ) ) then return end local team = getPlayerTeam ( player ) if ( getTeamName ( team ) == "geral" ) then local playerGang = getElementData ( player, "gang" ) if ( playerGang ) then if ( isTimer ( beachturfTimer ) ) then return end if ( turfGang ~= playerGang ) then if isTimer ( floodTimer ) then return else outputChatBox ( "[ALERTA]Estan tomando la base en ".. getElementZoneName ( marker1 ) ..",".. getElementZoneName ( marker1, true ) ) floodTimer = setTimer ( function ( ) end, 5000, 1 ) end end local r, g, b = unpack ( exports [ "gang_system" ]:getGangColor ( playerGang ) ) local turfGang = getElementData ( marker1, "getTurfGang" ) if ( turfGang ) then outputChatBox ( "Entraste En La Base de ".. turfGang ..". Espera 2 Minutos Para Poder Conquistar la base Y Ganar la base", player, 0, 255, 0, false ) else outputChatBox ( "Esta base Aun No Pertenese A Nadie. Espera 2 Minutos Para Poder Conquistarla", player, 0, 255, 0, false ) end beachturfTimer1 = setTimer ( function ( ) if isElementWithinMarker ( player, marker1 ) then setMarkerColor ( marker1, tonumber ( r ), tonumber ( g ), tonumber ( b ), 100 ) outputChatBox ( "Felicidades Conquistaste la base!", player, 0, 255, 0, false ) triggerClientEvent ( "onTakeTurf", player ) givePlayerMoney ( player, 4000 ) setElementData ( marker1, "getTurfGang", playerGang ) setCameraMatrix ( player, 1939.5476074219, -2162.421875, 39.010345458984, 1961.9000244141, -2214.6000976563, 16.10000038147, 0, 70 ) setTimer ( function ( player ) if isElement ( player ) then setCameraTarget ( player ) end end ,5000, 1, player ) -- here behind setElementData ( player, ItemAzar [ math.random ( 1, #ItemAzar ) ], 1 ) end end ,3000, 1 ) end end end end addEventHandler ( "onMarkerHit", marker1, MarkerHit1 ) Try it.
  3. Why are you putting it outside the function of capture then?
  4. That's because "player" is not defined anywhere.
  5. Los scripts client y server side no comparten las variables/tablas/etc.
  6. Definir una variable como local dentro de una funcion hara que no puedas usarla fuera de la misma, lo mismo con los scripts dentro del mismo recurso, si definis algo como local como una funcion, no podras usarla en otro script dentro del mismo recurso.
  7. I had it laying around, made it long time ago. You're welcome.
  8. Castillo

    help!

    You'll have to make part of it server side. Use this functions server side and trigger to client to enable/disable: getPlayerAccount getAccountName isObjectInACLGroup
  9. Just do: if ( hou >= 30 ) then -- Do your thing here. end
  10. No problem, send the link over PM, I'll check it tomorrow.
  11. -- client side: local Superman = {} -- Settings local ZERO_TOLERANCE = 0.00001 local MAX_ANGLE_SPEED = 6 -- In degrees per frame local MAX_SPEED = 1.0 local EXTRA_SPEED_FACTOR = 1.85 local LOW_SPEED_FACTOR = 0.40 local ACCELERATION = 0.025 local EXTRA_ACCELERATION_FACTOR = 1.8 local LOW_ACCELERATION_FACTOR = 0.85 local TAKEOFF_VELOCITY = 1.75 local TAKEOFF_FLIGHT_DELAY = 750 local SMOKING_SPEED = 1.25 local GROUND_ZERO_TOLERANCE = 0.18 local LANDING_DISTANCE = 3.2 local FLIGHT_ANIMLIB = "swim" local FLIGHT_ANIMATION = "Swim_Dive_Under" local FLIGHT_ANIM_LOOP = false local IDLE_ANIMLIB = "cop_ambient" local IDLE_ANIMATION = "Coplook_loop" local IDLE_ANIM_LOOP = true local MAX_Y_ROTATION = 55 local ROTATION_Y_SPEED = 3.8 -- Static global variables local thisResource = getThisResource() local rootElement = getRootElement() local localPlayer = getLocalPlayer() local serverGravity = getGravity() -- -- Utility functions -- local function isPlayerFlying(player) local data = getElementData(player, "superman:flying") if not data or data == false then return false else return true end end local function setPlayerFlying(player, state) if state == true then state = true else state = false end setElementData(player, "superman:flying", state) end local function iterateFlyingPlayers() local current = 1 local allPlayers = getElementsByType("player") return function() local player repeat player = allPlayers[current] current = current + 1 until not player or (isPlayerFlying(player) and isElementStreamedIn(player)) return player end end function Superman:restorePlayer(player) setPlayerFlying(player, false) setPedAnimation(player, false) setElementVelocity(player, 0, 0, 0) setElementRotation(player, 0, 0, 0) --setPedRotation(player, getPedRotation(player)) setElementCollisionsEnabled(player, true) self:destroySmokeGenerators(player) self.rotations[player] = nil self.previousVelocity[player] = nil end function Superman:createSmokeGenerator(player) local generator = createObject(2780, getElementPosition(player)) setElementCollisionsEnabled(generator, false) setObjectScale(generator, 0) return generator end function Superman:createSmokeGenerators(player) if not self.smokeGenerators[player] then local smokeGenerators = {} smokeGenerators[1] = self:createSmokeGenerator(player) attachElements(smokeGenerators[1], player, 0.75, -0.2, -0.4, -40, 0, 60) smokeGenerators[2] = self:createSmokeGenerator(player) attachElements(smokeGenerators[2], player, -0.75, -0.2, -0.4, -40, 0, -60) self.smokeGenerators[player] = smokeGenerators end end function Superman:destroySmokeGenerators(player) if self.smokeGenerators[player] then for k, v in ipairs(self.smokeGenerators[player]) do destroyElement(v) end self.smokeGenerators[player] = nil end end function angleDiff(angle1, angle2) angle1, angle2 = angle1 % 360, angle2 % 360 local diff = (angle1 - angle2) % 360 if diff <= 180 then return diff else return -(360 - diff) end end local function isElementInWater(ped) local pedPosition = Vector3D:new(getElementPosition(ped)) if pedPosition.z <= 0 then return true end local waterLevel = getWaterLevel(pedPosition.x, pedPosition.y, pedPosition.z) if not isElementStreamedIn(ped) or not waterLevel or waterLevel < pedPosition.z then return false else return true end end local function isnan(x) math.inf = 1/0 if x == math.inf or x == -math.inf or x ~= x then return true end return false end local function getVector2DAngle(vec) if vec.x == 0 and vec.y == 0 then return 0 end local angle = math.deg(math.atan(vec.x / vec.y)) + 90 if vec.y < 0 then angle = angle + 180 end return angle end -- -- Initialization and shutdown functions -- function Superman.Start() local self = Superman -- Register events addEventHandler("onClientResourceStop", getResourceRootElement(thisResource), Superman.Stop, false) addEventHandler("onPlayerJoin", rootElement, Superman.onJoin) addEventHandler("onPlayerQuit", rootElement, Superman.onQuit) addEventHandler("onClientRender", rootElement, Superman.processControls) addEventHandler("onClientRender", rootElement, Superman.processFlight) addEventHandler("onClientPlayerDamage", localPlayer, Superman.onDamage, false) addEventHandler("onClientElementDataChange", rootElement, Superman.onDataChange) addEventHandler("onClientElementStreamIn", rootElement, Superman.onStreamIn) addEventHandler("onClientElementStreamOut", rootElement, Superman.onStreamOut) -- Initializate attributes self.smokeGenerators = {} self.rotations = {} self.previousVelocity = {} end addEventHandler("onClientResourceStart", getResourceRootElement(thisResource), Superman.Start, false) function Superman.Stop() local self = Superman setGravity(serverGravity) -- Restore all players animations, collisions, etc for player in iterateFlyingPlayers() do self:restorePlayer(player) end end -- -- Join/Quit -- function Superman.onJoin(player) local self = Superman local player = player or source setPlayerFlying(player, false) end function Superman.onQuit(reason, player) local self = Superman local player = player or source if isPlayerFlying(player) then self:restorePlayer(player) end end -- -- onDamage: superman is invulnerable -- function Superman.onDamage() local self = Superman if isPlayerFlying(localPlayer) then cancelEvent() end end -- -- onStreamIn: Reset rotation attribute for player -- function Superman.onStreamIn() local self = Superman end function Superman.onStreamOut() local self = Superman if source and isElement(source) and getElementType(source) == "player" and isPlayerFlying(source) then self.rotations[source] = nil self.previousVelocity[source] = nil end end -- -- onDataChange: Check if somebody who is out of stream stops being superman -- function Superman.onDataChange(dataName, oldValue) local self = Superman if dataName == "superman:flying" and isElement(source) and getElementType(source) == "player" and oldValue ~= getElementData(source, dataName) and oldValue == true and getElementData(source, dataName) == false then self:restorePlayer(source) end end -- -- onJump: Combo to start flight without any command -- function Superman.onJump(key, keyState) local self = Superman local task = getPedSimplestTask(localPlayer) if not isPlayerFlying(localPlayer) then if task == "TASK_SIMPLE_IN_AIR" then
  12. Ah, yes, found the problem, use this, it works. local pbags = { { 2293.154296875, 561.470703125, 7.78125 }, } local marker = createMarker ( 2291.1999511719, 537, 0.80000001192093, "cylinder", 1.5, 255, 0, 0 ) function createBags ( thePlayer ) local x, y, z = unpack ( pbags [ math.random ( #pbags ) ] ) local bag = createPickup ( x, y, z, 3, 1550 ) addEventHandler ( "onPickupHit", bag, onPickupHit ) end addEventHandler ( "onResourceStart", getRootElement(), createBags ) function onPickupHit ( thePlayer ) if ( isPedInVehicle ( thePlayer ) ) then return end local bag = createObject ( 1550, 0, 0, 0 ) setElementData ( thePlayer, "bag", true ) setElementCollisionsEnabled ( bag, false ) attachElements ( bag, thePlayer, 0, -0.3, 0.3 ) end
  13. You used server side functions on a client side script, that won't work.
  14. @TAPL: He wants to remove a player from its current team. @Paplo: Use this: setPlayerTeam ( source, nil )
  15. Upload entire resource to mediafire.com and post the link.
  16. --[[------------------------------------------------- Notes: > This code is using a relative image filepath. This will only work as long as the location it is from always exists, and the resource it is part of is running. To ensure it does not break, it is highly encouraged to move images into your local resource and reference them there. --]]------------------------------------------------- GUIEditor = { tab = {}, staticimage = {}, tabpanel = {}, edit = {}, button = {}, window = {}, label = {}, checkbox = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(0, 0, 1024, 768, "[Register & Login Panel] [ System By LiOneLMeSsI]", false) guiWindowSetMovable(GUIEditor.window[1], false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 1.00) GUIEditor.staticimage[1] = guiCreateStaticImage(9, 0, 1005, 758, ":Login_System/images/Zombie.png", false, GUIEditor.window[1]) GUIEditor.tabpanel[1] = guiCreateTabPanel(321, 236, 381, 281, false, GUIEditor.staticimage[1]) guiSetAlpha(GUIEditor.tabpanel[1], 0.60) GUIEditor.tab[1] = guiCreateTab("Login", GUIEditor.tabpanel[1]) GUIEditor.label[1] = guiCreateLabel(0, 66, 60, 16, "Username:", false, GUIEditor.tab[1]) guiSetFont(GUIEditor.label[1], "default-bold-small") GUIEditor.label[2] = guiCreateLabel(0, 92, 60, 16, "Password:", false, GUIEditor.tab[1]) guiSetFont(GUIEditor.label[2], "default-bold-small") GUIEditor.edit[1] = guiCreateEdit(61, 64, 187, 24, "", false, GUIEditor.tab[1]) GUIEditor.edit[2] = guiCreateEdit(61, 88, 187, 24, "", false, GUIEditor.tab[1]) guiEditSetMasked(GUIEditor.edit[2], true) GUIEditor.button[1] = guiCreateButton(167, 113, 81, 45, "Login", false, GUIEditor.tab[1]) guiSetFont(GUIEditor.button[1], "sa-header") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFE0000") GUIEditor.checkbox[1] = guiCreateCheckBox(61, 112, 104, 22, "Save Details", true, false, GUIEditor.tab[1]) GUIEditor.tab[2] = guiCreateTab("Register", GUIEditor.tabpanel[1]) GUIEditor.label[3] = guiCreateLabel(56, 15, 60, 18, "Username:", false, GUIEditor.tab[2]) guiSetFont(GUIEditor.label[3], "default-bold-small") GUIEditor.label[4] = guiCreateLabel(56, 44, 60, 18, "Password:", false, GUIEditor.tab[2]) guiSetFont(GUIEditor.label[4], "default-bold-small") GUIEditor.label[5] = guiCreateLabel(12, 73, 104, 15, "Confirm Password:", false, GUIEditor.tab[2]) guiSetFont(GUIEditor.label[5], "default-bold-small") GUIEditor.edit[3] = guiCreateEdit(144, 15, 135, 24, "", false, GUIEditor.tab[2]) GUIEditor.edit[4] = guiCreateEdit(144, 44, 135, 24, "", false, GUIEditor.tab[2]) guiEditSetMasked(GUIEditor.edit[4], true) GUIEditor.edit[5] = guiCreateEdit(144, 73, 135, 24, "", false, GUIEditor.tab[2]) guiEditSetMasked(GUIEditor.edit[5], true) GUIEditor.button[2] = guiCreateButton(154, 98, 127, 56, "Register", false, GUIEditor.tab[2]) guiSetFont(GUIEditor.button[2], "sa-header") guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFE0000") GUIEditor.window[2] = guiCreateWindow(0, 0, 1024, 768, "[Register & Login Panel] [ System By LiOneLMeSsI]", false) guiWindowSetMovable(GUIEditor.window[2], false) guiWindowSetSizable(GUIEditor.window[2], false) guiSetAlpha(GUIEditor.window[2], 1.00) GUIEditor.staticimage[2] = guiCreateStaticImage(9, 0, 1005, 758, ":Login_System/images/Zombie.png", false, GUIEditor.window[2]) GUIEditor.tabpanel[2] = guiCreateTabPanel(321, 236, 381, 281, false, GUIEditor.staticimage[2]) guiSetAlpha(GUIEditor.tabpanel[2], 0.60) GUIEditor.tab[3] = guiCreateTab("Login", GUIEditor.tabpanel[2]) GUIEditor.label[6] = guiCreateLabel(0, 66, 60, 16, "Username:", false, GUIEditor.tab[3]) guiSetFont(GUIEditor.label[6], "default-bold-small") GUIEditor.label[7] = guiCreateLabel(0, 92, 60, 16, "Password:", false, GUIEditor.tab[3]) guiSetFont(GUIEditor.label[7], "default-bold-small") GUIEditor.edit[6] = guiCreateEdit(61, 64, 187, 24, "", false, GUIEditor.tab[3]) GUIEditor.edit[7] = guiCreateEdit(61, 88, 187, 24, "", false, GUIEditor.tab[3]) guiEditSetMasked(GUIEditor.edit[7], true) GUIEditor.button[3] = guiCreateButton(167, 113, 81, 45, "Login", false, GUIEditor.tab[3]) guiSetFont(GUIEditor.button[3], "sa-header") guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFFE0000") GUIEditor.checkbox[2] = guiCreateCheckBox(61, 112, 104, 22, "Save Details", false, false, GUIEditor.tab[3]) GUIEditor.staticimage[3] = guiCreateStaticImage(0, 0, 381, 66, ":Login_System/images/Zombie1.png", false, GUIEditor.tab[3]) guiSetAlpha(GUIEditor.staticimage[3], 0.60) GUIEditor.staticimage[4] = guiCreateStaticImage(0, 191, 381, 66, ":Login_System/images/Zombie1.png", false, GUIEditor.tab[3]) guiSetAlpha(GUIEditor.staticimage[4], 0.60) GUIEditor.tab[4] = guiCreateTab("Register", GUIEditor.tabpanel[2]) GUIEditor.label[8] = guiCreateLabel(56, 15, 60, 18, "Username:", false, GUIEditor.tab[4]) guiSetFont(GUIEditor.label[8], "default-bold-small") GUIEditor.label[9] = guiCreateLabel(56, 44, 60, 18, "Password:", false, GUIEditor.tab[4]) guiSetFont(GUIEditor.label[9], "default-bold-small") GUIEditor.label[10] = guiCreateLabel(12, 73, 104, 15, "Confirm Password:", false, GUIEditor.tab[4]) guiSetFont(GUIEditor.label[10], "default-bold-small") GUIEditor.edit[8] = guiCreateEdit(144, 15, 135, 24, "", false, GUIEditor.tab[4]) GUIEditor.edit[9] = guiCreateEdit(144, 44, 135, 24, "", false, GUIEditor.tab[4]) guiEditSetMasked(GUIEditor.edit[9], true) GUIEditor.edit[10] = guiCreateEdit(144, 73, 135, 24, "", false, GUIEditor.tab[4]) guiEditSetMasked(GUIEditor.edit[10], true) GUIEditor.button[4] = guiCreateButton(154, 98, 127, 56, "Register", false, GUIEditor.tab[4]) guiSetFont(GUIEditor.button[4], "sa-header") guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFFE0000") GUIEditor.staticimage[5] = guiCreateStaticImage(2, 154, 379, 103, ":Login_System/images/Zombie1.png", false, GUIEditor.tab[4]) guiSetAlpha(GUIEditor.staticimage[5], 0.60) GUIEditor.window[3] = guiCreateWindow(0, 0, 1024, 768, "[Register & Login Panel] [ System By LiOneLMeSsI]", false) guiWindowSetMovable(GUIEditor.window[3], false) guiWindowSetSizable(GUIEditor.window[3], false) guiSetAlpha(GUIEditor.window[3], 1.00) GUIEditor.staticimage[6] = guiCreateStaticImage(9, 0, 1005, 758, ":Login_System/images/Zombie.png", false, GUIEditor.window[3]) GUIEditor.tabpanel[3] = guiCreateTabPanel(321, 236, 381, 281, false, GUIEditor.staticimage[6]) guiSetAlpha(GUIEditor.tabpanel[3], 0.60) GUIEditor.tab[5] = guiCreateTab("Login", GUIEditor.tabpanel[3]) GUIEditor.label[11] = guiCreateLabel(0, 66, 60, 16, "Username:", false, GUIEditor.tab[5]) guiSetFont(GUIEditor.label[11], "default-bold-small") GUIEditor.label[12] = guiCreateLabel(0, 92, 60, 16, "Password:", false, GUIEditor.tab[5]) guiSetFont(GUIEditor.label[12], "default-bold-small") GUIEditor.edit[11] = guiCreateEdit(61, 64, 187, 24, "", false, GUIEditor.tab[5]) GUIEditor.edit[12] = guiCreateEdit(61, 88, 187, 24, "", false, GUIEditor.tab[5]) guiEditSetMasked(GUIEditor.edit[12], true) GUIEditor.button[5] = guiCreateButton(167, 113, 81, 45, "Login", false, GUIEditor.tab[5]) guiSetFont(GUIEditor.button[5], "sa-header") guiSetProperty(GUIEditor.button[5], "NormalTextColour", "FFFE0000") GUIEditor.checkbox[3] = guiCreateCheckBox(61, 112, 104, 22, "Save Details", true, false, GUIEditor.tab[5]) GUIEditor.tab[6] = guiCreateTab("Register", GUIEditor.tabpanel[3]) GUIEditor.label[13] = guiCreateLabel(56, 15, 60, 18, "Username:", false, GUIEditor.tab[6]) guiSetFont(GUIEditor.label[13], "default-bold-small") GUIEditor.label[14] = guiCreateLabel(56, 44, 60, 18, "Password:", false, GUIEditor.tab[6]) guiSetFont(GUIEditor.label[14], "default-bold-small") GUIEditor.label[15] = guiCreateLabel(12, 73, 104, 15, "Confirm Password:", false, GUIEditor.tab[6]) guiSetFont(GUIEditor.label[15], "default-bold-small") GUIEditor.edit[13] = guiCreateEdit(144, 15, 135, 24, "", false, GUIEditor.tab[6]) GUIEditor.edit[14] = guiCreateEdit(144, 44, 135, 24, "", false, GUIEditor.tab[6]) guiEditSetMasked(GUIEditor.edit[14], true) GUIEditor.edit[15] = guiCreateEdit(144, 73, 135, 24, "", false, GUIEditor.tab[6]) guiEditSetMasked(GUIEditor.edit[15], true) GUIEditor.button[6] = guiCreateButton(154, 98, 127, 56, "Register", false, GUIEditor.tab[6]) guiSetFont(GUIEditor.button[6], "sa-header") guiSetProperty(GUIEditor.button[6], "NormalTextColour", "FFFE0000") GUIEditor.window[4] = guiCreateWindow(0, 0, 1024, 768, "[Register & Login Panel] [ System By LiOneLMeSsI]", false) guiWindowSetMovable(GUIEditor.window[4], false) guiWindowSetSizable(GUIEditor.window[4], false) guiSetAlpha(GUIEditor.window[4], 1.00) GUIEditor.staticimage[7] = guiCreateStaticImage(9, 0, 1005, 758, ":Login_System/images/Zombie.png", false, GUIEditor.window[4]) GUIEditor.tabpanel[4] = guiCreateTabPanel(321, 236, 381, 281, false, GUIEditor.staticimage[7]) guiSetAlpha(GUIEditor.tabpanel[4], 0.60) GUIEditor.tab[7] = guiCreateTab("Login", GUIEditor.tabpanel[4]) GUIEditor.label[16] = guiCreateLabel(0, 66, 60, 16, "Username:", false, GUIEditor.tab[7]) guiSetFont(GUIEditor.label[16], "default-bold-small") GUIEditor.label[17] = guiCreateLabel(0, 92, 60, 16, "Password:", false, GUIEditor.tab[7]) guiSetFont(GUIEditor.label[17], "default-bold-small") GUIEditor.edit[16] = guiCreateEdit(61, 64, 187, 24, "", false, GUIEditor.tab[7]) GUIEditor.edit[17] = guiCreateEdit(61, 88, 187, 24, "", false, GUIEditor.tab[7]) guiEditSetMasked(GUIEditor.edit[17], true) GUIEditor.button[7] = guiCreateButton(167, 113, 81, 45, "Login", false, GUIEditor.tab[7]) guiSetFont(GUIEditor.button[7], "sa-header") guiSetProperty(GUIEditor.button[7], "NormalTextColour", "FFFE0000") GUIEditor.checkbox[4] = guiCreateCheckBox(61, 112, 104, 22, "Save Details", false, false, GUIEditor.tab[7]) GUIEditor.staticimage[8] = guiCreateStaticImage(0, 0, 381, 66, ":Login_System/images/Zombie1.png", false, GUIEditor.tab[7]) guiSetAlpha(GUIEditor.staticimage[8], 0.60) GUIEditor.staticimage[9] = guiCreateStaticImage(0, 191, 381, 66, ":Login_System/images/Zombie1.png", false, GUIEditor.tab[7]) guiSetAlpha(GUIEditor.staticimage[9], 0.60) GUIEditor.tab[8] = guiCreateTab("Register", GUIEditor.tabpanel[4]) GUIEditor.label[18] = guiCreateLabel(56, 15, 60, 18, "Username:", false, GUIEditor.tab[8]) guiSetFont(GUIEditor.label[18], "default-bold-small") GUIEditor.label[19] = guiCreateLabel(56, 44, 60, 18, "Password:", false, GUIEditor.tab[8]) guiSetFont(GUIEditor.label[19], "default-bold-small") GUIEditor.label[20] = guiCreateLabel(12, 73, 104, 15, "Confirm Password:", false, GUIEditor.tab[8]) guiSetFont(GUIEditor.label[20], "default-bold-small") GUIEditor.edit[18] = guiCreateEdit(144, 15, 135, 24, "", false, GUIEditor.tab[8]) GUIEditor.edit[19] = guiCreateEdit(144, 44, 135, 24, "", false, GUIEditor.tab[8]) guiEditSetMasked(GUIEditor.edit[19], true) GUIEditor.edit[20] = guiCreateEdit(144, 73, 135, 24, "", false, GUIEditor.tab[8]) guiEditSetMasked(GUIEditor.edit[20], true) GUIEditor.button[8] = guiCreateButton(154, 98, 127, 56, "Register", false, GUIEditor.tab[8]) guiSetFont(GUIEditor.button[8], "sa-header") guiSetProperty(GUIEditor.button[8], "NormalTextColour", "FFFE0000") GUIEditor.staticimage[10] = guiCreateStaticImage(2, 154, 379, 103, ":Login_System/images/Zombie1.png", false, GUIEditor.tab[8]) guiSetAlpha(GUIEditor.staticimage[10], 0.60) ---Controls: showCursor ( true ) toggleAllControls(false) Warning = guiCreateLabel(321, 114, 381, 62, "", false, GUIEditor.staticimage[7]) guiSetFont(Warning, "default-bold-small") guiLabelSetColor(Warning, 242, 0, 0) guiLabelSetHorizontalAlign(Warning, "center", false) guiLabelSetVerticalAlign(Warning, "center") guiSetText (Warning, "") addEventHandler ("onClientGuiClick", GUIEditor.button[1], onClickLogin, false) addEventHandler ("onClientGuiClick", GUIEditor.button[2], onClickRegister, false) end ) function onClickRegister(button,state) --??? ??????? ?? ?????? Register and Cofirm if(button == "left" and state == "up") then if (source == GUIEditor.button[2]) then username = guiGetText(GUIEditor.edit[13]) password = guiGetText(GUIEditor.edit[14]) passwordConfirm = guiGetText(GUIEditor.edit[15]) triggerServerEvent("Register",getLocalPlayer(),username,password,passwordConfirm) end end end function onClickLogin(button,state) if(button == "left" and state == "up") then if (source == GUIEditor.button[1]) then username = guiGetText(GUIEditor.edit[6]) password = guiGetText(GUIEditor.edit[7]) triggerServerEvent("onRequestLogin",getLocalPlayer(),username,password,checksave) end end end function Error_msg(Tab, Text) if Tab == "Login" then guiSetText(Warning, tostring(Text)) setTimer(function() guiSetText(Warning, "") end,6000,1) elseif Tab == "Register" then guiSetText(Warning, tostring(Text)) setTimer(function() guiSetText(Warning, "") end,6000,1) end end addEvent("WarningText",true) addEventHandler("WarningText",getRootElement(),Error_msg) function hideLoginWindow ()
  17. getPedOxygenLevel setPedOxygenLevel toggleControl
  18. And that's what my script does, have you even tested it?
  19. You can't attach a pickup, is not supported by attachElements function, you'll have to create an object, then attach it. local pbags = { { 2293.154296875, 561.470703125, 7.78125 }, } local marker = createMarker ( 2291.1999511719, 537, 0.80000001192093, "cylinder", 1.5, 255, 0, 0 ) function createBags ( thePlayer ) local x, y, z = unpack ( pbags [ math.random ( #pbags ) ] ) local bag = createPickup ( x, y, z, 3, 1550 ) addEventHandler ( "onPickupHit", bag, onPickupHit ) end addEventHandler ( "onResourceStart", getRootElement(), createBags ) function onPickupHit ( thePlayer ) if ( source ~= bag ) then return end if ( isPedInVehicle ( thePlayer ) ) then return end local bag = createObject ( 1550, 0, 0, 0 ) setElementData ( thePlayer, "bag", true ) setElementCollisionsEnabled ( bag, false ) attachElements ( bag, thePlayer, 0, -0.3, 0.3 ) end
×
×
  • Create New...