Jump to content

K4stic

Members
  • Posts

    708
  • Joined

  • Last visited

Everything posted by K4stic

  1. check again code because i update it because not add it full
  2. how make it same place in all Screen size's? --Client side screenWidth, screenHeight = guiGetScreenSize() windowWidth, windowHeight = 300,170 left = screenWidth/1.18 - windowWidth/9.8 top = screenHeight/1.09 - windowHeight/20 dxDrawRectangle(screenWidth - 235,(screenHeight/2) + 416,210,20,tocolor(0,0,0,180)) dxDrawRectangle(screenWidth - 235,(screenHeight/2) + 441,210,20,tocolor(0,0,0,180)) dxDrawRectangle(screenWidth - 235,(screenHeight/2) + 466,210,20,tocolor(0,0,0,180)) dxDrawText ( "Text 1", left, top, screenWidth, (screenHeight/2), tocolor ( 200, 200, 200, 255 ), 1.0, "arial" ) dxDrawText ( "Text 2", left, top +25, screenWidth, (screenHeight/2), tocolor ( 200, 200, 200, 255 ), 1.0, "arial" ) dxDrawText ( "Text 3", left, top +50, screenWidth, (screenHeight/2), tocolor ( 200, 200, 200, 255 ), 1.0, "arial" ) i wonna to see like this but it show's like this only in my resolusion screen i wonna to be on all resolusions see like in my
  3. This code maked 80% by me and 20% by Castillo: function onQuit ( ) local account = getPlayerAccount ( source ) if ( isGuestAccount ( account ) ) then return end setAccountData ( account, "stat22", tostring ( getPedStat ( source, 69 ) ) ) setAccountData ( account, "stat23", tostring ( getPedStat ( source, 70 ) ) ) setAccountData ( account, "stat24", tostring ( getPedStat ( source, 71 ) ) ) setAccountData ( account, "stat25", tostring ( getPedStat ( source, 72 ) ) ) setAccountData ( account, "stat26", tostring ( getPedStat ( source, 73 ) ) ) setAccountData ( account, "stat27", tostring ( getPedStat ( source, 74 ) ) ) setAccountData ( account, "stat28", tostring ( getPedStat ( source, 75 ) ) ) setAccountData ( account, "stat29", tostring ( getPedStat ( source, 76 ) ) ) setAccountData ( account, "stat30", tostring ( getPedStat ( source, 77 ) ) ) setAccountData ( account, "stat31", tostring ( getPedStat ( source, 78 ) ) ) setAccountData ( account, "stat32", tostring ( getPedStat ( source, 79 ) ) ) end addEventHandler ( "onPlayerQuit", getRootElement(), onQuit ) function playerLogin ( _, account ) local Pistolskill = getAccountData ( account, "stat22" ) local SilencedPistolskill = getAccountData ( account, "stat23" ) local DesertEagleskill = getAccountData ( account, "stat24" ) local Shotgunskill = getAccountData ( account, "stat25" ) local SawnOffskill = getAccountData ( account, "stat26" ) local Spaz12skill = getAccountData ( account, "stat27" ) local Uziskill = getAccountData ( account, "stat28" ) local MP5skill = getAccountData ( account, "stat29" ) local AK47skill = getAccountData ( account, "stat30" ) local M4skill = getAccountData ( account, "stat31" ) local Sniperskill = getAccountData ( account, "stat32" ) setPedStat ( source, 69, Pistolskill ) setPedStat ( source, 70, SilencedPistolskill ) setPedStat ( source, 71, DesertEagleskill ) setPedStat ( source, 72, Shotgunskill ) setPedStat ( source, 73, SawnOffskill ) setPedStat ( source, 74, Spaz12skill ) setPedStat ( source, 75, Uziskill ) setPedStat ( source, 76, MP5skill ) setPedStat ( source, 77, AK47skill ) setPedStat ( source, 78, M4skill ) setPedStat ( source, 79, Sniperskill ) end addEventHandler ( "onPlayerLogin", getRootElement(), playerLogin )
  4. but i need in same script other then i charge team or other's charge team the color of blip not charget why? local playerBlipRoot = createElement("playerBlipRoot", "playerBlipRoot") function resourceStart() for _, player in ipairs(getElementsByType("player")) do if player ~= localPlayer then local r,g,b = getTeamColor(getPlayerTeam(player)) local blip = createBlipAttachedTo(player, 0, 2, r,g,b, 255, 1) setElementParent(blip, playerBlipRoot) end end end addEventHandler("onClientResourceStart", root, resourceStart) function playerJoin() local r,g,b = getTeamColor(getPlayerTeam(source)) local blip = createBlipAttachedTo(source, 0, 2, r,g,b, 255, 1) setElementParent(blip, playerBlipRoot) setTimer(updateBlipColor, 1500, 1, blip) end addEventHandler("onClientPlayerJoin", root, playerJoin) --This function destroys a players blip when they quit. function playerQuit() for _, blip in ipairs(getElementChildren(playerBlipRoot)) do if getElementAttachedTo(blip) == source then destroyElement(blip) end end end addEventHandler("onClientPlayerQuit", root, playerQuit) function updateBlipColor(player) local attach = getElementAttachedTo(player) if ( attach ) then local r,g,b = getTeamColor(getPlayerTeam(player)) setBlipColor(blip, r,g,b, 255) end end setTimer(updateBlipColor, 1000, 0)
  5. super fail not see blips
  6. i have take this script from community and some upgrade 1 bug. it's make all player's with red blip 2 bug. then player charge team the blip not charge color local playerBlipRoot = createElement("playerBlipRoot", "playerBlipRoot") --This function creates blips for all players when the resource starts. local function resourceStart() for _, player in ipairs(getElementsByType("player")) do if player ~= localPlayer then local r, g, b = getTeamColor(player) local blip = createBlipAttachedTo(player, 0, 2, r, g, b, 255, 1) setElementParent(blip, playerBlipRoot) end end end addEventHandler("onClientResourceStart", root, resourceStart) --This function creates a blip for new players when they join. local function playerJoin() local r, g, b = getTeamColor(source) local blip = createBlipAttachedTo(source, 0, 2, r, g, b, 255, 1) setElementParent(blip, playerBlipRoot) setTimer(updateBlipColor, 1500, 1, blip) --Upadate in 2 seconds, in case the server sets the color. end addEventHandler("onClientPlayerJoin", root, playerJoin) --This function destroys a players blip when they quit. local function playerQuit() for _, blip in ipairs(getElementChildren(playerBlipRoot)) do if getElementAttachedTo(blip) == source then destroyElement(blip) end end end addEventHandler("onClientPlayerQuit", root, playerQuit) --This function updates a blip's color, ensuring the blip colors always match. function updateBlipColor(player) local attach = getElementAttachedTo(player) if ( attach ) then local r, g, b = getTeamColor(player) setBlipColor(blip, r, g, b, 255) end end setTimer(updateBlipColor, 500, 0)
  7. Works good thaks you are Best
  8. like this? chat_range = 100 addEventHandler("onPlayerJoin",getRootElement(), function () bindKey(source,"u","down","chatbox","localchat") end) addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function () for index, player in pairs(getElementsByType("player")) do bindKey(player,"u","down","chatbox","localchat") 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("(Local) "..nick..":#FFFFFF "..msg,v,r,g,b,true) else if isPlayerMuted ( player ) then cancelEvent() end triggerEvent ( "onLocalChatMessage", v, player, msg ) end end addCommandHandler("localchat",onChat)
  9. How make then player muted to can't chat in Local and them not muted to can chat in local i know only who the EventHandler is "onPlayerChat" chat_range = 100 addEventHandler("onPlayerJoin",getRootElement(), function () bindKey(source,"u","down","chatbox","localchat") end) addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function () for index, player in pairs(getElementsByType("player")) do bindKey(player,"u","down","chatbox","localchat") 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("(Local) "..nick..":#FFFFFF "..msg,v,r,g,b,true) end triggerEvent ( "onLocalChatMessage", v, player, msg ) end end addCommandHandler("localchat",onChat)
  10. K4stic

    explosions

    in server side you can't make it but here un example in Client side: function removeDamageOnExplotion(_, _, _, theType) if getElementType(source) == "object" then cancelEvent() end end addEventHandler("onClientExplosion", root, removeDamageOnExplotion)
  11. agree with xXMADEXx this is not your script!
  12. K4stic

    [HELP] chat

    thx will try it today!
  13. K4stic

    [help] again

    Debugscript says Client have trigger "xxx" to server side but not awaible sorry bad english
  14. K4stic

    [HELP] chat

    Don't know how --Client side local textsToDraw = {} local hideown local showtime local characteraddition local maxbubbles local showthebubbles = true function income(message,messagetype) if source ~= getLocalPlayer() or not hideown then if messagetype == 2 then if getPlayerTeam(source) == getPlayerTeam(getLocalPlayer()) then addText(source,message,messagetype) end else local message = string.gsub(message, "#%x%x%x%x%x%x", "") local message = string.gsub(message, "#%x%x%x%x%x%x", "") local message = string.gsub(message, "#%x%x%x%x%x%x", "") addText(source,message,messagetype) end end end function addText(source,message,messagetype) local notfirst = false for i,v in ipairs(textsToDraw) do if v[1] == source then v[4] = v[4] + 1 notfirst = true end end local infotable = {source,message,messagetype,0} table.insert(textsToDraw,infotable) if not notfirst then setTimer(removeText,showtime + (#message * characteraddition),1,infotable) end end function removeText(infotable) for i,v in ipairs(textsToDraw) do if v[1] == infotable[1] and v[2] == infotable[2] then for i2,v2 in ipairs(textsToDraw) do if v2[1] == v[1] and v[4] - v2[4] == 1 then setTimer(removeText,showtime + (#v2[2] * characteraddition),1,v2) end end table.remove(textsToDraw,i) break end end end function getTextsToRemove() for i,v in ipairs(textsToDraw) do if v[1] == source then removeText(v) end end end function handleDisplay() if showthebubbles then for i,v in ipairs(textsToDraw) do if isElement(v[1]) and isElementStreamedIn(v[1]) then if getElementHealth(v[1]) > 0 then local camPosXl, camPosYl, camPosZl = getPedBonePosition (v[1], 6) local camPosXr, camPosYr, camPosZr = getPedBonePosition (v[1], 7) local x,y,z = (camPosXl + camPosXr) / 2, (camPosYl + camPosYr) / 2, (camPosZl + camPosZr) / 2 --local posx,posy = getScreenFromWorldPosition(x,y,z+0.25) local cx,cy,cz = getCameraMatrix() local px,py,pz = getElementPosition(v[1]) local distance = getDistanceBetweenPoints3D(cx,cy,cz,px,py,pz) local posx,posy = getScreenFromWorldPosition(x,y,z+0.020*distance+0.10) local veh1 = getPedOccupiedVehicle(localPlayer) local veh2 = getPedOccupiedVehicle(v[1]) if (not veh1) then veh1 = nil end if (not veh2) then veh2 = nil end if posx and distance <= 90 and ( isLineOfSightClear(cx,cy,cz,px,py,pz,true,true,false,true,false,true,true,veh1) or isLineOfSightClear(cx,cy,cz,px,py,pz,true,true,false,true,false,true,true,veh2) ) and ( not maxbubbles or v[4] < maxbubbles ) then -- change this when multiple ignored elements can be specified local width = dxGetTextWidth(v[2],1,"default") dxDrawRectangle(posx - (3 + (0.5 * width)),posy - (2 + (v[4] * 20)),width + 5,19,tocolor(0,0,0,255)) dxDrawRectangle(posx - (6 + (0.5 * width)),posy - (2 + (v[4] * 20)),width + 11,19,tocolor(0,0,0,40)) dxDrawRectangle(posx - (8 + (0.5 * width)),posy - (1 + (v[4] * 20)),width + 15,17,tocolor(0,0,0,255)) dxDrawRectangle(posx - (10 + (0.5 * width)),posy - (1 + (v[4] * 20)),width + 19,17,tocolor(0,0,0,40)) dxDrawRectangle(posx - (10 + (0.5 * width)),posy - (v[4] * 20) + 1,width + 19,13,tocolor(0,0,0,255)) dxDrawRectangle(posx - (12 + (0.5 * width)),posy - (v[4] * 20) + 1,width + 23,13,tocolor(0,0,0,40)) dxDrawRectangle(posx - (12 + (0.5 * width)),posy - (v[4] * 20) + 4,width + 23,7,tocolor(0,0,0,255)) local r,g,b = 255,255,255 if v[3] == 2 then r,g,b = getTeamColor(getPlayerTeam(v[1])) end dxDrawText(v[2],posx - (0.5 * width),posy - (v[4] * 20),posx - (0.5 * width),posy - (v[4] * 20),tocolor(r,g,b,255),1,"default","left","top",false,false,false) end end end end end end function getServerSettings() triggerServerEvent("onAskForBubbleSettings",getLocalPlayer()) end function saveSettings(settings) showtime = settings[1] characteraddition = settings[2] maxbubbles = settings[3] hideown = settings[4] addEvent("onMessageIncome",true) addEventHandler("onMessageIncome",getRootElement(),income) end function toggleBubblesOnOff() showthebubbles = not showthebubbles outputChatBox("Toggled chatbubbles " ..( not showthebubbles and "#FF0000off#FFFFFF." or "#00FF00on#FFFFFF." ),255,255,255,true) end addEventHandler("onClientPlayerQuit",getRootElement(),getTextsToRemove) addEventHandler("onClientRender",getRootElement(),handleDisplay) addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),getServerSettings) addEvent("onBubbleSettingsReturn",true) addEventHandler("onBubbleSettingsReturn",getRootElement(),saveSettings) addCommandHandler("chatbubbles",toggleBubblesOnOff) --Server side local showtime = tonumber(get("chatbubbles.DefaultTime")) local characteraddition = tonumber(get("chatbubbles.PerCharacterAddition")) local maxbubbles = get("chatbubbles.MaxBubbles") if maxbubbles == "false" then maxbubbles = false else maxbubbles = tonumber(maxbubbles) end local hideown = get("chatbubbles.HideOwn") if hideown == "true" then hideown = true else hideown = false end function sendMessageToClient(message,messagetype) if not wasEventCancelled() then if messagetype == 0 or messagetype == 2 then triggerClientEvent("onMessageIncome",source,message,messagetype) end end end function returnSettings() local settings = { showtime, characteraddition, maxbubbles, hideown } triggerClientEvent(source,"onBubbleSettingsReturn",getRootElement(),settings) end addEvent ( "onPlayerLocalChat", true ) addEventHandler("onPlayerLocalChat",getRootElement(),sendMessageToClient) addEvent("onAskForBubbleSettings",true) addEventHandler("onAskForBubbleSettings",getRootElement(),returnSettings)
  15. yea it's droped it but player not love that ammo or weap
  16. K4stic

    [help] again

    says not awaible that trigger
  17. ok i fix it thx but then i wonna drop dildo or something else (knife,dildo,katana,flower) it's says "You Don't Have engough Ammo in that Weapon to Drop it"
  18. K4stic

    [help] again

    i make it client side because don't know how make it in server side so help me more more code local aObjects = { { "Hat 1", 2052 }, { "Hat 2", 2053 }, { "Hat 3", 2054 }, { "Grass Hat", 861 }, { "Grass Hat 2", 862 }, { "Flag hat", 2993 }, { "Pizza Box hat", 2814 }, { "Roulete hat", 1895 }, { "Ventilator hat", 1661 }, { "Model car hat", 2485 }, }; list = guiCreateGridList( 0.1, 0.1, 0.8, 0.60, true, window ); guiGridListAddColumn( list, "VIP Hats", 0.85 ); for _,obj in ipairs( aObjects ) do hRow = guiGridListAddRow( list ); -- guiGridListSetItemText ( list, hRow, 1, tostring( obj [ 1 ] ), false, false ); guiGridListSetItemData ( list, hRow, 1, tostring( obj [ 2 ] ) ); end function use ( ) local row, col = guiGridListGetSelectedItem ( list ) if ( row and col and row ~= -1 and col ~= -1 ) then local model = tonumber ( guiGridListGetItemData ( list, row, 1 ) ) local x, y, z = getElementPosition ( localPlayer ) if ( isElement ( object ) ) then destroyElement ( object ) end object = createObject ( model, x, y, z + 1, 0, 0, 0 ) attachElements(object, localPlayer, 0.025, -0.01, 0.815, 0, 0, 180) end end addEventHandler ( "onClientGUIClick", _use, use, false )
  19. K4stic

    [help] again

    no errors just wonna charge but how don't know so: Then i charge the localplayer from line 10 to player or thePlayer it stop be attached i have make lot tryis i wonna charge the localplayer because i wonna to see that object all no only local Player function use ( ) local row, col = guiGridListGetSelectedItem ( list ) if ( row and col and row ~= -1 and col ~= -1 ) then local model = tonumber ( guiGridListGetItemData ( list, row, 1 ) ) local x, y, z = getElementPosition ( localPlayer ) if ( isElement ( object ) ) then destroyElement ( object ) end object = createObject ( model, x, y, z + 1, 0, 0, 0 ) attachElements(object, localPlayer, 0.025, -0.01, 0.815, 0, 0, 180) end end addEventHandler ( "onClientGUIClick", _use, use, false ) Sorry for my Bad english
  20. K4stic

    [HELP] chat

    --Server side local showtime = tonumber(get("chatbubbles.DefaultTime")) local characteraddition = tonumber(get("chatbubbles.PerCharacterAddition")) local maxbubbles = get("chatbubbles.MaxBubbles") if maxbubbles == "false" then maxbubbles = false else maxbubbles = tonumber(maxbubbles) end local hideown = get("chatbubbles.HideOwn") if hideown == "true" then hideown = true else hideown = false end function sendMessageToClient(message,messagetype) if not wasEventCancelled() then if messagetype == 0 or messagetype == 2 then triggerClientEvent("onMessageIncome",source,message,messagetype) end end end function returnSettings() local settings = { showtime, characteraddition, maxbubbles, hideown } triggerClientEvent(source,"onBubbleSettingsReturn",getRootElement(),settings) end addEvent ( "onPlayerLocalChat", true ) addEventHandler("onPlayerLocalChat",getRootElement(),sendMessageToClient) addEvent("onAskForBubbleSettings",true) addEventHandler("onAskForBubbleSettings",getRootElement(),returnSettings) i fusion the chatbubbles with my Local chat but is no output the messages and no have errors Sorry for my bad english
×
×
  • Create New...