Jump to content

Resto

Members
  • Posts

    155
  • Joined

  • Last visited

Everything posted by Resto

  1. oh sorry. i fixed. But thanks.
  2. Resto

    Help please

    Thanks. Working.
  3. What is wrong with this code? Can anyone please tell me what is wrong? I need from x,xxx,xxx to xxxxxxx. function unconvertNumber(number) local result = number:gsub(',', ''); return tonumber(result); end
  4. Resto

    Help please

    Sorry. So i need clear table when player quit?
  5. Resto

    Help please

    but doesnt work..
  6. Resto

    Help please

    Doesnt work and your setElementData in blockpm ? wat
  7. Resto

    Help please

    Really thanks for your help but i need functions or example /blockpm <player> not for all players
  8. Resto

    Help please

    Helo all, can anyone tell me what functions i need for /blockpm <name> i used this PM system. local mycrpmpartner = {} function thePM(thePlayer,commandName,sendToName,...) local pmWords = { ... } local pmMessage = table.concat( pmWords, " " ) if sendToName then if getPlayerFromNamePart2(sendToName) then local toPlayer = getPlayerFromNamePart2(sendToName) if not (toPlayer == thePlayer) then --that () needed if not (pmMessage == "") then outputChatBox("#757575[PM] Message to #ff00ff" .. getPlayerName(toPlayer) .. ":#ffffff " .. pmMessage, thePlayer, 255, 255, 255, true) outputChatBox("#FF0000[PM] Message from #ffFFff" .. getPlayerName(thePlayer) .. ":#ffff00 " .. pmMessage, toPlayer, 255, 255, 255, true) mycrpmpartner[thePlayer]=toPlayer mycrpmpartner[toPlayer]=thePlayer else outputChatBox("#FF0000[PM]Use:#ff9900 /pm [part of name] [message]", thePlayer, 255, 255, 255, true) end else outputChatBox("#FF000[PM] You cannot PM yourself #ff9900!", thePlayer, 255, 255, 255, true) end else outputChatBox("#FF0000[PM] Player not found! #FFFF00[#ff9900"..sendToName.."#FFFF00]", thePlayer, 255, 255, 255, true) end else outputChatBox("#FF0000[PM]Use:#ff9900 /pm [part of name] [message]", thePlayer, 255, 255, 255, true) end end addCommandHandler("pm", thePM) function getPlayerFromNamePart2 ( name ) if ( name ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do local name_ = getPlayerName ( player ):gsub ( "#%x%x%x%x%x%x", "" ):lower ( ) if name_:find ( tostring ( name ):lower ( ), 1, true ) then return player end end end end
  9. i fixed. so thx all for help.
  10. Now its working only for one sec and i need always render when i join col. CLIENT-SIDE: local screenW, screenH = guiGetScreenSize() function addRenderHP(nemesis) if exports.extra_health:isElementWithExtraHealth(nemesis) then addEventHandler("onClientRender", getRootElement(), addRenderHP) dxDrawText("Nemesis Health: "..exports.extra_health:getElementExtraHealth(nemesis) .."", (screenW * 0.0000) + 1, (screenH * 0.1283) + 1, (screenW * 0.9988) + 1, (screenH * 0.1700) + 1, tocolor(0, 0, 0, 255), 2.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("Nemesis Health: "..exports.extra_health:getElementExtraHealth(nemesis) .."", screenW * 0.0000, screenH * 0.1283, screenW * 0.9988, screenH * 0.1700, tocolor(12, 254, 0, 255), 2.00, "default-bold", "center", "center", false, false, false, false, false) end end addEvent("addRenderHP", true) addEventHandler("addRenderHP", getRootElement(), addRenderHP) function RemoveRenderHP() removeEventHandler("onClientRender", getRootElement(), addRenderHP) end addEvent("RemoveRenderHP", true) addEventHandler("RemoveRenderHP", getRootElement(), RemoveRenderHP) SERVER-SIDE: nemesis = exports["slothbot"]:spawnBot(-2337.544921875, -1618.7431640625, 483.71304321289, 0, 12, 0, 0, nil, 0, "hunting", true) exports.extra_health:setElementExtraHealth(nemesis, 10000) addEventHandler("onColShapeHit", Area, function(source) if getElementType(source) == "player" then triggerClientEvent(source, "addRenderHP", getRootElement(), nemesis) end end)
  11. nothing. error or warning its not problem.. my question how i can export extra_health from server-side to client-side
  12. SERVER-SIDE: local Area = createColRectangle(-2374.2119140625, -1694.4833984375, 130, 150) addEventHandler("onColShapeHit", Area, function(source) if getElementType(source) == "player" then nemesishealth = exports.extra_health:getElementExtraHealth(nemesis) triggerClientEvent(source, "addRenderHP", getRootElement(), nemesishealth) end end) addEventHandler("onColShapeLeave", Area, function(source) if getElementType(source) == "player" then triggerClientEvent(source, "RemoveRenderHP", getRootElement()) end end) CLIENT-SIDE: local screenW, screenH = guiGetScreenSize() function renderHP(nemesis) dxDrawText("Nemesis Health: "..exports.extra_health:getElementExtraHealth(nemesis).."", (screenW * 0.0000) + 1, (screenH * 0.1283) + 1, (screenW * 0.9988) + 1, (screenH * 0.1700) + 1, tocolor(0, 0, 0, 255), 2.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("Nemesis Health: "..exports.extra_health:getElementExtraHealth(nemesis).."", screenW * 0.0000, screenH * 0.1283, screenW * 0.9988, screenH * 0.1700, tocolor(12, 254, 0, 255), 2.00, "default-bold", "center", "center", false, false, false, false, false) end function addRenderHP () addEventHandler("onClientRender", getRootElement(), renderHP) end addEvent("addRenderHP", true) addEventHandler("addRenderHP", getRootElement(), addRenderHP) function RemoveRenderHP() removeEventHandler("onClientRender", getRootElement(), renderHP) end addEvent("RemoveRenderHP", true) addEventHandler("RemoveRenderHP", getRootElement(), RemoveRenderHP) Can anyone help me with this? i don't know how to export nemesis health in client-side.
  13. Resto

    expected element

    Its simple for you.. But i again dont understand how to use in my code.. When you put in my code its easy learn..
  14. Resto

    expected element

    but must be if (PollResult == false) then ? or this is only for check? i need only local PollResult = dbPoll(QueryHandle, 500) or what do you mean with (try again or silmpy log it) ? can you show me please in my code what do you mean with this?
  15. Resto

    expected element

    why never use -1 ? at poll
  16. I don't know what is with this but i get warning expected element.. can anyone help me? function WTF(_, acc) local owner = getAccountName(acc) local result = dbQuery(database,"SELECT * FROM SpawnCar ORDER BY Owner DESC LIMIT 1") local poll = dbPoll(result, -1) for i,v in ipairs(poll) do vehicle = createVehicle(v["carID"], v["X"], v["Y"], v["Z"], 0, 0, 0, v["text"]) spawnVehicle(vehicle, v["X"], v["Y"], v["Z"]) setElementData(vehicle, "Owner", v["Owner"]) --setVehiclePlateText(vehicle, text) setVehicleColor(vehicle, v["Color1"], v["Color2"], v["Color3"]) setVehicleHeadLightColor(vehicle, v["R"], v["G"], v["B"]) setVehicleRespawnPosition(vehicle, v["X"], v["Y"], v["Z"]) end end addCommandHandler("spawnvehicle", WTF)
  17. Resto

    Question

    Is here anyone who know edit models with 3DS Max? If yes then send me a PM please.
  18. Resto

    [HELP] Warning

    it's only client-side not server-side. ???? so why you add the event handler here ???? are you sure that it's your code. addEvent("showClientMenuItem", true) addEventHandler("showClientMenuItem", getLocalPlayer(), showClientMenuItem) It's not my code.. but |LT|Marwin and -ffs-Sniper was released the dayz..
  19. Resto

    [HELP] Warning

    it's only client-side not server-side.
  20. Resto

    [HELP] Warning

    localPlayer is predefined variable ( returns the player element of the local player.) So using localPlayer / getLocalPlayer() is the same thing. I'm pretty sure arg2 is not defined in your code, post full code here. function showClientMenuItem(arg1,arg2,arg3,arg4) local number = 0 if arg1 == "Player" then if isElement(arg2) then if (getElementData(arg2,"bleeding") or 0) > 0 and (getElementData(getLocalPlayer(),"Bandage") or 0) >= 1 then number = number+1 guiSetVisible(spalteGuiImage[number],true) guiSetText(spalteGuiText[number],"Give Bandage") guiLabelSetColor (spalteGuiText[1],50,255,50) setElementData(spalteGuiText[1],"markedMenuItem",true) setElementData(spalteGuiText[number],"usedItem","bandage") end end end addEvent("showClientMenuItem", true) addEventHandler("showClientMenuItem", getLocalPlayer(), showClientMenuItem)
×
×
  • Create New...