Jump to content

TAPL

Retired Staff
  • Posts

    7,337
  • Joined

  • Days Won

    11

Everything posted by TAPL

  1. TAPL

    dcConnect

    Yes.
  2. Why you don't continue in same topic? https://forum.multitheftauto.com/viewtopic.php?f=91&t=74439 I said it clearly dxDrawText is a client side function. In server side you must use only triggerClientEvent below or above giveWeapon, the rest of the codes goes to the client side.
  3. TAPL

    [HELP] Ped Attack

    Find your own language here: https://forum.multitheftauto.com/viewforum.php?f=117
  4. TAPL

    SQL Light System

    addEventHandler("onResourceStart", resourceRoot, function () connection = dbConnect("sqlite", "data.db") dbExec(connection, "CREATE TABLE IF NOT EXISTS data (name TEXT, cash TEXT, x TEXT ,y TEXT ,z TEXT)") end) function toxin (thePlayer) local account = getPlayerAccount(thePlayer) if account and not isGuestAccount(account) then local acc = getAccountName(account) local x, y, z = getElementPosition(thePlayer) local cash = getPlayerMoney(thePlayer) outputChatBox(tostring(acc)..tostring(tonumber(cash))..tostring(x)..tostring(y)..tostring(z)) local result = dbPoll(dbQuery(connection, "SELECT name FROM data WHERE name = ?", acc), -1) if type(result) == "table" and #result ~= 0 then local tox = dbExec(connection,"UPDATE data SET cash = ?, x = ?, y = ?, z = ? WHERE name = ?", tostring(cash), tostring(x), tostring(y), tostring(z), tostring(acc)) outputChatBox(tostring(tox).."1") else local tox = dbExec(connection, "INSERT INTO data VALUES(?, ?, ?, ?, ?)", tostring(acc), tostring(cash), tostring(x), tostring(y), tostring(z)) outputChatBox(tostring(tox).."2") end end end addCommandHandler("doit", toxin) function pullData (thePlayer) local account = getPlayerAccount(thePlayer) if account and not isGuestAccount(account) then local acc = getAccountName(account) local result = dbPoll(dbQuery(connection, "SELECT * FROM data WHERE name = ?", acc), -1) for a,b in pairs (result[1]) do outputChatBox(a..": "..b) end end end addCommandHandler("pullData", pullData)
  5. I was feeling bored so i played with the code a little bit, as I don't know much about math so i took Socialz code from here dxDrawPartialCircle and turned it into this magic code. Try it. myPed = createPed(23, -1375.30627, -234.72827, 14.14844) setPedControlState(myPed, "forwards", true) radius = 50 -- doesn't seem to add any good effect width = 5 -- doesn't seem to add any good effect per = 3 -- lower this to increase the circle addEventHandler("onClientRender", root, function() percentage = percentage and percentage or 0 if (percentage < 360) then percentage = percentage+per else percentage = 0 end local function clamp(val, lower, upper) if (lower > upper) then lower, upper = upper, lower end return math.max(lower, math.min(upper, val)) end startAngle = clamp(0, 0, 360) endAngle = clamp(percentage or 360, 0, 360) if (endAngle < startAngle) then endaAngle = startAngle startAngle = endAngle end local posX, posY = getElementPosition(myPed) for i=startAngle,endAngle do local _i = i*(math.pi/180) setPedRotation(myPed, findRotation(math.cos(_i)*(radius-width)+posX, math.sin(_i)*(radius-width)+posY, -1375.30627, -234.72827)) end end) function findRotation(x1,y1,x2,y2) local t = -math.deg(math.atan2(x2-x1,y2-y1)) if t < 0 then t = t + 360 end; return t; end
  6. Try. myPed = createPed(23, -1375.30627, -234.72827, 14.14844) setPedControlState(myPed, "forwards", true) addEventHandler( "onClientRender", root, function() angleCounter = (angleCounter or 0) + 5 if angleCounter >= 360 then angleCounter = 0 end setPedCameraRotation(myPed, angleCounter) end)
  7. TAPL

    Play Sound fail

    That's because you put it in server side. This function is client side only, just make sure you have it client side in the meta.
  8. TAPL

    Extra Ammo kill

    Post what you've tried.
  9. TAPL

    Extra Ammo kill

    We're here to help only, try to make it yourself. Things you'll need: -- server side triggerClientEvent -- client side addEvent addEventHandler getPedBonePosition dxDrawText isTimer setTimer killTimer removeEventHandler
  10. TAPL

    Question

    In server side when the player login check if he is admin then set and element data where you can use it in client side. Also you can use trigger from client to server to client again.
  11. TAPL

    Extra Ammo kill

    local weaponA = { [31] = 50, -- M4 [34] = 10 -- Sniper } function playerWasted(_, attacker, weapon) if attacker and attacker ~= source and getElementType(attacker) == "player" then if weaponA[weapon] then giveWeapon(attacker, weapon, weaponA[weapon]) end end end addEventHandler("onPlayerWasted", root, playerWasted)
  12. onRedictPlayer onRedirectPlayer
  13. https://wiki.multitheftauto.com/wiki/DxDrawText select1 and select2 is function not a variable you can't use it as argument of font and font size. Also dxSetFont and dxSetSize is not a valid mta function and i can't see it defined as custom function anywhere in the code.
  14. TAPL

    stopResource

    Not possible.
  15. sa-mp doesn't have client side scripts.
  16. createPed fadeCamera setCameraMatrix bindKey unbindKey setElementModel getElementModel destroyElement triggerServerEvent addEvent addEventHandler spawnPlayer setCameraTarget
  17. TAPL

    O.o Please help

    I don't see a reason to put it client side. Moreover desync may occur. Try: Server Side: local EPAGate = createObject(980, 1024.0999755859, -368.60000610352, 75.699996948242, 0, 0, 358.73950195313) local EPAMark = createMarker(1023.9000244141, -367.70001220703, 73.699996948242, "corona", 5, 255, 255, 255, 255) addEventHandler("onMarkerHit", EPAMark, function(hitPlayer) if getElementType(hitPlayer) == "player" then local team = getPlayerTeam(hitPlayer) if (team and getTeamName(team) == "Elite Police Academy") then moveObject(EPAGate, 2000, 1024.0999755859, -368.60000610352, 81.099998474121, 0, 0, 358.73950195313) end end end) addEventHandler("onMarkerLeave", EPAMark, function(hitPlayer) if getElementType(hitPlayer) == "player" then local team = getPlayerTeam(hitPlayer) if (team and getTeamName(team) == "Elite Police Academy") then moveObject(EPAGate, 2000, 1024.0999755859, -368.60000610352, 75.699996948242, 0, 0, 358.73950195313) end end end)
  18. function repaircar() local vehicle = getPedOccupiedVehicle(source) if vehicle then local money = getPlayerMoney(source) if (getPlayerMoney(source) >= 30) then if getElementHealth(vehicle) < 1000 then fixVehicle(vehicle) takePlayerMoney(source, 30) else outputChatBox("#text!", source, 255, 0, 0, true) end else outputChatBox("text", source, 255, 0, 0, true) end end end addEvent("repairvehicle", true) addEventHandler("repairvehicle", root, repaircar)
  19. Idk what are you on about, I already posted it in loop.
  20. Nothing special, just a normal trigger like when you do it in same resource.
  21. I think outputChatBox doesn't accept table, so in case Citizen code doesn't work, try this: local function onplayerChat ( message, messageType ) if ( messageType == 2 ) then --Team (Clan) chat cancelEvent ( ) local name = getPlayerName ( source ) local red, green, blue = getPlayerNametagColor ( source ) local hex = RGBToHex ( red, green, blue ) local team = getPlayerTeam( source ) if not team then return outputChatBox( "You are not part of a team yet !", source, 200, 0, 0) end -- We have to get all the team members instead of using root local members = getPlayersInTeam( team ) or {} for _, player in ipairs(members) do outputChatBox( "#9AFE2E(CLAN)" .. hex.." "..name .. ":#FFFFFF" .. message, player, 255, 255, 255, true ) end outputServerLog( "(TEAM): " .. name .. ": " .. message ) end end addEventHandler ( "onPlayerChat", root, onplayerChat )
  22. مافيه شي اسمه جاهز تبي شي اتعب على نفسك و سويه بنفسك او دور لك واحد يسويه لك بمقابل
  23. موضوع استهبال يغلق
  24. You're welcome.
  25. Try. for i=1, 4 do guiGridListRemoveColumn ( GUIEditor.gridlist[1], 1 ) end
×
×
  • Create New...