Jump to content

PrivateKiller

Members
  • Posts

    62
  • Joined

  • Last visited

Everything posted by PrivateKiller

  1. Yes, defult key is B, but you can change it if you want...
  2. There is no database in resource folder even when I start the script. That's because its using executeSQLQuery, and not the sqlite/mysql functions. The script is saving the data to registry.db located in the same directory as acl.xml Like that? function TableReset ( player ) executeSQLQuery("DELETE FROM 'Drift_top_byS3Dd'") addCommandHandler("DeleteTopDrift", TableReset) end Not quite, but close. function TableReset ( player ) executeSQLQuery("DELETE FROM Drift_top_byS3Dd") end addCommandHandler("DeleteTopDrift", TableReset) Ohh that's great information for me... I'm learning lua scripting, and I almost got it ha
  3. Like that? function TableReset ( player ) executeSQLQuery("DELETE FROM 'Drift_top_byS3Dd'") addCommandHandler("DeleteTopDrift", TableReset) end
  4. There is no database in resource folder even when I start the script.
  5. Hello folks, I want to delete data from "TOP 30 Drifters" on my server, because they were cheating. And they are already punished, don't worry . So guys, command would be okay. I don't have any experiences about databases, how they works, how can I create them... << I don't know this stuff. So I'm asking you guys, if you can help me to resed that table.
  6. It's not working... Weird. I changed local groups in serverside, yea... but... nothing happens
  7. Yes, but none of them solve my problem. I know about getPlayerTeam, getPlayerAcl... But I can't use it in my server, beucase we have a many classes of admins (HQ,Housing,...), and there is acl group for each of this class. So i'm not going to have like 5 resources only for superman (HQ-Superman;HousingAdmin-Superman...). That's why I'm asking for help for premissions
  8. If I uderstand right, function setElementData sync data with all clients? What about network traffic and server CPU? Well, can you help me with that? I'm really trying to learn lua scripting, but I never work with element data before, and I'm asking you for help... Here is server-side And here is client-side:
  9. Ohh, I didn't even think about that. Well, how can I make this work now? I hope that you can help me... I need to fix somehow, to work with premission, not with getPlayerTeam, or getPlayerAclGroup, because we have many classes of admin in our server (HQ, PROBBIE, ADMIN...) Here is server-side script: local Superman = {} -- Static global values local rootElement = getRootElement() local thisResource = getThisResource() -- Resource events addEvent("superman:start", true) addEvent("superman:stop", true) -- -- Start/stop functions -- function Superman.Start() local self = Superman addEventHandler("superman:start", rootElement, self.clientStart) addEventHandler("superman:stop", rootElement, self.clientStop) end addEventHandler("onResourceStart", getResourceRootElement(thisResource), Superman.Start, false) function Superman.clientStart() setElementData(client, "superman:flying", true) setElementData(client, "forcedanimation", true) end function Superman.clientStop() removeElementData(client, "superman:flying") removeElementData(client, "forcedanimation") end
  10. Still not working... Here is the full code: -- Copyright (c) 2008, Alberto Alonso -- -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without modification, -- are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, this -- list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright notice, this -- list of conditions and the following disclaimer in the documentation and/or other -- materials provided with the distribution. -- * Neither the name of the superman script nor the names of its contributors may be used -- to endorse or promote products derived from this software without specific prior -- written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. local Superman = {} function canceldamage() cancelEvent() end addEventHandler("onClientPedDamage", getRootElement(), canceldamage) -- Settings local ZERO_TOLERANCE = 0.00001 local MAX_ANGLE_SPEED = 6 -- In degrees per frame local MAX_SPEED = 2.5 local EXTRA_SPEED_FACTOR = 1.85 local LOW_SPEED_FACTOR = 0.40 local ACCELERATION = 0.25 local EXTRA_ACCELERATION_FACTOR = 6 local LOW_ACCELERATION_FACTOR = 0.50 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() -- -- Check for admin privileges -- local function canFly() if hasObjectPermissionTo("general.adminpanel",true) then end -- -- 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) -- Bind keys bindKey("jump", "down", Superman.onJump) -- Register commands addCommandHandler("superman", Superman.cmdSuperman) -- 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
  11. Hei guys. I got a small problem. I want to change the system, who will be able to fly... So, I want to set up, that all admins (which have premission to open admin panel) can fly. What's wrong here: local function canFly() if hasObjectPermissionTo(me, "general.adminpanel",true) then end But it's not working... Nothing happens. I already added resource in admin acl group, but nothing changes
  12. Thanks for your reply NearGreen. I tested what you said... Text dissapear when player login, but camera still showing VINEWOOD after player logins. I also don't want player to spawn before download finished. Can you help me? ˇ fadeCamera(source, true, 5) setCameraMatrix(source, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) Here is all code: dawnlodetext1 = " Welcome to Slovenia Gaming Server" --- the text up dawnlodetext2 = " Please be patient until the download finis" --- the text in medium dawnlodetext3 = "Enjoy and have fun" --- the text under dis = textCreateDisplay() screentext = textCreateTextItem(dawnlodetext1,0.2,0.2,"medium",255,0,0,255,3) textDisplayAddText(dis,screentext) dis1 = textCreateDisplay() screentext1 = textCreateTextItem(dawnlodetext2,0.3,0.4,"medium",0,255,0,255,3) textDisplayAddText(dis1,screentext1) dis2 = textCreateDisplay() screentext2 = textCreateTextItem(dawnlodetext3,0.4,0.6,"medium",255,255,0,255,3) textDisplayAddText(dis2,screentext2) addEventHandler("onResourceStart",resourceRoot, function () for i,p in ipairs(getElementsByType("player")) do textDisplayAddObserver(dis,p) textDisplayAddObserver(dis1,p) textDisplayAddObserver(dis2,p) end end ) addEventHandler("onPlayerJoin",root, function () fadeCamera(source, true, 5) setCameraMatrix(source, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) textDisplayAddObserver(dis,source) textDisplayAddObserver(dis1,source) textDisplayAddObserver(dis2,source) end ) addEventHandler("onPlayerLogin",root, function () textDisplayRemoveObserver(dis,source) textDisplayRemoveObserver(dis1,source) textDisplayRemoveObserver(dis2,source) end )
  13. Hello! I need some help. I want to have download screen which one will dissapear when player will log in(through login panel after download finish). Currently, download screen is still showing after players log in... That's my problem. So its logical when players will connect to my server, he will download new stuff first, before login panel shows up, and that's why I want to make download screen dissapear after players will log in. So guys, can you please help me? Server side script: Client side script
  14. Hahahaha, its okay mihayy5 . I'm still kinda learning lua scripting, and I was like: "WHAT THE F*CK :O" Hahahah thanks
  15. Ye, CommandHandler and Evend Handler... That's what I forgot. I already writed some scripts but, where did you find function "h"? You didn't created it...? (15. line): bindKey(player,"h", "down", "chatbox", "a");
  16. Not working . Bind still won't work. I also tryed to recconect, i restarted the resource,.. everything! Can some1 look at the code and tell me what's wrong? Mabye I should add addCommandHandler("aAdminChat",nofunction)? addEvent ( "aAdminChat", true ) addEventHandler ( "aAdminChat", _root, function ( chat ) if checkClient( true, source, 'aAdminChat' ) then return end for id, player in ipairs(getElementsByType("player")) do if ( aPlayers[player]["chat"] ) then triggerClientEvent ( player, "aClientAdminChat", source, chat ) end end end ) addEventHandler("onPlayerJoin",getRootElement(), function () bindKey(source,"m","down","chatbox","aAdminChat") end) addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function () for index, player in pairs(getElementsByType("player")) do bindKey(player,"m","down","chatbox","aAdminChat") end end)
  17. Solidsnake14, I need someone like u... Do you know where is location of adminchat? (C:\Program Files (x86)\MTA San Andreas 1.4\server\mods\deathmatch\resources\[admin]......)??
  18. You can download it here: http://community.multitheftauto.com/ind ... ils&id=952
  19. Hey guys! I'm trying to bind adminchat, which is included in admin panel(default one). So, i can't find where is that script saved, because I want to add: addEventHandler("onPlayerJoin",getRootElement(), function () bindKey(source,"m","down","chatbox","ADMINCHAT") --I don't know the right name of Admin chatbox end) addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function () for index, player in pairs(getElementsByType("player")) do bindKey(player,"m","down","chatbox","ADMINCHAT") --I don't know the right name of Admin chatbox end end) But that will bind for all players in my server... How can I set that, will bind only players who is in acl group "Admin"? I just want to bind existing AdminChat, because currently, we can only talk through Admin panel... HELP. I need to know where is the script (adminchat) and how to bind only for specified acl group. Thanks
  20. Can someone explain me what that "false" means here: I really don't get it. I know what does false or true here...: function warningWindow(message) guiSetVisible(warning, true) -- to make Gui visible showCursor(true) -- to make cursor visible end
  21. If someone finds it, please post link here! Thanks
  22. Hellloo. Do any of you know if that resource already exist on mtasa? I'm impressed of this. Its really nice working script... And there are like 7 pictures, and they are playing all the time. Anyone have idea how to do that, if is not already uploaded somewhere...
  23. Hey, Bonsai I really like your radar! But there is a problem... That radar won't shows any blips on. How can we slove that?
×
×
  • Create New...