Jump to content

.:HyPeX:.

Members
  • Posts

    1,255
  • Joined

  • Last visited

Everything posted by .:HyPeX:.

  1. this is total server side.. i'll check it myself since this was based on multiple user reports. i used before also a previous version of the script wich used to show it to everyone connected.. this is why i didnt doubted it. (it only had client side, no server script at all) function command(player, cmd, ...) text = table.concat({...}," ") local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( "SuperModerator" ) ) then triggerClientEvent("announce2", getRootElement()) end end addCommandHandler("a", command, false, false) function setAnnounce(player, cmd, ...) text = table.concat({...}," ") local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( "SuperModerator" ) ) then triggerClientEvent("setAnnounce2", getRootElement(), text) end end addCommandHandler("sa", setAnnounce, false, false)
  2. Did it, when a player does /win, all players get the event handler, can you answer my question IF you know abbout it instead of saying :~? thanks HyPeX
  3. What he said was quite interesting and useful. I'm certainly thankful he posted that here. You've already received quite a lot of useful advice from this thread too, If you are more appreciative perhaps people will be more willing to help. I'm tired of reading without finding a fix to this
  4. maybe..? guiSetText(Colt45_Levels, Levels1.level)
  5. all this is mostly senseless, did you read the topic? this is sent to all players when one of them does /win, not when i activate the trigger
  6. it shouldnt but when a player does /win it shows it to everyone Whole script : local x,y = guiGetScreenSize() local announce = "default" local Streak = "1" announce = "default" Streak = "1" function setStreak(streak) Streak = streak end addEvent("setStreak", true) addEventHandler("setStreak", getRootElement(), setStreak) function setAnnounce(text) announce = text end addEvent("setAnnounce", true) addEventHandler("setAnnounce", getRootElement(), setAnnounce) function announce() executeCommandHandler ( "win", localplayer) end addEvent("announce", true) addEventHandler("announce", getRootElement(), announce) local Dx_Rec = nil addCommandHandler("win", function () if Dx_Rec then return end Dx_Rec = {} Dx_Rec.startTime = getTickCount() Dx_Rec.endTime = Dx_Rec.startTime + 2000 Dx_Rec.easingFunction = "InQuad" addEventHandler("onClientRender", root, drawStuff) end) function drawStuff() local x,y = guiGetScreenSize() local now = getTickCount() local elapsedTime = now - Dx_Rec.startTime local duration = Dx_Rec.endTime - Dx_Rec.startTime local progress = elapsedTime / duration local fAnimationTime = getEasingValue(progress, Dx_Rec.easingFunction) local alpha = fAnimationTime*200 local alphal = alpha/1.2 dxDrawRectangle ( 0, y/1.4, x, y, tocolor ( 0, 0, 0, alpha ) ) dxDrawText ( "Winner: #ffffff " .. announce, 0, y/1.3, x, y, tocolor ( 0, 170, 255, alpha ), 1.3, "bankgothic", "center","top",nil,nil,nil, true, true ) dxDrawText ( "Streak: #00aaff( #ffffffx" .. Streak .." #00aaff)", 0, y/1.15, x, y, tocolor ( 0, 170, 255, alpha ), 1.3, "bankgothic", "center","top",nil,nil,nil, true, true ) dxDrawLine ( 0, y/1.02, x, y/1.02, tocolor ( 0, 170, 255, alphal ), 15 ) dxDrawLine ( 0, y/1.4, x, y/1.4, tocolor ( 0, 170, 255, alphal ), 15 ) if now > Dx_Rec.endTime then removeEventHandler("onClientRender", getRootElement(), drawStuff) addEventHandler("onClientRender", getRootElement(), Paused) Pause = setTimer(function() removeEventHandler("onClientRender", root, Paused) Dx_Rec.startTime = getTickCount() Dx_Rec.endTime = Dx_Rec.startTime + 4000 Dx_Rec.easingFunction = "OutQuad" --Fast at first then decelerating addEventHandler("onClientRender", root, UndrawStuff) end, 5000, 1) end end function Paused() dxDrawRectangle ( 0, y/1.4, x, y, tocolor ( 0, 0, 0, 200 ) ) dxDrawText ( "Winner: #ffffff " .. announce, 0, y/1.3, x, y, tocolor ( 0, 170, 200, alpha ), 1.3, "bankgothic", "center","top",nil,nil,nil, true, true ) dxDrawText ( "Streak: #00aaff(#ffffff x" .. Streak .." #00aaff)", 0, y/1.15, x, y, tocolor ( 0, 170, 255, 200 ), 1.3, "bankgothic", "center","top",nil,nil,nil, true, true ) dxDrawLine ( 0, y/1.02, x, y/1.02, tocolor ( 0, 170, 255, 166 ), 15 ) dxDrawLine ( 0, y/1.4, x, y/1.4, tocolor ( 0, 170, 255, 166 ), 15 ) end function UndrawStuff() local x,y = guiGetScreenSize() local now = getTickCount() local elapsedTime = now - Dx_Rec.startTime local duration = Dx_Rec.endTime - Dx_Rec.startTime local progress = elapsedTime / duration local fAnimationTime = getEasingValue(progress, Dx_Rec.easingFunction) local alpha = (1-fAnimationTime)*200 local alphal = alpha/1.2 dxDrawRectangle ( 0, y/1.4, x, y, tocolor ( 0, 0, 0, alpha ) ) dxDrawText ( "Winner: #ffffff " .. announce, 0, y/1.3, x, y, tocolor ( 0, 170, 255, alpha ), 1.3, "bankgothic", "center","top",nil,nil,nil, true, true ) dxDrawText ( "Streak: #00aaff(#ffffff x" .. Streak .." #00aaff)", 0, y/1.15, x, y, tocolor ( 0, 170, 255, alpha ), 1.3, "bankgothic", "center","top",nil,nil,nil, true, true ) dxDrawLine ( 0, y/1.02, x, y/1.02, tocolor ( 0, 170, 255, alphal ), 15 ) dxDrawLine ( 0, y/1.4, x, y/1.4, tocolor ( 0, 170, 255, alphal ), 15 ) if now > Dx_Rec.endTime - 200 then removeEventHandler("onClientRender", root, UndrawStuff) Dx_Rec = nil end end fileDelete("A_C.lua") This is on server side to let a userpanel output a winner: (server side) outputChatBox ("#00ff00* #FFFFFF" .. getPlayerName(winner) .." #FFFFFFhas won! He/She gets $#00ff00" .. tostring(cashToWin) .." #ffffffand #00ff00"..points.."#ffffff points || x"..WinStreak.."#00ff00!",getRootElement(),255,255,255,true) triggerClientEvent("Streaktext", root, WinStreak) local text = getPlayerName(winner) local streak = WinStreak triggerClientEvent("setAnnounce", getRootElement(), text) triggerClientEvent("setStreak", getRootElement(), streak) triggerClientEvent("announce", getRootElement())
  7. The meta is obiously right aswell as the script. The fact is that if i do it root, when a player does /win everyone sees it.
  8. If you use a shader, then it will only be applied for the local client and other players wont see him as different... searching for a way to do this..
  9. .:HyPeX:.

    Server Error

    This is 1.3.4, not sure what revision.. if you tell me where i can check that..
  10. Did it, when a player does /win, all players get the event handler, can you answer my question IF you know abbout it instead of saying bullshit? thanks HyPeX
  11. To start with, you probably dont know what is this nor you know how to script, else you would obiously know that this is okay, and that you are trying to copy something when you have to also call it in. You should try reading the wiki, it helps, and also, read the tutorial. https://wiki.multitheftauto.com/wiki/Sc ... troduction -- Apart, this is particulary strange, and senseless, elseif does alot better:
  12. i only want to add it to a local player. this way probably? addCommandHandler("win", function () if Dx_Rec then return end Dx_Rec = {} Dx_Rec.startTime = getTickCount() Dx_Rec.endTime = Dx_Rec.startTime + 2000 Dx_Rec.easingFunction = "InQuad" addEventHandler("onClientRender",localplayer, drawStuff) end)
  13. Hello, will this work on a client side script? addEventHandler("onClientRender", getRootElement(localplayer), drawStuff)
  14. Hello, can i replace the painjobs and have custom ones? so i can make them as a mod in my server... as paintjobs actually are like a txd and players can see who has each paintjob.. it could make something interesting. If i can replace them, i would like to know how and wich file, and with wich function. Thanks HyPeX
  15. the much referred to the like, it should've been "i dont like that much..." what mixes me, is the structure
  16. Yeah, i'm making client, a friend does serverside, i'll include that. anyways i dont like much that usage of addeventhandler, it mixes me too much
  17. .:HyPeX:.

    Server Error

    i couldnt find how to post this on the bugs secion of mtasa, (bugs.mtasa.com), and dont know where to post this, i suppose here: http://i.imgur.com/avowlTT.png
  18. Thanks, i was just thinking this, but wanted to see if there was a special function. i'll test it out and post what happens..
  19. Hello, is there a function to check if the client clicks in a specific "region"? so if i create a DxDrawRectangle i can know when a client clicks it. Thanks HyPeX
  20. Well, to start with, as it says, it is a very high perfomance requieriment thing, and i cant simply call it every time a player crashes if there are 32 players.. it would'be a madness, not mentioning its a headache to make it work Still searching for a better solution.. EDIT// should this work? function PassTheFlag(Attacker, force, bodypart, X, Y, Z, NX, NY, NZ, HitElementForce, model) local vehicle = getPedOccupiedVehicle( localplayer ) local lx, ly, lz = getElementPosition( vehicle ) local avehicle = getPedOccupiedVehicle( Attacker ) local ax, ay, az = getElementPosition( avehicle ) local hit, x, y, z, elementHit, nx, ny, nz, mat, light, part, id = processLineOfSight ( ax, ay, az, lx, ly, lz ) if localplayer == FlagHolder then if part == 4 then FlagHolder = Attacker local uvehicle = getPedOccupiedVehicle( Attacker ) setVehicleColor( uvehicle, 0, 255, 0 ) local avehicle = getPedOccupiedVehicle( localplayer ) setVehicleColor( avehicle, 255, 0, 0 ) triggerEvent("OnFlagChange", Attacker) outputChatBox("Your flag was stolen by ".. getPlayerName(Attacker), localplayer, 255,255,255, true) else outputChatBox("You were hit by ".. getPlayerName(Attacker) .." be carefull!", localplayer, 255,255,255, true) end end end addEventHandler("OnClientVehicleCollision", getRootElement(), PassTheFlag)
  21. Try this: local Xr,Yr,Zr = getElementRotation(vehicle) if Xr > 90 and Xr < 270 and Yr > 90 and Yr < 270 then end Yeah, did that some time ago: FlagCheck = setTimer(FlagDropped, 500, 0) function FlagDropped() local vehicle = getPedOccupiedVehicle( localplayer ) local rx, ry, rz = getElementRotation( vehicle ) local x, y, z = getElementPosition( vehicle ) if localplayer == FlagHolder then if rx > 100 and rx < 260 or ry > 100 and ry < 260 then Flag = createMarker ( x, y, z, "checkpoint", 5, 0, 175, 255, 255 ) setMarkerColor(Flag, r, g, b, a) triggerEvent("OnFlagDrop") end end end ----------------- Any bump on the vehicle part problem, someone?
  22. Hello, i'm trying to know when a player is crashed in the rear bumper.. will this work or whats the correct name of rear bumper for a script? PD: i'm ussing onClientVehicleCollision - https://wiki.multitheftauto.com/wiki/On ... eCollision function PassTheFlag(Attacker, force, bodypart, X, Y, Z, NX, NY, NZ, HitElementForce, model) if localplayer == FlagHolder then if bodypart == rearbumper then PD: how could i know if a vehicle is "turned"? (with the wheels facing the sky)
  23. Error in line .. Near smth this will be most surely the answer.
  24. You woud've gotten the error yourself.. try using /debugscript 3 if u're admin on the server, or check if there's an output on the program u're using.
×
×
  • Create New...