-
Posts
460 -
Joined
-
Last visited
Everything posted by Mefisto_PL
-
Hey Everybody ! Today I made new plants style, I would like to know your opinion about it . Some Screens: Screen #1 Screen #2 Screen #3 Screen #4 Screen #5
-
Hi, I would like to made a race_nos for only DD and Fun maps , but not for DM, how I can do that, I tried startResource and stopResource , but it's not working and not good method.. Anybody can help me ?
-
local x,y = guiGetScreenSize() guiCreateStaticImage( x/3.8, y/3.8, x/2.02, y/2, "logo.png", false) function DXtext () dxDrawText(tostring "Hello",x/3.5, y/3.6, x, y,tocolor(148,0,220),1.5,"beckett") end addEventHandler ( "onClientRender", getRootElement(), DXtext ) This positions is for example, but it still working
-
Funkcja określająca zwycięzcę
Mefisto_PL replied to InFinityPL's topic in Pomoc ze skryptami i programowaniem w Lua
Gamemode Race jest obszerny. W DD powinno działać onPlayerFinish, bo jakby nie patrzeć tam "wyścig" też się kończy . -
Funkcja określająca zwycięzcę
Mefisto_PL replied to InFinityPL's topic in Pomoc ze skryptami i programowaniem w Lua
Chodzi Ci o event "onPlayerFinish" ? A jeśli chodzi o funkcję to powinna być w race_client.lua https://wiki.multitheftauto.com/wiki/Resource:Race - Tu masz eventy jak byś chciał -
I think this problem could be in autoteams script if you have it. Because if in team is 0 peoples, team is deleted, but when is 1 people team is creating again and maybe server can't read color from team which is deleted . But I could be wrong. (Sorry if I make a mistake, I'm from Poland )
-
Dude this error will be showed everytime to use make vehicle colour with "onPlayerVehicleEnter" on Race, but it works.
-
Wyłączenie sprintu
Mefisto_PL replied to El_Matador's topic in Pomoc ze skryptami i programowaniem w Lua
Zaciągnięte z LSS, ale powinieneś użyć UnbindKey, BindKey przykład: unbindKey("shift", down, sprint) ///EDIT istnieje też inna opcja toggleControl ( "sprint", false ) -
(Sorry za odkop, ale nie wiem czy naprawiłeś ten problem.) Może po prostu masz starą wersję ?
-
REPORT COMMUNITY CENTER RESOURCES HERE
Mefisto_PL replied to SATAN's topic in General MTA discussion
Stolen resource: https://community.multitheftauto.com/index.php?p= ... ls&id=4940 -
Okey , but I want to make it like that: if player was killed by 3 time , then console kick him .. And I don't know how to make that .
-
So.. I have afk system which previously worked, but now it doesn't working.. Debug says "ERROR: Panel-F7\_client.lua:95: attempt to compare nil with number".. Mistake is in "if getTickCount() - lastaction >= idletime then" , but what I did wrong? client: local idletime local lastaction function clientAction() lastaction = getTickCount() if getElementData(getLocalPlayer(),"preidlename") then triggerServerEvent("onIdleReturn",getLocalPlayer(),getElementData(getLocalPlayer(),"preidlename")) end setElementData(getLocalPlayer(),"preidlename",false,true) end addEventHandler("onClientCursorMove",getRootElement(),clientAction) bindKey("fire","both",clientAction) bindKey("next_weapon","both",clientAction) bindKey("previous_weapon","both",clientAction) bindKey("forwards","both",clientAction) bindKey("backwards","both",clientAction) bindKey("left","both",clientAction) bindKey("right","both",clientAction) bindKey("zoom_in","both",clientAction) bindKey("zoom_out","both",clientAction) bindKey("change_camera","both",clientAction) bindKey("jump","both",clientAction) bindKey("sprint","both",clientAction) bindKey("look_behind","both",clientAction) bindKey("crouch","both",clientAction) bindKey("action","both",clientAction) bindKey("walk","both",clientAction) bindKey("aim_weapon","both",clientAction) bindKey("conversation_yes","both",clientAction) bindKey("conversation_no","both",clientAction) bindKey("group_control_forwards","both",clientAction) bindKey("group_control_back","both",clientAction) bindKey("enter_exit","both",clientAction) bindKey("vehicle_fire","both",clientAction) bindKey("vehicle_secondary_fire","both",clientAction) bindKey("vehicle_left","both",clientAction) bindKey("vehicle_right","both",clientAction) bindKey("steer_forward","both",clientAction) bindKey("steer_back","both",clientAction) bindKey("accelerate","both",clientAction) bindKey("brake_reverse","both",clientAction) bindKey("radio_next","both",clientAction) bindKey("radio_previous","both",clientAction) bindKey("radio_user_track_skip","both",clientAction) bindKey("horn","both",clientAction) bindKey("sub_mission","both",clientAction) bindKey("handbrake","both",clientAction) bindKey("vehicle_look_left","both",clientAction) bindKey("vehicle_look_right","both",clientAction) bindKey("vehicle_look_behind","both",clientAction) bindKey("vehicle_mouse_look","both",clientAction) bindKey("special_control_left","both",clientAction) bindKey("special_control_right","both",clientAction) bindKey("special_control_down","both",clientAction) bindKey("special_control_up","both",clientAction) bindKey("enter_passenger","both",clientAction) bindKey("playerlist","both",clientAction) bindKey("screenshot","both",clientAction) bindKey("chatbox","both",clientAction) bindKey("radar","both",clientAction) bindKey("radar_zoom_in","both",clientAction) bindKey("radar_zoom_out","both",clientAction) bindKey("radar_move_north","both",clientAction) bindKey("radar_move_south","both",clientAction) bindKey("radar_move_east","both",clientAction) bindKey("radar_move_west","both",clientAction) bindKey("radar_attach","both",clientAction) function startIdleCount() triggerServerEvent("onClientRequestIdleTime",getLocalPlayer()) lastaction = getTickCount() end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),startIdleCount) function saveIdleTime(kicktime) idletime = kicktime addEventHandler("onClientRender",getRootElement(),checkIdle) end addEvent("onServerReturnIdleTime",true) addEventHandler("onServerReturnIdleTime",getRootElement(),saveIdleTime) function checkIdle() if getAnalogControlState("accelerate") > 0 or getAnalogControlState("brake_reverse") > 0 or getAnalogControlState("vehicle_left") > 0 or getAnalogControlState("vehicle_right") > 0 or getAnalogControlState("steer_forward") > 0 or getAnalogControlState("steer_back") > 0 or getAnalogControlState("forwards") > 0 or getAnalogControlState("backwards") > 0 or getAnalogControlState("left") > 0 or getAnalogControlState("right") > 0 then lastaction = getTickCount() end if getTickCount() - lastaction >= idletime then if getCameraTarget() == getLocalPlayer() or getCameraTarget() == getPedOccupiedVehicle(getLocalPlayer()) then triggerServerEvent("onIdleKick",getLocalPlayer()) lastaction = getTickCount() --removeEventHandler("onClientRender",getRootElement(),checkIdle) else lastaction = getTickCount() end end end
-
I fix that. Nicks is on normal positions + shows nicks colors , but I want to change this stupid font :c
-
Don't working : /
-
@UP Okey, I understand
-
code work.. thanks.. but it doesn't change the font and the position doesn't changed.
-
I don't send full code, I send what I changed .
-
don't working . : / ///EDIT Working , but the problem isn't fixed
-
Puma write stats system and some other things, but panel made my friend for someone other, but he resign and send it to me .
-
Hello , I want to change font in killmessages and change dxDrawText to dxDrawColorText, but when I change the font, it doesn't shows any text.. When I change dxDrawText to dxDrawColorText , text change position.. It's fragment of code. local myFont = dxCreateFont("font.otf", 14) 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 or 0 att4 = att4 or 0 att5 = att5 or self.tColor[4] outlinesize = att1 or 2 outlinesize = math.min(self.fScale,outlinesize) --Make sure the outline size isnt thicker than the size of the label if outlinesize > 0 then for offsetX=-outlinesize,outlinesize,outlinesize do for offsetY=-outlinesize,outlinesize,outlinesize do if not (offsetX == 0 and offsetY == 0) then dxDrawColorText(self.strText, l + offsetX, t + offsetY, r + offsetX, b + offsetY, tocolor(att2, att3, att4, att5), self.fScale, myFont, self.bHorizontalAlign, self.bVerticalAlign, self.bClip, self.bWordWrap, self.bPostGUI ) end end end end elseif type == "shadow" then local shadowDist = att1 att2 = att2 or 0 att3 = att3 or 0 att4 = att4 or 0 att5 = att5 or self.tColor[4] string.gsub(self.strText, '#%x%x%x%x%x%x', '') dxDrawColorText(self.strText, l + shadowDist, t + shadowDist, r + shadowDist, b + shadowDist, tocolor(att2, att3, att4, att5), self.fScale, myFont, self.bHorizontalAlign, self.bVerticalAlign, self.bClip, self.bWordWrap, self.bPostGUI ) end dxDrawColorText ( self.strText, l, t, r, b, tocolor(unpack(self.tColor)), self.fScale, myFont, self.bHorizontalAlign, self.bVerticalAlign, self.bClip, self.bWordWrap, self.bPostGUI ) break end end end ) if addEvent ( "updateDisplays", true ) then addEventHandler ( "updateDisplays", getRootElement(), function(self) setmetatable( self, dxText_mt ) --Remove any old ones with the same id for text,_ in pairs(visibleText) do if text.id == self.id then visibleText[text] = nil end end if self.bVisible and not self.bDestroyed then visibleText[self] = true end end ) end function dxDrawColorText(str, ax, ay, bx, by, color, scale, font, alignX, alignY) bx, by, color, scale, font = bx or ax, by or ay, color or tocolor(255,255,255,255), scale or 1, font or "default" if alignX then if alignX == "center" then ax = ax + (bx - ax - dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font))/2 elseif alignX == "right" then ax = bx - dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font) end end if alignY then if alignY == "center" then ay = ay + (by - ay - dxGetFontHeight(scale, font))/2 elseif alignY == "bottom" then ay = by - dxGetFontHeight(scale, font) end end local alpha = string.format("%08X", color):sub(1,2) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor(getColorFromString("#"..col..alpha)) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) ax = ax + w color = tocolor(getColorFromString("#"..col..alpha)) end last = e + 1 s, e, cap, col = str:find(pat, last) end if last <= #str then cap = str:sub(last) dxDrawText(cap, ax, ay, ax + dxGetTextWidth(cap, scale, font), by, color, scale, font) end end
-
To delete player damage use: addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), cancelEvent ) To make another damage , you can try this: setElementHealth ( source, getElementHealth(source) - 20 ) -- Example ///EDIT Oh.. someone write this first : |
-
It isn't your script.. It script you stolen or someone give you that and you remake that... I know that because my friend make that script..
-
Thanks for it, but is another problem (EDIT)
-
It doesn't help me..
-
I change some textures and models, but after some time they have been default.. I have mistake in script or it's MTA Bug? function loadmodels() txd = engineLoadTXD ( "files/bugatti.txd" ) engineImportTXD ( txd, 541 ) dff = engineLoadDFF ( "files/bugatti.dff", 541 ) engineReplaceModel ( dff, 541 ) txd = engineLoadTXD ( "files/globemaster.txd" ) engineImportTXD ( txd, 592 ) dff = engineLoadDFF ( "files/globemaster.dff", 592 ) engineReplaceModel ( dff, 592 ) txd = engineLoadTXD ( "files/dodge.txd" ) engineImportTXD ( txd, 429 ) dff = engineLoadDFF ( "files/dodge.dff", 429 ) engineReplaceModel ( dff, 429 ) txd = engineLoadTXD ( "files/pontiac.txd" ) engineImportTXD ( txd, 603 ) dff = engineLoadDFF ( "files/pontiac.dff", 603 ) engineReplaceModel ( dff, 603 ) txd = engineLoadTXD ( "files/honda.txd" ) engineImportTXD ( txd, 522 ) dff = engineLoadDFF ( "files/honda.dff", 522 ) engineReplaceModel ( dff, 522 ) txd = engineLoadTXD ( "files/corvette.txd" ) engineImportTXD ( txd, 411 ) dff = engineLoadDFF ( "files/corvette.dff", 411 ) engineReplaceModel ( dff, 411 ) txd = engineLoadTXD ( "files/desmond.txd" ) engineImportTXD ( txd, 79 ) dff = engineLoadDFF ( "files/desmond.dff", 0 ) engineReplaceModel ( dff, 79 ) txd = engineLoadTXD ( "files/claire.txd" ) engineImportTXD ( txd, 91 ) dff = engineLoadDFF ( "files/claire.dff", 0 ) engineReplaceModel ( dff, 91 ) txd = engineLoadTXD ( "files/osama.txd" ) engineImportTXD ( txd, 153 ) dff = engineLoadDFF ( "files/osama.dff", 0 ) engineReplaceModel ( dff, 153 ) txd = engineLoadTXD ( "files/vader.txd" ) engineImportTXD ( txd, 105 ) dff = engineLoadDFF ( "files/vader.dff", 0 ) engineReplaceModel ( dff, 105 ) txd = engineLoadTXD ( "files/girl.txd" ) engineImportTXD ( txd, 172 ) dff = engineLoadDFF ( "files/girl.dff", 0 ) engineReplaceModel ( dff, 172 ) txd = engineLoadTXD ( "files/katana.txd" ) engineImportTXD ( txd, 339 ) dff = engineLoadDFF ( "files/katana.dff", 339 ) engineReplaceModel ( dff, 339 ) end addEventHandler("onClientResourceStart", getRootElement(getThisResource()), loadmodels) ///EDIT Some time ago I asked for help on nitro, and several people helped me .. The script worked, but now that he turn not add nitro .. Please help. : ( addEventHandler("onPlayerJoin",root, function () bindKey(source,"mouse1","down",nitro) end) addEventHandler("onResourceStart",resourceRoot, function () for index, player in ipairs(getElementsByType("player")) do bindKey(player,"mouse1","down",nitro) end end) function nitro ( thePlayer ) if ( isPedInVehicle ( thePlayer ) ) then local id = 1010 local theVehicle = getPedOccupiedVehicle ( thePlayer ) local success = addVehicleUpgrade ( theVehicle, id ) if ( success ) then outputConsole ( getVehicleUpgradeSlotName ( id ) .. " dodane.", thePlayer ) else outputConsole ( "Nieudana próba dodania nitro.", thePlayer ) end end end addCommandHandler ( "nitro", nitro )
