Jump to content

Luccas

Members
  • Posts

    55
  • Joined

  • Last visited

Posts posted by Luccas

  1. Olá, esse script está crashando o mta de quem entra no servidor podem me ajudar ? 

    local screenW, screenH = guiGetScreenSize()
    local resW, resH = 1360,768
    local vzrx, vzry = (screenW/resW), (screenH/resH)
    
    local super = Class("Grid", LuaObject, function()
    	static.font1 = dxCreateFont("utils/font.ttf", vzrx*10)
    	static.font_10 = dxCreateFont("utils/font.ttf", vzrx*10)
    	static.sx, static.sy = guiGetScreenSize()
    	static.constructors = {}
    end).getSuperclass()
    local cursorOn;
    
    
    
    function Grid:init(x, y, w, h, postGUI)
    	self.x = x
    	self.y = y
    	self.w = w
    	self.h = h
    	self.originalH = h
    	self.columHeight = 30
    	self.itemHeight = 25
    	self.maxItems = self:getMaxPosition();   -- Max items
    	self.pg = postGUI or false;  
    	self.items = {};
    	self.scrollTop = y + 18 + 2
    	self.listPos = 0;                                                          -- Scroll Level
    	self.mo = nil;                                                        -- Mouse-on item
    	self.visible = true                                                        -- Visible
    	table.insert(Grid.constructors,self)
    	return self
    end
    
    function Grid:destroy()
    	for k, v in pairs(Grid) do
    		if (v == self) then
    			Grid[k] = nil
    		end
    	end
    	return true
    end
    
    function Grid:setItemText(id, column, text)
    	if self.items[column] and self.items[column][id] then
    		self.items[column][id].text = text
    	end
    end
    
    function Grid:setItemColor(id, column, r, g, b)
    	if self.items[column] and self.items[column][id] then
    		local color = tonumber(b) and tocolor(r, g, b) or tocolor(255, 255, 255)
    		self.items[column][id].color = color
    	end
    end
    
    function Grid:setVisible(visible)
    	self.visible = visible
    end
    
    function Grid:isVisible()
    	return self.visible
    end
    
    function Grid:addColumn(title, width)
    	local data = {
    		info = {title = title, width = width}
    	};
    	table.insert (self.items, data);
    	return #self.items;
    end
    
    function Grid:RemoveColumn(colum)
    	self.items[colum] = nil;
    
    	-- Recalculate the highest item count
    	local highest = 0;
    
    	for _, v in ipairs(self.items) do
    		if #v > highest then
    			highest =(#v - 1);
    		end
    	end
    	return true
    end
    
    function Grid:getColumnCount()
        return #self.items
    end
    
    function Grid:addItem(colum, text, data, r, g, b)
    	if self.items[colum] then 
    		local color = tonumber(b) and tocolor(r, g, b) or tocolor(255, 255, 255)
    
    		table.insert(self.items[colum], {id = #self.items[colum] + 1, text = tostring(text), data = data, color = color});
    		self.h = self.columHeight + (self.maxItems*self.itemHeight)
    		return #self.items[colum];
    	end
    end
    
    function Grid:removeItem( column, id)
    	if self.items[column] and self.items[column][id] then
    	
    	-- Reset the selected item if necessary²
    		if id == self.selected then
    			local newItem   =   self.selected - 1
    
    			if newItem <= #self.items[colum] then
    				self.selected = math.max(0, newItem);
    			else
    				self.selected = 0
    			end
    		end
    
    		table.remove(self.items[column], id);
    
    		return true;
    	end
    end
    
    function Grid:getItemCount(colum)
    	if self.items[colum] then
    		return #self.items[colum]
    	end
    end
    
    function Grid:clear()
    	for k, v in ipairs (self.items) do
    		self.items[k] = {info = v.info}
    	end
    
    	self.selected = nil
    end
    
    function Grid:getSelectedItem()
        return self.selected;
    end
    
    function Grid:setSelectedItem (id)
    	if id <= #self.items[1] then
    		self.selected = id;
    	end
    end
    
    function Grid:getItemDetails(column, id)
    	if self.items[column] then
    		if self.items[column][id] then
    			return self.items[column][id].text, self.items[column][id].data
    		end
    	end
    end
    
    function paint()
            -- Is there any gridlist to render?
            if (#Grid.constructors > 0) then
                -- Loop through all grid lists
                for index, self in ipairs (Grid.constructors) do
                    -- Is the gridlist visible?
                    if self.visible then
                        -- Draw the 'gridlist' itself                  
                        
    					 dxDrawRectangle (self.x, self.y, self.w, self.h, tocolor(0, 0, 0, 0), self.pg);
    					
    					
    					dxDrawRectangle(self.x, self.y + self.columHeight, self.w, self.h - self.columHeight, tocolor(0, 0, 0, 0), self.pg)
                        -- Draw the column bar
                        dxDrawRectangle(self.x, self.y, self.w, self.columHeight, tocolor(0, 0, 0, 0), self.pg)
    
    					-- ScrollBar
    					local uX, uY, uW = (self.x + self.w) + 1, self.y, 18
    					local b = 4
    					--UP Arow
    				--[[	dxDrawRectangle(uX + 1, uY + 1, uW - 1, uW - 1, tocolor(0, 0, 0, 50), self.pg)
    					dxDrawLine(uX + b , uY + uW - b, uX + uW/2, uY + b, tocolor(0, 0, 0, 70), 1, self.pg)
    					dxDrawLine(uX - b + uW, uY + uW - b, uX + uW/2 , uY + b , tocolor(0, 0, 0, 70), 1, self.pg)
    					--dxDrawLine(uX + b , uY + uW - b, uX + uW - b, uY + uW - b, tocolor(0, 0, 0, 70), 1, self.pg)
    					]]
    					--DOWN Arow
    					local dX, dY, dW, dH = (self.x + self.w) + 1, self.y + (self.h-18) + 1, 18 - 1, 18 - 1
    					--[[dxDrawRectangle(dX + 1, dY + 1, dW - 1, dW - 1, tocolor(0, 0, 0, 50), self.pg)
    					dxDrawLine(dX + b , dH + dY - dW + b, dX + dW/2, dH + dY - b, tocolor(0, 0, 0, 70), 1, self.pg)
    					dxDrawLine(dX + dW - b , dH + dY - dW + b, dX + dW/2, dH + dY - b, tocolor(0, 0, 0, 70), 1, self.pg)
    					--dxDrawLine(dX + b , dH + dY - dW + b , dX + dW - b , dH + dY - dW + b, tocolor(0, 0, 0, 70), 1, self.pg)
    					]]
    					--Thumb
    					local x, y, w, h = (self.x + self.w) + 2, self.y + 18 + 2, 18 - 2, self.h - (18*2) - 2
    					--dxDrawRectangle(x, y, w, h, tocolor(0, 0, 0, 90))
    					
    					local maxHeight = h
    					self.thumbHeight = math.max(math.min(math.floor(maxHeight * self.maxItems / (#self.items[1])),maxHeight),18)
    
    					
    					local maxY = (y+h)-self.thumbHeight
    					if (getKeyState("mouse1")) then
    						if (isMouseInPosition(uX, uY, uW, uW)) then
    							if (#self.items[1] > self.maxItems) then
    								self.scrollTop = math.max(y,math.min(self.scrollTop - 1*maxHeight/100, maxY))					
    								self.listPos = math.floor(((self.scrollTop - y) / (maxHeight-self.thumbHeight) * 100) * (#self.items[1]-self.maxItems) / 100)
    							end
    						elseif (isMouseInPosition(dX, dY, dW, dH)) then
    							if (#self.items[1] > self.maxItems) then
    								self.scrollTop = math.max(y,math.min(self.scrollTop + 1*maxHeight/100, maxY))
    								self.listPos = math.floor(((self.scrollTop - y) / (maxHeight-self.thumbHeight) * 100) * (#self.items[1]-self.maxItems) / 100)
    								
    							end
    						end
    					end
    					if drag then
    						local _, cy = getCursorPosition()
    						local cy = cy*Grid.sy
    
    						self.scrollTop = math.max(y,math.min(cy-space, maxY))
    						self.listPos = math.floor(((self.scrollTop - y) / (maxHeight-self.thumbHeight) * 100) * (#self.items[1]-self.maxItems) / 100)
    					end
    					local aa = 255
    					if (isMouseInPosition(x,self.scrollTop,w,self.thumbHeight)) then
    						aa = 110
    					end
    
    					
                        -- Set cursorOn variable to the current gridlist, if it's selected
                        self.cursorOn = nil
                        if isMouseInPosition(self.x, self.y, self.w + 18, self.h) then
                            cursorOn = index;
                        end
    
    
                        -- Is there any column?
                        if #self.items > 0 then
                        local cWidth = 0
    
                            -- Loop through all columns
                            for cIndex, cData in ipairs(self.items) do
                                -- we'll go beyond the gridlist width with this column ?
                                if(( cWidth + cData.info.width) <= self.w) then
                                    local x = self.x + cWidth;
    
                                    -- Draw the column title
                                    dxDrawText(cData.info.title, x + 10, self.y, cData.info.width + x,(self.columHeight) + self.y, tocolor(255, 255, 255, 220), vzrx*1.4, "arial", "left", "center", true, true, self.pg, true, true);
    
                                    -- Is there any item ?
                                    if #cData > 0 then
    
                                        -- Loop the items
    									local k = 0
    									for i=(self.listPos+1), (math.min(#self.items[1],self.maxItems)+self.listPos) do
    											if cData[i] then
    												-- Draw a rectangle to make it looks like selected
    												dxDrawText(cData[i].text,x + 20,(self.columHeight + self.y)+(self.itemHeight*k),cData.info.width + x,(self.columHeight + self.y)+(self.itemHeight*k) + self.itemHeight, tocolor(255, 255, 255, 200), vzrx*1, Grid.font_10, "left", "center", true, true, self.pg, true, true)
    												if (self.selected == i) then
    													dxDrawRectangle(self.x,(self.columHeight + self.y)+(self.itemHeight*k),self.w,self.itemHeight,tocolor(255, 255, 255, 200), self.pg)
    													dxDrawText(cData[i].text:gsub("#%x%x%x%x%x%x", ""),x + 20,(self.columHeight + self.y)+(self.itemHeight*k),cData.info.width + x,(self.columHeight + self.y)+(self.itemHeight*k) + self.itemHeight, tocolor(0, 0, 0, 220), vzrx*1, Grid.font_10, "left", "center", true, true, self.pg, true, true)
    												end
    											end
    										 k = k+1
    									end
                                    end
    
                                    -- Increase cWidth variable (to draw the columns correctly)
                                    cWidth = cWidth + cData.info.width;
                                end
                            end
                        end
                    end
                end
            end
        end
    addEventHandler("onClientRender", root, paint, true, "low-5")
    
    function onClientKey(key, press)
    	if isCursorShowing() then
    		if #Grid.constructors > 0 then
    			if cursorOn then
    				local self = Grid.constructors[cursorOn]
    				if press and #key > 6 then
    					if #self.items[1] > self.maxItems then
    						local y = self.y + 18 + 2
    						local maxHeight = self.h - (18*2) - 2
    						if (isMouseInPosition(self.x,self.y,self.w+18,self.h)) then
    							if (key == "mouse_wheel_down") then
    								if (#self.items[1] > self.maxItems) then
    									self.listPos =  math.ceil(math.max(0,math.min(self.listPos + 1*#self.items[1]/100, #self.items[1]-self.maxItems)))
    									self.scrollTop = y + ((self.listPos / (#self.items[1]-self.maxItems) * 100) * ((maxHeight)-self.thumbHeight) / 100)
    								end
    							elseif (key == "mouse_wheel_up") then
    								if (#self.items[1] > self.maxItems) then
    									self.listPos =  math.floor(math.max(0,math.min(self.listPos - 1*#self.items[1]/100, #self.items[1]-self.maxItems)))
    									self.scrollTop = y + ((self.listPos / (#self.items[1]-self.maxItems) * 100) * ((maxHeight)-self.thumbHeight) / 100)
    								end
    							end
    						end
    					end
    				end
    			end
    		end
    	end
    end
    addEventHandler("onClientKey", root, onClientKey)
    
    function onClientClick(button,state,absoluteX,absoluteY)
    	if (button == "left" and state == "up") then
    		drag = nil
    	else
    		if #Grid.constructors > 0 then
    			if cursorOn then
    				local self = Grid.constructors[cursorOn]
    				local k = 0
    				for i=(self.listPos+1), (math.min(#self.items[1],self.maxItems)+self.listPos) do
    					if isMouseInPosition(self.x,(self.columHeight + self.y)+(self.itemHeight*k),self.w,self.itemHeight) then
    						self.selected = i
    					end
    					k = k+1
    				end
    				if (#self.items[1] > self.maxItems) then
    					local x, y, w, h = (self.x + self.w) + 2, self.y + 18 + 2, 18 - 2, self.h - (18*2) - 2
    					if (isMouseInPosition(x,self.scrollTop,w,self.thumbHeight)) then
    						space = absoluteY-self.scrollTop
    						drag = true
    					elseif(isMouseInPosition((self.x + self.w) + 2,self.y + 18 + 2,18, self.h - (18*2) - 2)) then
    						space = self.thumbHeight/2
    						drag = true
    					end
    				end
    			end
    		end
    	end
    end
    addEventHandler("onClientClick",root,onClientClick)
    
    function Grid:getMaxPosition()
    	local pos = 1
    	while true do
    		if(pos*(24)+(24) <= self.originalH) then
    			pos = pos + 1
    		else
    			pos = pos - 2
    			break
    		end
    	end
    	return pos
    end
    
    function isMouseInPosition(x, y, w, h)
    	if (not isCursorShowing()) then	return end
        local sx, sy = guiGetScreenSize ( )
        local cx, cy = getCursorPosition ( )
        local cx, cy = ( cx * sx ), ( cy * sy )
        return ((cx >= x and cx <= x + w) and (cy >= y and cy <= y + h))
    end
    --[[
    local grid = Grid(400,150,500,500)
    local colum = grid:addColumn("Colum",200)
    for k=1, 80 do
    	grid:addItem(colum,(tostring(k)))
    end
    showCursor(true)]]

     

  2. 4 minutes ago, krazyY said:

    Ok e como eu coloco a tag nesse CHAT RP ?

    function MensagemTwitter(source, cmd, ...) 
        local MessagemT = table.concat ( { ... }, "T" )
        local name = getPlayerName(source); 
    for _,v in ipairs(getElementsByType("player")) do 
      conta = getAccountName ( getPlayerAccount ( source ) )
    
        if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then
        outputChatBox("#00BFFF[ BsB™Twitter ] #FFFFFF "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true)
    
        elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then
        outputChatBox("#00BFFF[ BsB™Twitter ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true)
    
        elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then
        outputChatBox("#00BFFF[ BsB™Twitter ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true)
    
        elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then
        outputChatBox("#00BFFF[ BsB™Twitter ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true)
    
        elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then
        outputChatBox("#00BFFF[ BsB™Twitter ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true)
    
        elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then
        outputChatBox("#00BFFF[ BsB™Twitter ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true)
    
           end     
        end 
    end 
    addCommandHandler("Twitter",  MensagemTwitter)
      
    function MensagemAnon(source, cmd, ...) 
        local MessagemANS = table.concat ( { ... }, "T" ); 
    for _,v in ipairs(getElementsByType("player")) do 
        conta = getAccountName ( getPlayerAccount ( source ) )
    
        if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then
        outputChatBox("#00BFFF[ BsB™DeepWeb ] #FFFFFF "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true)
    
        elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then
        outputChatBox("#00BFFF[ BsB™DeepWeb ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true)
    
        elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then
        outputChatBox("#00BFFF[ BsB™DeepWeb ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true)
    
        elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then
        outputChatBox("#00BFFF[ BsB™DeepWeb ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true)
    
        elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then
        outputChatBox("#00BFFF[ BsB™DeepWeb ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true)
    
        elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then
        outputChatBox("#00BFFF[ BsB™DeepWeb ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true)
    
            end
        end 
    end 
    
    
    addCommandHandler("DeepWeb",  MensagemAnon)
      
    function MensagemRP(source, cmd, ...) 
        local MessagemFRP = table.concat ( { ... }, "" ); 
        local name = getPlayerName(source); 
    for _,v in ipairs(getElementsByType("player")) do 
        conta = getAccountName ( getPlayerAccount ( source ) )
    
        if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then
        outputChatBox("#00BFFF[ BsB™ForaDoRp ] #FFFFFF "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true)
    
        elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then
        outputChatBox("#00BFFF[ BsB™ForaDoRp ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true)
    
        elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then
        outputChatBox("#00BFFF[ BsB™ForaDoRp ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true)
    
        elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then
        outputChatBox("#00BFFF[ BsB™ForaDoRp ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true)
    
        elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then
        outputChatBox("#00BFFF[ BsB™ForaDoRp ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true)
    
        elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then
        outputChatBox("#00BFFF[ BsB™ForaDoRp ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true)
            end
        end 
    end 
    addCommandHandler("forarp",  MensagemRP)
    
    addEventHandler("onPlayerJoin", getRootElement(),  
    function() 
      bindKey(source, "Y", "down", "chatbox", "Twitter")
      bindKey(source, "U", "down", "chatbox", "Deepweb")
      bindKey(source, "i", "down", "chatbox", "forarp")
    end 
    ) 

    OBS: Não testado. Qualquer erro só enviar print do "/debugscript 3".
    OBS: Só mudar a posição do "Nome do grupo" para o "Everyone". Pois quem tem a tag geral não vai aparecer a tag se ela estiver acima.

  3. 26 minutes ago, krazyY said:
    
    function MensagemTwitter(source, cmd, ...) 
        local MessagemT = table.concat ( { ... }, "T" )
        local name = getPlayerName(source); 
    for _,v in ipairs(getElementsByType("player")) do 
        outputChatBox("#00BFFF[ BsB™Twitter ] #FFFFFF "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) 
        end 
    end 
    addCommandHandler("Twitter",  MensagemTwitter)
      
    function MensagemAnon(source, cmd, ...) 
        local MessagemANS = table.concat ( { ... }, "T" ); 
    for _,v in ipairs(getElementsByType("player")) do 
        outputChatBox("#ffffff[ #696969 [ BsB™DeepWeb ] #ffffff] #696969"..MessagemANS,v, 255, 255, 255, true) 
        end 
    end 
    
    
    addCommandHandler("DeepWeb",  MensagemAnon)
      
    function MensagemRP(source, cmd, ...) 
        local MessagemFRP = table.concat ( { ... }, "" ); 
        local name = getPlayerName(source); 
    for _,v in ipairs(getElementsByType("player")) do 
        outputChatBox("#000000[ #ffffff [BsB™Fora RP]#000000] "..name.." #ffffff"..MessagemFRP,v, 255, 255, 255, true) 
        end 
    end 
    addCommandHandler("forarp",  MensagemRP)
    
    addEventHandler("onPlayerJoin", getRootElement(),  
    function() 
      bindKey(source, "Y", "down", "chatbox", "Twitter")
      bindKey(source, "U", "down", "chatbox", "Deepweb")
      bindKey(source, "i", "down", "chatbox", "forarp")
    end 
    ) 
    
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() 
      for index,player in pairs(getElementsByType("player")) do 
            bindKey(player,"Y", "down", "chatbox", "Twitter")
            bindKey(player,"U", "down", "chatbox", "DeepWeb")
            bindKey(player, "i", "down", "chatbox", "forarp")
      end 
    end 
    ) 
    
    chat_range=100 
      
    addEventHandler("onPlayerJoin",getRootElement(), 
    function () 
    bindKey(source,"t","down","chatbox","ChatLocal") 
    end) 
      
    addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), 
    function () 
    for index, player in pairs(getElementsByType("player")) do 
    bindKey(player,"t","down","chatbox","ChatLocal") 
      end 
    end) 
      
    function isPlayerInRangeOfPoint(player,x,y,z,range) 
       local px,py,pz=getElementPosition(player) 
       return ((x-px)^2+(y-py)^2+(z-pz)^2)^0.5<=range 
    end 
      
    function onChat(player,_,...) 
      local px,py,pz=getElementPosition(player) 
      local msg = table.concat({...}, " ") 
      local nick=getPlayerName(player) 
    local r,g,b = getTeamColor(getPlayerTeam(player)) 
      for _,v in ipairs(getElementsByType("player")) do 
        if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then 
          outputChatBox("᠉ #00ff00 [ BsB™Local ]  - #ffffff"..nick.."#00ff00 - #ffffff"..msg,v,r,g,b,true) 
        end 
      end 
    end 
    addCommandHandler("ChatLocal",onChat) 
    
    

     

    voce sabe  pq o meu chat local quando eu do um comando por exemplo

    /chat

    aparece tudo no chat local ??

    O Gamemode "play" ou "freeroam" está ativado ?

  4. Olá, queria saber se tem algum código para fazer que a viatura das corporação no meu servidor não capotasse tão fácil. (Fiz um script que ele edita a velocidade mais não sei o nome pra não capotar)

    function loadHandling(v)	
    		if getElementModel(v) == 560 then
    			setVehicleHandling(v, "mass", 1600)
    			setVehicleHandling(v, "turnMass", 3000)
    			setVehicleHandling(v, "dragCoeff", 1.8)
    			setVehicleHandling(v, "centerOfMass", { 0, 0.15, -0.3 } )
    			setVehicleHandling(v, "percentSubmerged", 75)
    			setVehicleHandling(v, "tractionMultiplier", 0.9)
    			setVehicleHandling(v, "tractionLoss", 0.9)
    			setVehicleHandling(v, "tractionBias", 0.497)
    			setVehicleHandling(v, "numberOfGears", 5)
    			setVehicleHandling(v, "maxVelocity", 211)
    			setVehicleHandling(v, "engineAcceleration", 15)
    			setVehicleHandling(v, "engineInertia", 50)
    			setVehicleHandling(v, "driveType", "awd")
    			setVehicleHandling(v, "engineType", "petrol")
    			setVehicleHandling(v, "brakeDeceleration", 50)
    			setVehicleHandling(v, "ABS", false)
    			setVehicleHandling(v, "steeringLock", 35)
    			setVehicleHandling(v, "headLight", 0)
    			setVehicleHandling(v, "tailLight", 1)
    			setVehicleHandling(v, "animGroup", 0)
    			setVehicleHandling(v, "suspensionUpperLimit", 0.0)
    			setVehicleHandling(v, "suspensionLowerLimit", -0.04)
    		end

     

  5. On 08/07/2019 at 11:35, carlos eduardo said:
    
    function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin)
    	if not (isGuestAccount (getPlayerAccount (source))) then
    		local accountData = getAccountData (theCurrentAccount, "funmodev2-money")
    		if (accountData) then
    			local playerMoney = getAccountData (theCurrentAccount, "funmodev2-money")
    			local playerSkin = getAccountData (theCurrentAccount, "funmodev2-skin")
    			local playerHealth = getAccountData (theCurrentAccount, "funmodev2-health")
    			local playerArmor = getAccountData (theCurrentAccount, "funmodev2-armor")
    			local playerX = getAccountData (theCurrentAccount, "funmodev2-x")
    			local playerY = getAccountData (theCurrentAccount, "funmodev2-y")
    			local playerZ = getAccountData (theCurrentAccount, "funmodev2-z")
    			local playerInt = getAccountData (theCurrentAccount, "funmodev2-int")
    			local playerDim = getAccountData (theCurrentAccount, "funmodev2-dim")
    			local playerWanted = getAccountData (theCurrentAccount, "funmodev2-wantedlevel")
    			local playerTeam = getAccountData (theCurrentAccount, "funmodev2-Team")
    			spawnPlayer (source, playerX, playerY, playerZ +1, 0, playerSkin, playerInt, playerDim)
    			setPlayerMoney (source, playerMoney)
    			setTimer (setElementHealth, 500, 1, source, playerHealth)
    			setTimer (setPedArmor, 500, 1, source, playerArmor)
    			setTimer (setPlayerWantedLevel, 500, 1, source, playerWanted)
    			if getAccountData (theCurrentAccount, "funmodev2-weapons") then
    				local weaponData = fromJSON (getAccountData (account, "funmodev2-weapons")) -- Converte a string JSON em uma table.
    				for i=1, 46 do -- Para cada ID de arma, faça: (seria do 0 ao 46, mas não precisa obter a mão do jogador)
    					if weaponData[tostring(i)] then -- Se existe o ID "i" de arma na table, então:
    						giveWeapon (source, i, weaponData[tostring(i)]) -- Os índices da table JSON sempre são em string.
    					end
    				end
    			end
    			setCameraTarget (source)
    			fadeCamera (source, true, 2.0)
    		else
    			spawnPlayer (source, 1481.0855712891, -1771.2996826172, 18.795753479004, 0, 78, 0, 0)
    			setPlayerMoney (source, 200)
    			setCameraTarget (source)
    			fadeCamera (source, true, 2.0)
    		end
    	end
    end
    addEventHandler ("onPlayerLogin", root, playerLogin)
    
    function onLogout ()
    	kickPlayer (source, nil, "Logging out is disallowed.")
    end
    addEventHandler ("onPlayerLogout", root, onLogout)
    
    function onQuit (quitType, reason, responsibleElement)
    	if not (isGuestAccount (getPlayerAccount (source))) then
    		account = getPlayerAccount (source)
    		if (account) then
    			local x, y, z = getElementPosition (source)
    			setAccountData (account, "funmodev2-money", tostring (getPlayerMoney (source)))
    			setAccountData (account, "funmodev2-skin", tostring (getPedSkin (source)))
    			setAccountData (account, "funmodev2-health", tostring (getElementHealth (source)))
    			setAccountData (account, "funmodev2-armor", tostring (getPedArmor (source)))
    			setAccountData (account, "funmodev2-R", r)
    			setAccountData (account, "funmodev2-G", g)
    			setAccountData (account, "funmodev2-B", b)
    			setAccountData (account, "funmodev2-x", x)
    			setAccountData (account, "funmodev2-y", y)
    			setAccountData (account, "funmodev2-z", z)
    			setAccountData (account, "funmodev2-int", getElementInterior (source))
    			setAccountData (account, "funmodev2-dim", getElementDimension (source))
    			setAccountData (account, "funmodev2-wantedlevel", getPlayerWantedLevel (source))
    			local ammo = {}
    			for i=0,12 do --Weapon Slots
    				for k=1,46 do --Weapon IDs (seria do 0 ao 46, mas não precisa obter a mão do jogador, arma 0.)
    					if getPedWeapon (source, i) == k then
    						ammo[k] = getPedTotalAmmo (source, i)
    					end
    				end
    			end
    			setAccountData (account, "funmodev2-weapons", toJSON ( { ammo[1], ammo[2], ammo[3], ammo[4], ammo[5], ammo[6], ammo[7], ammo[8], ammo[9], ammo[10], ammo[11], ammo[12], ammo[13], ammo[14], ammo[15], ammo[16], ammo[17], ammo[18], ammo[19], ammo[20], ammo[21], ammo[22], ammo[23], ammo[24], ammo[25], ammo[26], ammo[27], ammo[28], ammo[29], ammo[30], ammo[31], ammo[32], ammo[33], ammo[34], ammo[35], ammo[36], ammo[37], ammo[38], ammo[39], ammo[40], ammo[41], ammo[42], ammo[43], ammo[44], ammo[45], ammo[46] } ))
    		end
    	end
    end
    addEventHandler ("onPlayerQuit", root, onQuit)
    
    function onWasted (totalAmmo, killer, killerWeapon, bodypart, stealth)
    	if not (isGuestAccount (getPlayerAccount(source))) then
    		local theWeapon = getPedWeapon (source)
    		local weaponAmmo = getPedTotalAmmo (source)
    		fadeCamera (source, false)
    		setTimer (spawnPlayer, 1000, 1, source, 2036.1735839844, -1413.0563964844, 16.9921875, 0, getPedSkin (source), 0, 0, getPlayerTeam(source))
    		setTimer (setCameraTarget, 1250, 1, source)
    		setTimer (fadeCamera, 2000, 1, source, true)
    		setTimer (giveWeapon, 2000, 1, source, theWeapon, weaponAmmo, true)
    	end
    end
    addEventHandler ("onPlayerWasted", root, onWasted)
    

    É esse o script, bota no server-side que ta funcionando com todas armas

     

    Não funcionou mano

  6. On 7/1/2019 at 4:22 PM, Lord Henry said:

    Ela tem 10 de munição, certo?

    Agora aperte E para trocar pro slot 0 (a arma vai sair da sua mão) e então execute o mesmo comando mas coloque false no lugar de true. Depois volte pro slot da arma e verifique se aumentou a munição.

    Sim, mais o problema de não salvar nenhuma arma vai arrumar todas? Ou só da AK-47?

  7. 1 minute ago, Lord Henry said:

    Como está o save-system que vc estava usando?

    function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin)
      if  not (isGuestAccount (getPlayerAccount (source))) then
        local accountData = getAccountData (theCurrentAccount, "funmodev2-money")
        if (accountData) then
          local playerMoney = getAccountData (theCurrentAccount, "funmodev2-money")
          local playerSkin = getAccountData (theCurrentAccount, "funmodev2-skin")
          local playerHealth = getAccountData (theCurrentAccount, "funmodev2-health")
          local playerArmor = getAccountData (theCurrentAccount, "funmodev2-armor")
          local playerX = getAccountData (theCurrentAccount, "funmodev2-x")
          local playerY = getAccountData (theCurrentAccount, "funmodev2-y")
          local playerZ = getAccountData (theCurrentAccount, "funmodev2-z")
          local playerInt = getAccountData (theCurrentAccount, "funmodev2-int")
          local playerDim = getAccountData (theCurrentAccount, "funmodev2-dim")
          local playerWanted = getAccountData (theCurrentAccount, "funmodev2-wantedlevel")
         local playerTeam = getAccountData (theCurrentAccount, "funmodev2-Team")
          local playerWeaponID0 = getAccountData (theCurrentAccount, "funmodev2-weaponID0")
          local playerWeaponID1 = getAccountData (theCurrentAccount, "funmodev2-weaponID1")
          local playerWeaponID2 = getAccountData (theCurrentAccount, "funmodev2-weaponID2")
          local playerWeaponID3 = getAccountData (theCurrentAccount, "funmodev2-weaponID3")
          local playerWeaponID4 = getAccountData (theCurrentAccount, "funmodev2-weaponID4")
          local playerWeaponID5 = getAccountData (theCurrentAccount, "funmodev2-weaponID5")
          local playerWeaponID6 = getAccountData (theCurrentAccount, "funmodev2-weaponID6")
          local playerWeaponID7 = getAccountData (theCurrentAccount, "funmodev2-weaponID7")
          local playerWeaponID8 = getAccountData (theCurrentAccount, "funmodev2-weaponID8")
          local playerWeaponID9 = getAccountData (theCurrentAccount, "funmodev2-weaponID9")
          local playerWeaponID10 = getAccountData (theCurrentAccount, "funmodev2-weaponID10")
          local playerWeaponID11 = getAccountData (theCurrentAccount, "funmodev2-weaponID11")
          local playerWeaponID12 = getAccountData (theCurrentAccount, "funmodev2-weaponID12")
          local playerWeaponAmmo0 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo0")
          local playerWeaponAmmo1 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo1")
          local playerWeaponAmmo2 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo2")
          local playerWeaponAmmo3 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo3")
          local playerWeaponAmmo4 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo4")
          local playerWeaponAmmo5 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo5")
          local playerWeaponAmmo6 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo6")
          local playerWeaponAmmo7 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo7")
          local playerWeaponAmmo8 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo8")
          local playerWeaponAmmo9 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo9")
          local playerWeaponAmmo10 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo10")
          local playerWeaponAmmo11 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo11")
          local playerWeaponAmmo12 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo12")
          spawnPlayer (source, playerX, playerY, playerZ +1, 0, playerSkin, playerInt, playerDim)
          setPlayerMoney (source, playerMoney)
          setTimer (setElementHealth, 500, 1, source, playerHealth)
          setTimer (setPedArmor, 500, 1, source, playerArmor)
          setTimer (setPlayerWantedLevel, 500, 1, source, playerWanted)
          giveWeapon(source, playerWeaponID0, playerWeaponAmmo0, true)
          giveWeapon(source, playerWeaponID1, playerWeaponAmmo1, false)
          giveWeapon(source, playerWeaponID2, playerWeaponAmmo2, false)
          giveWeapon(source, playerWeaponID3, playerWeaponAmmo3, false)
          giveWeapon(source, playerWeaponID4, playerWeaponAmmo4, false)
          giveWeapon(source, playerWeaponID5, playerWeaponAmmo5, false)
          giveWeapon(source, playerWeaponID6, playerWeaponAmmo6, false)
          giveWeapon(source, playerWeaponID7, playerWeaponAmmo7, false)
          giveWeapon(source, playerWeaponID8, playerWeaponAmmo8, false)
          giveWeapon(source, playerWeaponID9, playerWeaponAmmo9, false)
          giveWeapon(source, playerWeaponID10, playerWeaponAmmo10, false)
          giveWeapon(source, playerWeaponID11, playerWeaponAmmo11, false)
          giveWeapon(source, playerWeaponID12, playerWeaponAmmo12, false)
          setCameraTarget (source, source)
          fadeCamera(source, true, 2.0)
        else
          spawnPlayer (source, 1481.0855712891, -1771.2996826172, 18.795753479004, 0,78, 0, 0)
          setPlayerMoney (source, 200)
          setCameraTarget (source, source)
          fadeCamera(source, true, 2.0)  
        end   
      end
    end
    addEventHandler ("onPlayerLogin", getRootElement(), playerLogin)
    
    function onLogout ()
      kickPlayer (source, nil, "Logging out is disallowed.")
    end
    addEventHandler ("onPlayerLogout", getRootElement(), onLogout)
    
    function onQuit (quitType, reason, responsibleElement)
      if not (isGuestAccount (getPlayerAccount (source))) then
        account = getPlayerAccount (source)
        if (account) then
          local x,y,z = getElementPosition (source)
          setAccountData (account, "funmodev2-money", tostring (getPlayerMoney (source)))
          setAccountData (account, "funmodev2-skin", tostring (getPedSkin (source)))
          setAccountData (account, "funmodev2-health", tostring (getElementHealth (source)))
          setAccountData (account, "funmodev2-armor", tostring (getPedArmor (source)))
          setAccountData (account, "funmodev2-R", r)
          setAccountData (account, "funmodev2-G", g)
          setAccountData (account, "funmodev2-B", b)
          setAccountData (account, "funmodev2-x", x)
          setAccountData (account, "funmodev2-y", y)
          setAccountData (account, "funmodev2-z", z)
          setAccountData (account, "funmodev2-int", getElementInterior (source))
          setAccountData (account, "funmodev2-dim", getElementDimension (source))
          setAccountData (account, "funmodev2-wantedlevel", getPlayerWantedLevel (source))
          setAccountData (account, "funmodev2-weaponID0", getPedWeapon (source, 0))
          setAccountData (account, "funmodev2-weaponID1", getPedWeapon (source, 1))
          setAccountData (account, "funmodev2-weaponID2", getPedWeapon (source, 2))
          setAccountData (account, "funmodev2-weaponID3", getPedWeapon (source, 3))
          setAccountData (account, "funmodev2-weaponID4", getPedWeapon (source, 4))
          setAccountData (account, "funmodev2-weaponID5", getPedWeapon (source, 5))
          setAccountData (account, "funmodev2-weaponID6", getPedWeapon (source, 6))
          setAccountData (account, "funmodev2-weaponID7", getPedWeapon (source, 7))
          setAccountData (account, "funmodev2-weaponID8", getPedWeapon (source, 8))
          setAccountData (account, "funmodev2-weaponID9", getPedWeapon (source, 9))
          setAccountData (account, "funmodev2-weaponID10", getPedWeapon (source, 10))
          setAccountData (account, "funmodev2-weaponID11", getPedWeapon (source, 11))
          setAccountData (account, "funmodev2-weaponID12", getPedWeapon (source, 12))
          setAccountData (account, "funmodev2-weaponAmmo0", getPedTotalAmmo (source, 0))
          setAccountData (account, "funmodev2-weaponAmmo1", getPedTotalAmmo (source, 1))
          setAccountData (account, "funmodev2-weaponAmmo2", getPedTotalAmmo (source, 2))
          setAccountData (account, "funmodev2-weaponAmmo3", getPedTotalAmmo (source, 3))
          setAccountData (account, "funmodev2-weaponAmmo4", getPedTotalAmmo (source, 4))
          setAccountData (account, "funmodev2-weaponAmmo5", getPedTotalAmmo (source, 5))
          setAccountData (account, "funmodev2-weaponAmmo6", getPedTotalAmmo (source, 6))
          setAccountData (account, "funmodev2-weaponAmmo7", getPedTotalAmmo (source, 7))
          setAccountData (account, "funmodev2-weaponAmmo8", getPedTotalAmmo (source, 8))
          setAccountData (account, "funmodev2-weaponAmmo9", getPedTotalAmmo (source, 9))
          setAccountData (account, "funmodev2-weaponAmmo10", getPedTotalAmmo (source, 10))
          setAccountData (account, "funmodev2-weaponAmmo11", getPedTotalAmmo (source, 11))
          setAccountData (account, "funmodev2-weaponAmmo12", getPedTotalAmmo (source, 12))
        end
      end
    end
    addEventHandler ("onPlayerQuit", getRootElement(), onQuit)
    
    function onWasted(totalAmmo, killer, killerWeapon, bodypart, stealth)
      if not( isGuestAccount (getPlayerAccount(source)) ) then
        local theWeapon = getPedWeapon (source)
        local weaponAmmo = getPedTotalAmmo (source)
        fadeCamera (source, false)
        setTimer (spawnPlayer, 1000, 1, source, 2036.1735839844, -1413.0563964844, 16.9921875, 0, getPedSkin (source), 0, 0, getPlayerTeam(source))
        setTimer (setCameraTarget, 1250, 1, source, source)
        setTimer (fadeCamera, 2000, 1, source, true)
        setTimer (giveWeapon, 2000, 1, source, theWeapon, weaponAmmo, true)
      end
    end
    addEventHandler ("onPlayerWasted", getRootElement(), onWasted)
    
    ---
    
    function setTeam()
    local account = getPlayerAccount(source) -- gets players account
    local team = getAccountData (account, "team") -- gets players team
    if (team) and getTeamFromName(team) then
          setPlayerTeam(source, getTeamFromName(team)) -- sets players team
         end
    end
    addEventHandler("onPlayerLogin",root,setTeam) -- sets players team on login
     
    function save()
     local team = getPlayerTeam(source) -- Gets the players team
    local account = getPlayerAccount(source)
    if (team) and not isGuestAccount(account) then -- Checks to see if the player is a guest or not
    setAccountData(account, "team", getTeamName(team)) --saves team
     end
        end
    addEventHandler("onPlayerQuit", getRootElement(), save) -- saves team on quit

    @Lord Henry

  8. 18 hours ago, DNL291 said:

    Mostre como está o seu código.

    function Revistar ( source, cmd, id )
        if getElementData ( source, "AirNewSCR_Policial1" ) == "Sim" then
            if getElementData(player, "ID") == id then 
            if id then           
                outputChatBox ( "#ffffff* Armas do cidadão "..getPlayerName(Jogador).."!", source, 255, 255, 255, true )
                outputChatBox ( " ", source, 255, 255, 255, true )                
                for slot = 0, 12 do
                    local Armas = getPedWeapon ( Jogador, slot )
                    local Municao = getPedTotalAmmo ( Jogador, slot ) 
                    if Armas > 0 then
                        if Municao > 0 then
                            weapon_nome = getWeaponNameFromID ( Armas )
                            outputChatBox ( "#ffffff* "..weapon_nome.." #3a3a3a»#25e014 "..Municao.." Bala(s)!", source, 255, 255, 255, true )                       
                        end
                    end
                end
            else
                outputChatBox ( "* Erro: Jogador não encontrado!", source )
            end
        end
    end
    addCommandHandler ( "verarmas", Revistar )

    Ele não dá erro no debugscript 3 mais ele não funciona quando executa o comando /verarmas id.

  9. On 19/06/2019 at 20:45, DNL291 said:

    Pra isso você precisa primeiro do sistema de ID. Então você irá obter com uma função exportada ou getElementData dependendo de como tiver no script, e substitui pela função do sistema de ID.

    Sim, eu já tenho o Mod de ID. É ele possuí uma data sim! Como eu faço pra mudar me ajuda?

  10. local money = getPlayerMoney(localPlayer)
    if money > 99999999 then money = 99999999 end
    	local cash = money
    	local stcash = tostring(money)
    if #stcash == 1 then
    	dxDrawText("  "..cash.."", x*1133, y*65, x*956, y*65, tocolor(255, 255, 255, 255), x*1.00, Font_1, "left", "top", false, false, false, false, false)
    	dxDrawImage(x*1105, y*57, x*30, y*25, "Img/Carteira.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
    end
    if #stcash == 2 then
    	dxDrawText("  "..cash.."", x*1133, y*65, x*956, y*65, tocolor(255, 255, 255, 255), x*1.00, Font_1, "left", "top", false, false, false, false, false)
    	dxDrawImage(x*1105, y*57, x*30, y*25, "Img/Carteira.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 	
    end	
    if #stcash == 3 then
    	dxDrawText("  "..cash.."", x*1133, y*65, x*956, y*65, tocolor(255, 255, 255, 255), x*1.00, Font_1, "left", "top", false, false, false, false, false)
    	dxDrawImage(x*1105, y*57, x*30, y*25, "Img/Carteira.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
    end	 
    if #stcash == 4 then
    	dxDrawText("  "..cash.."", x*1133, y*65, x*956, y*65, tocolor(255, 255, 255, 255), x*1.00, Font_1, "left", "top", false, false, false, false, false)
    	dxDrawImage(x*1105, y*57, x*30, y*25, "Img/Carteira.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
    end		
    if #stcash == 5 then
    	dxDrawText("  "..cash.."", x*1133, y*65, x*956, y*65, tocolor(255, 255, 255, 255), x*1.00, Font_1, "left", "top", false, false, false, false, false)
    	dxDrawImage(x*1105, y*57, x*30, y*25, "Img/Carteira.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
    end 
    if #stcash == 6 then
    	dxDrawText("  "..cash.."", x*1133, y*65, x*956, y*65, tocolor(255, 255, 255, 255), x*1.00, Font_1, "left", "top", false, false, false, false, false)
    	dxDrawImage(x*1105, y*57, x*30, y*25, "Img/Carteira.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
    end	
    if #stcash == 7 then
    	dxDrawText("  "..cash.."", x*1133, y*65, x*956, y*65, tocolor(255, 255, 255, 255), x*1.00, Font_1, "left", "top", false, false, false, false, false)
    	dxDrawImage(x*1105, y*57, x*30, y*25, "Img/Carteira.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
    end	
    if #stcash == 8 then
    	dxDrawText("  "..cash.."", x*1133, y*65, x*956, y*65, tocolor(255, 255, 255, 255), x*1.00, Font_1, "left", "top", false, false, false, false, false)
    	dxDrawImage(x*1105, y*57, x*30, y*25, "Img/Carteira.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
    end
    ----[convert]-----
    function convertNumber ( number )  
    	local formatted = number  
    	while true do      
    		formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2')    
    		if ( k==0 ) then      
    			break   
    		end  
    	end  
    	return formatted
    end

    @DNL291

  11. On 5/26/2019 at 5:19 PM, DNL291 said:

    É  o que estou tentando fazer. Mostra algum erro no seu debugmode?

    Tente:

    
    local x,y = guiGetScreenSize()addEventHandler("onClientResourceStart", resourceRoot, function()	addEventHandler ("onClientRender", root, drawPlayerMoney )end)function drawPlayerMoney()	local money = getPlayerMoney (localPlayer)		dxDrawBorderedText (1, "Seu Dinheiro:", 560, 344, 729, 376, tocolor(244, 131, 10, 255), 2.00, "default-bold", "left", "top")	dxDrawBorderedText (1, "$"..convertNumber(money), 729, 344, 898, 376, tocolor(255, 255, 255, 200), 2.00, "default-bold", "left", "top")	dxDrawImage(x*1105, y*57, x*30, y*25, "Img/Carteira.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)endfunction convertNumber (number)  	local formatted = number  	while true do      		formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2')    		if (k == 0) then      			break   		end  	end  	return formattedendfunction dxDrawBorderedText (outline, text, left, top, right, bottom, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY)	for oX = (outline * -1), outline do		for oY = (outline * -1), outline do			dxDrawText (text, left + oX, top + oY, right + oX, bottom + oY, tocolor(0, 0, 0, 255), scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY)		end	end	dxDrawText (text, left, top, right, bottom, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY)end

     

    Mais esse ai não tem como colocar na hud. Não tem como adptar ele no meu código não ?
     

  12. 17 hours ago, Jonas^ said:
    
    local money = getPlayerMoney (localPlayer)if money > 99999999 then money = 99999999 endlocal cash = moneylocal stcash = tostring(money)if #stcash == 1 then	dxDrawText ("$"..convertNumber(cash), x*1133, y*65, x*956, y*65, tocolor(255, 255, 255, 255), x*1.00, Font_1, "left", "top", false, false, false, false, false)	dxDrawImage (x*1105, y*57, x*30, y*25, "Img/Carteira.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end if #stcash == 2 then	dxDrawText ("$"..convertNumber(cash), x*1133, y*65, x*956, y*65, tocolor(255, 255, 255, 255), x*1.00, Font_1, "left", "top", false, false, false, false, false)	dxDrawImage (x*1105, y*57, x*30, y*25, "Img/Carteira.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 	end	if #stcash == 3 then	dxDrawText ("$"..convertNumber(cash), x*1133, y*65, x*956, y*65, tocolor(255, 255, 255, 255), x*1.00, Font_1, "left", "top", false, false, false, false, false)	dxDrawImage(x*1105, y*57, x*30, y*25, "Img/Carteira.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end	 if #stcash == 4 then	dxDrawText ("$"..convertNumber(cash), x*1133, y*65, x*956, y*65, tocolor(255, 255, 255, 255), x*1.00, Font_1, "left", "top", false, false, false, false, false)	dxDrawImage (x*1105, y*57, x*30, y*25, "Img/Carteira.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end		if #stcash == 5 then	dxDrawText ("$"..convertNumber(cash), x*1133, y*65, x*956, y*65, tocolor(255, 255, 255, 255), x*1.00, Font_1, "left", "top", false, false, false, false, false)	dxDrawImage (x*1105, y*57, x*30, y*25, "Img/Carteira.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end if #stcash == 6 then	dxDrawText ("$"..convertNumber(cash), x*1133, y*65, x*956, y*65, tocolor(255, 255, 255, 255), x*1.00, Font_1, "left", "top", false, false, false, false, false)	dxDrawImage (x*1105, y*57, x*30, y*25, "Img/Carteira.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end	if #stcash == 7 then	dxDrawText ("$"..convertNumber(cash), x*1133, y*65, x*956, y*65, tocolor(255, 255, 255, 255), x*1.00, Font_1, "left", "top", false, false, false, false, false)	dxDrawImage (x*1105, y*57, x*30, y*25, "Img/Carteira.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end	if #stcash == 8 then	dxDrawText ("$"..convertNumber(cash), x*1133, y*65, x*956, y*65, tocolor(255, 255, 255, 255), x*1.00, Font_1, "left", "top", false, false, false, false, false)	dxDrawImage (x*1105, y*57, x*30, y*25, "Img/Carteira.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end----[convert]-----function convertNumber (number)  	local formatted = number  	while true do      		formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2')    		if (k == 0) then      			break   		end  	end  	return formattedend

    @Luccas

    tá com erros 

    No $"..convertNumber(cash)

    17 hours ago, DNL291 said:

    Testou o código que o Jonas postou? Digite /debugscript 3 para ver erros. 

    Me ajuda?
     

×
×
  • Create New...