
HeK
Members-
Posts
185 -
Joined
-
Last visited
Everything posted by HeK
-
Like this? SCRIPT ERROR: [scripts]\zombies\zombie_server.lua:373: ')' expected near '(' The createPed part of the script: local zomb = setTimer(createPed, 5000, 0 (tonumber(skin),tonumber(x),tonumber(y),tonumber(z))--spawns the ped
-
How do i change the "delay" or "timer" for the Zombie spawnpoints, i want them to come slowly, like 1 zombie comes out and then waits 5 seconds for another one to come out. Any ideas? Thanks for your attention.
-
Already tried those, didn't work :\ Fixed it, i was trying "default-bold-small" and it didn't work it had to be "default-bold". Thanks.
-
Nope, i tried that a lot of times. It didn't work. Thanks anyway.
-
How can i change the Killmessages font? I tried in the textlib.lua, gui.lua and the killmessages server and client side scripts, and no success. Can anyone help me?
-
I tried that with "(weapondealer1, frozen) and without that. I think it's not working because he is doing the "DEALER_IDLE" animation and moving to the sides a little by steps.. EDIT: i fixed it by doing: setElementFrozen ( weapondealer1, true )
-
Thanks it worked, But how do i make him in "god mode" or never dies and never gets moved? - Happy New Year -
-
I have been trying a lot of coding from the wiki and no success. I wanna set an "DEALER_IDLE" animation to the ped but no success, he just stands there. function weapondealer1() weapondealer1 = createPed ( 28, 1604.3000488281, -1721.0999755859, 6.3000001907349 ) setPedAnimation ( weapondealer1, "DEALER", "DEALER_IDLE" ) end addEventHandler ("onResourceStart", resourceRoot, weapondealer1)
-
Thanks, i'll start working on it now. - Happy New Year -
-
Epic map! Is there any server with it? I would like to try it.
-
Cool map ;P
-
Cool map, and love the dubstep too!
-
I wanna make an NPC/Ped that sells weapons, i already have the shop script what i need to do now is to create the Ped in a position and put a marker in front of him so when the player steps on it it will open the shop. How should i start to make this script? Got any examples or something that could help me?
-
Thanks Slothman, i'll do that. Love your script
-
I don't understand what should i do in that code? I tried changing the "font" to a font name for example "pricedown". But it still doesn't work. is it the one from "gui.lua" or "killmessages_server.lua". Im sorry if im so stupid.. Im still learning.
-
Im sorry i don't understand, in what file? I have searched every file in the "killmessages" resource, only one that shows something about fonts is the textlib...
-
I can't find "dxText:font" in the killmessages script, should i add it? - Im sorry for doing so much questions.
-
Oh ok, sorry for my stupidity and thanks. I'll take a look now!
-
Im sorry, i can't get it to work. I have tried many things replacing the (font) with (arial) or ("arial"), not working. By the way, how do i make it "bold"? function dxText:font(font) if not validFonts[font] then return self.strFont end self.strFont = font return true end
-
Thanks for fixing the warning. Now i got to find out whats causing this "team-bug" thingy..
-
Theres more ".luas" if you want me to post them all i can do it. S_main.lua: g_root = getRootElement( ); classGroups = { }; addEvent( "spawn_clientRequestSpawn", true ); addEventHandler( "spawn_clientRequestSpawn", g_root, function( categoryIndex, classIndex, skinIndex ) if skinIndex then local class = classGroups[ categoryIndex ].classes[ classIndex ]; local skin = class.skinMngr.skins[ skinIndex ]; local spawn = true; local spawned; --[[if not classGroups[ cetegoryIndex ].owner then -- if there is NO owner of the clan/gang spawn player spawn = true; else -- if there IS owner of the clan/gang then check if he's member of the clan/gang end]] if spawn then if not class.team then class.team = createTeam( class.name, class.color.red, class.color.green, class.color.blue ); end local plrTeam = getPlayerTeam( client ); if ( ( plrTeam ) and ( plrTeam == class.team ) and ( countPlayersInTeam( plrTeam ) == 1 ) ) then destroyElement( plrTeam ); end spawned = spawnPlayer( client, skin.spawnLoc.x, skin.spawnLoc.y, skin.spawnLoc.z, skin.spawnLoc.rot, skin.modelId, 0, 0, class.team ); end if spawned then setElementData( client, "team", class.name ) fadeCamera( client, true ); setCameraTarget( client, client ); setTimer( setCameraTarget, 200, 1, client, client ); triggerClientEvent( client, "spawn_SpawnedSuccessfully", client ); --setPlayerMoney( client, 500 ); for _, weapon in ipairs( class.weaponMngr.weapons ) do giveWeapon( client, weapon.id, weapon.ammo, false ); end createBlipAttachedTo( client, 0, 2, class.color.red, class.color.green, class.color.blue ) else triggerClientEvent( client, "spawn_FailedToSpawn", client ); if countPlayersInTeam( class.team ) == 0 then destroyElement( class.team ); class.team = nil; end end end end ); addEventHandler( "onPlayerSpawn", g_root, function ( ) end ); addEventHandler( "onPlayerWasted", g_root, function( ) fadeCamera( source, false, 4 ); setTimer( requestMenu, 5000, 1, source ); deleteAllPlayerBlips( source ) end ); function requestMenu( player ) callClientFunc( player, "showSpawnMenu", true, true ); callClientFunc( player, "classSelected" ); end addCommandHandler( "kill", function( plr ) killPed( plr ); end ) function preloadClassesInfo( ) local groups = getElementsByType( "category" ); for _, group in ipairs( groups ) do table.insert( classGroups, Group:New( group ) ); end end addEventHandler( "onResourceStart", getResourceRootElement(), preloadClassesInfo ) function deleteAllPlayerBlips(player) local elements = getAttachedElements(player) if (elements) then for i, element in ipairs(elements) do if (getElementType(element) == "blip") then destroyElement(element) end end end end addEventHandler( "onPlayerQuit", g_root, function() deleteAllPlayerBlips(source) end ); ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ function callClientFunc( player, funcName, ... ) if #{ ... } ~= 0 then triggerClientEvent( player, "_clientCallFunction", root, funcName, ... ) else triggerClientEvent( player, "_clientCallFunction", root, funcName ) end end addEvent( "_serverCallFunction", true ) addEventHandler( "_serverCallFunction", root, function( funcName, ... ) _G[ funcName ](...) end )
-
I have been trying to change Killmessages font in the "textlib.lua" and even the "gui.lua" files but theres no change ingame. Textlib.lua: dxText = {} dxText_mt = { __index = dxText } local idAssign,idPrefix = 0,"c" local g_screenX,g_screenY = guiGetScreenSize() local visibleText = {} ------ local defaults = { fX = 0.5, fY = 0.5, bRelativePosition = true, strText = "", bVerticalAlign = "center", bHorizontalAlign = "center", tColor = {255,255,255,255}, fScale = 1, strFont = "default", strType = "normal", tAttributes = {}, bPostGUI = false, bClip = false, bWordWrap = true, bVisible = true, tBoundingBox = false, --If a bounding box is not set, it will not be used. bRelativeBoundingBox = true, } local validFonts = { default = true, ["default-bold"] = true, clear = true, arial = true, pricedown = true, bankgothic = true, diploma = true, beckett = true, } local validTypes = { normal = true, shadow = true, border = true, stroke = true, --Clone of border } local validAlignTypes = { center = true, left = true, right = true, } function dxText:create( text, x, y, relative ) assert(not self.fX, "attempt to call method 'create' (a nil value)") if ( type(text) ~= "string" ) or ( not tonumber(x) ) or ( not tonumber(y) ) then outputDebugString ( "dxText:create - Bad argument", 0, 112, 112, 112 ) return false end local new = {} setmetatable( new, dxText_mt ) --Add default settings for i,v in pairs(defaults) do new[i] = v end idAssign = idAssign + 1 new.id = idPrefix..idAssign new.strText = text or new.strText new.fX = x or new.fX new.fY = y or new.fY if type(relative) == "boolean" then new.bRelativePosition = relative end visibleText[new] = true return new end function dxText:text(text) if type(text) ~= "string" then return self.strText end self.strText = text return true end function dxText:position(x,y,relative) if not tonumber(x) then return self.fX, self.fY end self.fX = x self.fY = y if type(relative) == "boolean" then self.bRelativePosition = relative else self.bRelativePosition = true end return true end function dxText:color(r,g,b,a) if not tonumber(r) then return unpack(self.tColor) end g = g or self.tColor[2] b = b or self.tColor[3] a = a or self.tColor[4] self.tColor = { r,g,b,a } return true end function dxText:scale(scale) if not tonumber(scale) then return self.fScale end self.fScale = scale return true end function dxText:visible(bool) if type(bool) ~= "boolean" then return self.bVisible end self.bVisible = bool if bool then visibleText[self] = true else visibleText[self] = nil end return true end function dxText:destroy() self.bDestroyed = true setmetatable( self, self ) return true end function dxText:extent() local extent = dxGetTextWidth ( self.strText, self.fScale, self.strFont ) if self.strType == "stroke" or self.strType == "border" then extent = extent + self.tAttributes[1] end return extent end function dxText:height() local height = dxGetFontHeight ( self.fScale, self.strFont ) if self.strType == "stroke" or self.strType == "border" then height = height + self.tAttributes[1] end return height end function dxText:font(font) if not validFonts[font] then return self.strFont end self.strFont = font return true end function dxText:postGUI(bool) if type(bool) ~= "boolean" then return self.bPostGUI end self.bPostGUI = bool return true end function dxText:clip(bool) if type(bool) ~= "boolean" then return self.bClip end self.bClip = bool return true end function dxText:wordWrap(bool) if type(bool) ~= "boolean" then return self.bWordWrap end self.bWordWrap = bool return true end function dxText:type(type,...) if not validTypes[type] then return self.strType, unpack(self.tAttributes) end self.strType = type self.tAttributes = {...} return true end function dxText:align(horzA, vertA) if not validAlignTypes[horzA] then return self.bHorizontalAlign, self.bVerticalAlign end vertA = vertA or self.bVerticalAlign self.bHorizontalAlign, self.bVerticalAlign = horzA, vertA return true end function dxText:boundingBox(left,top,right,bottom,relative) if left == nil then if self.tBoundingBox then return unpack(boundingBox) else return false end elseif tonumber(left) and tonumber(right) and tonumber(top) and tonumber(bottom) then self.tBoundingBox = {left,top,right,bottom} if type(relative) == "boolean" then self.bRelativeBoundingBox = relative else self.bRelativeBoundingBox = true end else self.tBoundingBox = false end return true end addEventHandler ( "onClientRender", getRootElement(), function() for self,_ in pairs(visibleText) do while true do if self.bDestroyed then visibleText[self] = nil break end local l,t,r,b --If we arent using a bounding box if not self.tBoundingBox then --Decide if we use relative or absolute local p_screenX,p_screenY = 1,1 if self.bRelativePosition then p_screenX,p_screenY = g_screenX,g_screenY end local fX,fY = (self.fX)*p_screenX,(self.fY)*p_screenY if self.bHorizontalAlign == "left" then l = fX r = fX + g_screenX elseif self.bHorizontalAlign == "right" then l = fX - g_screenX r = fX else l = fX - g_screenX r = fX + g_screenX end if self.bVerticalAlign == "top" then t = fY b = fY + g_screenY elseif self.bVerticalAlign == "bottom" then t = fY - g_screenY b = fY else t = fY - g_screenY b = fY + g_screenY end elseif type(self.tBoundingBox) == "table" then local b_screenX,b_screenY = 1,1 if self.bRelativeBoundingBox then b_screenX,b_screenY = g_screenX,g_screenY end l,t,r,b = self.tBoundingBox[1],self.tBoundingBox[2],self.tBoundingBox [3],self.tBoundingBox[4] l = l*b_screenX t = t*b_screenY r = r*b_screenX b = b*b_screenY end local type,att1,att2,att3,att4,att5 = self:type() if type == "border" or type == "stroke" then att2 = att2 or 0 att3 = att3
-
Hello forum, i was working on my Apocaliptic map for my zombie server and i placed spawnpoints, but theres a problem, When zombies spawn, they spawn really fast and then a lot of zombies come out of that spawnpoint. Can anyone help me? -Sorry for my English.
-
Im using this script (Spawn): https://community.multitheftauto.com/ind ... ls&id=1152 But it has an error on the console: WARNING: [scripts]\spawn\s_main.lua:107: Bad 'Element' pointer @ 'getElementType' (1) I tried to find a way to fix it on the wiki but im still a beginner. And sometimes the player isn't inside the team is just "white" name no team for him, is this error the cause? It shows in the moment that the team bug happens. Heres the code: addEventHandler( "onResourceStart", getResourceRootElement(), preloadClassesInfo ) function deleteAllPlayerBlips(player) local elements = getAttachedElements(player) if (elements) then for i, element in ipairs(elements) do if (getElementType(element) == "blip") then destroyElement(element) end end end end
-
Hello there, can you help me modify your HUD? I wanna put "Xtreme Dead" where the time is. How can i do it?