Jump to content

.:HyPeX:.

Members
  • Posts

    1,255
  • Joined

  • Last visited

Everything posted by .:HyPeX:.

  1. Hi guys, i'm trying to make my antispam a little yet more advanced, but i'm finding problems to work this out (no idea how to properly use returns), can someone tell me how to use it properly? antiSpam = {} antiSpamTimer = {} function AntiSpam (message, messageType) if messageType == 0 and isTimer(antiSpam[source]) then if isTimer(antiSpamTimer[source]) then killTimer(antiSpamTimer[source]) cancelEvent () antiSpam[source] = setTimer(function(source) antiSpam[source] = nil end, 300000, 1, source) else return cancelEvent () killTimer(antiSpam[source]) antiSpam[source] = setTimer(function(source) antiSpam[source] = nil end, 10000, 1, source) outputChatBox("[AntiSpam]: Stop Flooding, Every new messange will restart your time muted!", source, 0, 170, 255) outputChatBox("[AntiSpam]: Type /sleft to get your time left muted.", source, 0, 170, 255) antiSpamTimer[source] = setTimer(function(source) antiSpamTimer[source] = nil end, 120000, 1, source) else antiSpam[source] = setTimer(function(source) antiSpam[source] = nil end, 1000, 1, source) end end end addEventHandler("onPlayerChat", getRootElement(), AntiSpam)
  2. Just joined, selling mappings (Wich are obiously not called like that). Can you show some pics, and why should Anyone trust you?
  3. My idea was to create a Ban List Like: <Bans> <Nick: Player1> <Player Name: #0ac300Player1> <Serial: 0agh321> <IP: 192.44.489.58> <Ban Time: 3 days> <Ban Reason: Spamming> <Banned By: HyPeX> <Time Left banned: 1 day, 13 hours, 54 minutes, 30 seconds> <Nick: Player2> <Player Name: #0ac300Player2> <Serial: hag5321> <IP: 192.45.129.85> <Ban Time: 1 days> <Ban Reason: hacking> <Banned By: HyPeX> <Time Left banned: 13 hours, 34 minutes, 59 seconds> </Bans>
  4. Hello guys, i'm just starting for my first time in my life with XML files and i'm not sure how to work this out.. The idea is to make a record of all bans to be saved on a file.. my idea was to make a record each time a ban was done.. according to what i've readed on wiki.. but i'm still not sure how to do this.. i'll thank any help in advance: function CreateBanNode() local RootNode = xmlCreateFile("Bans.xml"," Bans") local NewNode = xmlCreateChild(RootNode, Nick) end addCommandHandler("cf", CreateBanNode) function OnbanPlayer() if banPlayer then tostring ( target ) local NewNode = xmlCreateChild(RootNode, "Nick: target()") end end addEventHandler("onPlayerBan, CreateBanNode", getRootElement(), OnbanPlayer)
  5. Guys, the default race contains an anti repeating the same message function, where i can find it to use it for example?
  6. worked in behalf, the target didnt worked, outputs the else message, and the sleft tells me the time (fixed it actually it was "..remaining), but it also tells "you are free to speak" and when you're not muted it does nothing. EDIT//: my script didnt had the "else" on the you are free to speak part, only the unmute doesnt work.
  7. the first one uses target, what should i use there?
  8. Guys, i've tried lots of ways, and on these 2 im just getting the else outputted, and nothing happens.
  9. Okay guys, none of these work, any idea? function UnmuteSpam (target, thePlayer, command) target = tostring(target) if isTimer (antiSpam[target]) then killTimer (antiSpam[target]) outputChatBox("This player is now unmuted") else outputChatBox("This player wasn't muted") end end addCommandHandler("um", UnmuteSpam) function timerDetails() if isTimer(antiSpam[source]) then remaining, executesRemaining, totalExecutes = getTimerDetails( antiSpam[source] ) outputChatBox("Time remaining until chat free: ( remaining ), wait please.") else outputChatBox("You are free to speak") end end addCommandHandler("sleft", timerDetails)
  10. I wanted to set a time for the player to be muted. Okay this fixed it Now, if i want to know wich time i got left.. but i cant get the correct call of getTimerDetails, it just outputs the else message. function timerDetails() remaining, executesRemaining, totalExecutes = getTimerDetails( antiSpam[source] ) if (remaining and executesRemaining and totalExecutes) then outputChatBox("Time remaining this second: "..remaining.." Executes remaining: "..executesRemaining.." Total executes: "..totalExecutes) else outputChatBox("You are free to speak") end end addCommandHandler("sleft", timerDetails)
  11. Hi guys, i'm trying to make a kind of advanced anti spamming script with mutes, and im just starting, but i'm stuck here: The problem is when i try to get getTimerDetails is to get the time in the table thats left, it gets the timer expected that i want, (985, 1466,1467) but i do not know how to handle it correctly. Any idea? antiSpam = {} function AntiSpam (message, messageType) if messageType == 0 and isTimer(antiSpam[source]) then setTimer ( getTimerDetails(antiSpam[source])*2 ) cancelEvent () outputChatBox("Stop Flooding!", source, 255, 255, 0) else antiSpam[source] = setTimer(function(source) antiSpam[source] = nil end, 1000, 1, source) end end addEventHandler("onPlayerChat", getRootElement(), AntiSpam) //EDIT: I've found a litle improvement, but still i'm not sure how to call this. antiSpam = {} function AntiSpam (message, messageType) if messageType == 0 and isTimer(antiSpam[source]) then remaining = ( getTimerDetails( antiSpam[source] ) ) setTimer ( remaining*2 ) cancelEvent () outputChatBox("Stop Flooding!", source, 255, 255, 0) else antiSpam[source] = setTimer(function(source) antiSpam[source] = nil end, 1000, 1, source) end end addEventHandler("onPlayerChat", getRootElement(), AntiSpam)
  12. Thanks Guys, i've put some hours of work on this tutorial. Btw, Thanks for the help of Hunterix, here you got an extra: Hello guys, if you want to add more shaders and make them global, just change these lines: (Note that you will have to add more lines with createObject) -- Apply to world texture engineApplyShaderToWorldTexture ( myShader, "bobo_2" ) -- Create object with model 4729 (billboard) createObject ( 4729, X, Y, Z, RX, RY, RZ ) With: -- Create object with model 4729 (billboard) createObject(4729, X, Y, Z, RX, RY, RZ ) -- Apply to world texture objectShader = createObject engineApplyShaderToWorldTexture ( myShader, "bobo_2",objectShader )
  13. Still, you are setting a timer, you should start a timer, on play login (setTimer is a countdown) I'm not sure wich function does this, but you should start checking arround on the wiki, since Timer doesnt do it. (Not sure if GetElementData with GetTickCount could do it)
  14. Hello guys, Here today i got a very simple way of getting a billboard with a static image that moves (Yes it moves!, and it is noob-proof), using the UV-Scripted files from the wiki. Lets do it by steps. (I'm going to make it as i did on my map, Intervalia 2.) 1#: Download the "UV Scripted" Shader from the wiki.. https://wiki.multitheftauto.com/wiki/Shader_examples 2#: Unzip it and add it to your map folder: 3#: Edit meta and add the Lines requiered.. <script src="c_uv_scripted.lua" type="client" /> <file src="uv_scripted.fx" type="client" /> <file src="include/tex_matrix.fx" type="client" /> <file src="images/env3.bmp" type="client" /> 4#: Edit the image at "images" folder for the one you want! (NOTE: EDIT THE BMP FILE, AND IF U CHANGE IT, SAVE IT AS BMP and make sure is is the same name!) (I added this one in my case) <- Click for link 5#: Open the "c_uv_scripted.lua" file with notepad, or your preferred lua editor. Scroll down (or search) This lines: -- Create object with model 4729 (billboard) local x,y,z = getElementPosition( getLocalPlayer() ) createObject ( 4729, x-15, y, z+3 ) 6#: Replace them with the following lines: (Keep it open on those lines, dont close it!) -- Create object with model 4729 (billboard) createObject ( 4729, x, y, z, rx, ry, rz ) 7#: Go to your map and create a billboard (Model "4729") where you want to place it, and get its coords. (After getting them, delete the object.) 8#: Now go back to the lines we placed on step 6, and replace the "X Y Z" with the "X Y Z" Values from the position, and the "RX RY RZ" values from the rotation ones. Save and close the file. (Told you to keep it open!) In my case: 9#: Now profit! congratulations, it should have a pretty nice effect once you play the map. Hope it helps. Greetz HyPeX
  15. Ok look, First: Why the element don't be showed in the player back when he hit the pickup? Second: This one you posted gives me ERROR in CMD :12: unexpected symbol near 'local' Thanks oops, i accidentaly placed local twice. function createBags ( thePlayer ) local x,y,z = getElementPosition( getLocalPlayer() ) local bag = createPickup ( x, y+10, z, 3, 1550 ) end addEventHandler ("onResourceStart", getRootElement(), createBags)
  16. .:HyPeX:.

    Shaders

    -- -- c_uv_scripted.lua -- local myShader local startTickCount addEventHandler( "onClientResourceStart", resourceRoot, function() -- Version check if getVersion ().sortable < "1.1.0" then outputChatBox( "Resource is not compatible with this client." ) return end -- Create shader myShader, tec = dxCreateShader ( "uv_scripted.fx" ) -- Create texture and add to shader local myTexture = dxCreateTexture ( "images/env3.bmp" ); dxSetShaderValue ( myShader, "CUSTOMTEX0", myTexture ); if not myShader then outputChatBox( "Could not create shader. Please use debugscript 3" ) else outputChatBox( "Using technique " .. tec ) -- Apply to world texture engineApplyShaderToWorldTexture ( myShader, "bobo_2" ) -- Create object with model 4729 (billboard) createObject ( 4729, 1843, -4385, 477, 0, 0, 22 ) -- Begin updates for UV animation startTickCount = getTickCount() addEventHandler( "onClientRender", root, updateUVs ) end end ) ------------------------------------------------------ -- Update ------------------------------------------------------ function updateUVs() -- Valide shader to save bazillions of warnings if not isElement( myShader ) then return end -- Calc how many seconds have passed since uv anim started local secondsElapsed = ( getTickCount() - startTickCount ) / 1000 -- Calc section (0-6) and time (0-1) within the section local timeLooped = ( secondsElapsed / 2 ) % 6 local section = math.floor ( timeLooped ) local time = timeLooped % 1 -- Figure out what uv anims to do local bScrollLeft = section == 0 or section == 3 or section == 4 or section == 6 local bWobbleRotate = section == 1 or section == 3 or section == 5 or section == 6 local bGoneAllZoomy = section == 2 or section == 4 or section == 5 or section == 6 local u,v = 0, 0 local angle = 0 local scale = 1 -- Do uv anims if bScrollLeft then u = time end if bWobbleRotate then angle = math.sin(time/2*6.28)/4 end if bGoneAllZoomy then scale = math.cos(time*6.28) * 0.5 + 0.5 end -- Apply uv anims dxSetShaderValue ( myShader, "gUVPosition", u,v ); dxSetShaderValue ( myShader, "gUVRotAngle", angle ); dxSetShaderValue ( myShader, "gUVScale", scale, scale ); end
  17. .:HyPeX:.

    Shaders

    Yes, but i'm not sure how to do it with the DxDraw the UV scripted shader has.
  18. .:HyPeX:.

    Shaders

    Hey guys I've done so far an implementantion of the UV_Scripted shader from the wiki on a map with an image, but, i want to know if it is possible to make it for ALL the objects under that category (billboard) to have that effect. Else i could just add various object under the line of creating... Eg: -- Create object with model 4729 (billboard) createObject ( 4729, 1850, -4370, 10, 0, 0, 22 ) createObject ( 4729, 1850, -4380, 10, 0, 0, 22 ) createObject ( 4729, 1850, -4390, 10, 0, 0, 22 )
  19. Then i'm not sure... but why you have a math.random with the pbag? Try creating a manual pickup and then going to it. Then try making it math, go by steps. Like: function createBags ( thePlayer ) local x, y, z = local x,y,z = getElementPosition( getLocalPlayer() ) local bag = createPickup ( x, y+10, z, 3, 1550 ) end addEventHandler ("onResourceStart", getRootElement(), createBags) Start it, and then go to look it right infront of you to see if it works. (and btw, the bag wich is local, how are you calling it in?)
  20. Read the last line of my post, try changing the returns with else they might be bugging as the second return could be trying to return to the first one. function onPickupHit ( thePlayer ) if ( source ~= bag ) then return end if ( isPedInVehicle ( thePlayer ) ) then return end
  21. And whats the marker creation then for? i probably misunderstood, if you want to get it on pickup hit.. function onPickupHit ( thePlayer ) if ( source ~= bag ) then return end if ( isPedInVehicle ( thePlayer ) ) then return end setElementData ( thePlayer, "bag", true ) setElementCollisionsEnabled ( bag, false ) attachElements ( bag, thePlayer, 0, -0.3, 0.3 ) end addEventHandler ("onPickupHit", getRootElement(), onPickupHit) i'm not sure, but try using elses instead of returns.
  22. You're not calling the marker, if you want to hit it. This is probably how you should try: if source == Marker[1] then Assuming you had this before as marker: Marker[1] = createMarker(x, y, z, "corona", 0, 0, 0, 0)
×
×
  • Create New...