
Hazard|
Members-
Posts
35 -
Joined
-
Last visited
Everything posted by Hazard|
-
Nope, I tested that, and it banned me if my nick was ONLY 'W'. heres my code btw. function banPlayer2 () for _, player in ipairs ( getElementsByType ( "player" ) ) do if getPlayerName ( player ):find ( "%W%il%d" ) then if ( player ) then banPlayer ( player, true ) end end end end addEventHandler ( "onPlayerChangeNick", getRootElement(), banPlayer2) addEventHandler ( "onPlayerJoin", root, banPlayer2)
-
Hello guys, I'm creating an autoban script for 2 clans, and I'm having some problem in finding ONLY the clantag. 1st clantag = Wild 2nd clantag = KekZ| if getPlayerName ( player ):find ( "Wild" ) then if getPlayerName ( player ):find ( "KekZ|" ) then Now this result above would ban everyone with a 'W' in their name, or 'K' or '|', doesn't matter really. Well I want it to ban the players with the complete tag, only. So I tried something like this: if getPlayerName ( player ):find ( "%[%Wild%]" ) then if getPlayerName ( player ):find ( "%K%ekZ%|" ) then But that didn't work properly either, can you help me with this? I want it to ban the players who wears the tag only, e.g: KekZ|Randomguy [Wild]Randomguy Thx
-
Hello guys, I was just wondering why the graphics are different? Obviously it's the font, but the 1st picture has so much better graphic than the 2nd, why? 1st. http://imgur.com/z6NcMwD,APcjtDk#1 2nd. http://i.imgur.com/z6NcMwD Thanks for replies, really appreciate it.
-
Hello guys, could any of you fix this? no errors, but clearly it's wrong The try is to mute the player, and unmute, with the same command = mmute thx function mutePlayerCommand (thePlayer, command, source) local mutedPlayer = getPlayerFromNamePart ( source ) local source = mutedPlayer local muteData = getElementData( source, "isPlayerMuted" ) if ( hasObjectPermissionTo ( thePlayer, "function.setPlayerMuted", true ) ) then if (mutedPlayer) then if (muteData == true) then if getElementType ( mutedPlayer ) == "player" then setElementData ( source, "isPlayerMuted", false ) outputChatBox ( getPlayerName( source ).." has been unmuted by "..getPlayerName( thePlayer ).." (mainchat only)", root, 33, 255, 95) elseif (muteData == false) then if getElementType ( mutedPlayer ) == "player" then setElementData ( source, "isPlayerMuted", true ) outputChatBox ( getPlayerName( source ).." has been muted by "..getPlayerName( thePlayer ).." (mainchat only)", root, 255, 0, 0) end end end end end end addCommandHandler("mmute", mutePlayerCommand)
-
it works, I just had to put local sw,sh = guigetscreensize () ++++ but it renders the sound too so it sounds so stupid Can you make the sound just replay n replay n replay? not render? thx
-
WARNING: c.lua:4: Bad argument @ 'addEventHandler' [Expected element at argument 2, got function I got this warning now, when I do 'scare playername'
-
Still same error http://imgur.com/ZLXcgT9
-
My meta "" author="" version="1" type="script" /> Is it wrong?
-
ERROR: Server triggered clientside event scareJumpThem, but event is not added clientside
-
Hello, I tried to make something like this before, and didn't reach the goal yet (easy script for you) The issue is that I don't really know how to make this happend only on (theplayer)'s screen. Like if the command to make the sound & picture go off on a players screen, was "scare", and I did /scare Haz then the player with the namepart "Haz" got "scared". The code below is what I have, the scareImage function should be handled by a command named "scare". Can you help? local sw,sh = guiGetScreenSize() function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil 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(name, 1, true) then return player end end end end function scareImage() local scareSound = playSound("scare.mp3") setSoundVolume(scareSound, 1) dxDrawImage(math.random(-5,0),math.random(-5,0),sw+5,sh+5,'scare.jpg',0,0,0,tocolor(255,255,255,math.random(200,240)),true) end --addCommandHandler("scare"?????????????????????????????????????????????????) thx
-
Hello, I'm wondering how to make this work exactly. The point is that when a player includes (S) in his nickname, then on the next round (race) his vehicle gets blown and will have to spectate. addEvent("onRaceStateChanging") addEventHandler("onRaceStateChanging", root, function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", "(S)"):lower() or nil local theVehicle = getPedOccupiedVehicle ( player ) if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", "(S)"):lower() if name_:find(name, 1, true) then for key, player in ipairs ( players ) do if ( theVehicle ) then blowVehicle(theVehicle,false) end end end end I just wrote much shit and I get errors in the debug, I copied the getPlayerFromPartialName from the wiki. Could you make it work like I want it to work? if so, thanks alot.
-
I'm working on a training script, and just got fixed some issues. Now I got new ones "-.- The problem is that when you do /ll with this code below, then it sets the alpha and the collide 1 sec AFTER you wrote /ll and it never goes back to normal alpha & collide. I want it to set the collide and alpha at the time you write /ll, then after 1 sec you wrote /ll then it sets the alpha back to normal and the collide normal. function TrainingLL() if not x then outputChatBox("(/LL) No locations saved.", source) else local car = getPedOccupiedVehicle(localPlayer) if not car then return end setElementPosition(car, x, y, z) setElementVelocity(car, vX, vY, vZ) setVehicleTurnVelocity(car,0,0,0) for index,vehicle in ipairs(getElementsByType("vehicle")) do setTimer(setElementCollidableWith, 1000, 1, vehicle, car, false) setTimer ( setElementAlpha, 1000, 1, car, 150, false) setElementHealth(car, health) setElementRotation(car, rx, ry, rz) setElementModel(car, model) outputChatBox("(/LL) Location loaded.", source) end end end addCommandHandler("LL", TrainingLL) addCommandHandler("ll", TrainingLL) could you please help? thx
-
There is no errors/warnings in the debug
-
Hello, can some of you fix the error I get of this sentence? very simple but I don't get the syntax obviously. SYNTAX: timer setTimer ( function theFunction, int timeInterval, int timesToExecute, [ var arguments... ] ) setTimer(setElementAlpha(car, 200, 1000,1)) thx.
-
Hello, I need some help with a respawn thingy, it doesn't work. Everytime a player dies, he should respawn in 2 seconds, but he doesn't. (why?) function respawnMode (player) if ( getElementData ( getRootElement ( ), "cwRespawn" ) ) and not RaceMode.isPlayerFinished(source) then Countdown.create(2, restorePlayer, 'You will respawn in:', 255, 255, 255, 0.25, 2.5, true, self.id, player):start(player) else TimerManager.createTimerFor("map",player):setTimer(clientCall, 2000, 1, player, 'Spectate.start', 'auto') end RaceMode.setPlayerIsFinished(player) showBlipsAttachedTo(player, false) end addEventHandler ( "onClientResourceStart", getResourceRootElement ( getThisResource ( ) ), function ( ) setElementData ( getRootElement ( ), "cwRespawn", true ) end) addEventHandler ( "onClientResourceStop", getResourceRootElement ( getThisResource ( ) ), function ( ) setElementData ( getRootElement ( ), "cwRespawn", nil ) end) a little bit of everything code. thx.
-
Thank you @Citizen, it works , makes sense too
-
Hello again, I'm using get/setElementVelocity now, @removed getElementSpeed. Still I have the same issue, it doesn't work. This is what I have for now. function TrainingSL() local car = getPedOccupiedVehicle(localPlayer) if not car then return end vX, vY, vZ = getElementVelocity(car) x, y, z = getElementPosition(car) rx, ry, rz = getElementRotation(car) tx, ty, tz = getVehicleTurnVelocity(car) nitro = getVehicleUpgradeOnSlot(car) model = getElementModel(car) health = getElementHealth(car) outputChatBox("(/SL) Location saved.", source) end addCommandHandler("SL", TrainingSL) addCommandHandler("sl", TrainingSL) function TrainingLL() if not x then outputChatBox("(/LL) No locations saved.", source) else local car = getPedOccupiedVehicle(localPlayer) if not car then return end setElementPosition(car, x, y, z) setElementVelocity(car, vX, vY, vZ) setVehicleTurnVelocity(car,0,0,0) setElementFrozen(car, true) setElementHealth(car, health) setElementRotation(car, rx, ry, rz) setElementModel(car, model) setTimer(setElementFrozen,50,1,car,false) outputChatBox("(/LL) Location loaded.", source) end end addCommandHandler("LL", TrainingLL) addCommandHandler("ll", TrainingLL) I hope you can help me, I want it to save the speed of the vehicle when you do /sl, THEN you will recieve the speed that's saved in /sl when you do /ll, so when you do ll you get the same speed you had when you did /sl. thx.
-
Hello, This is about a training script I need help with. The case is that when you do /sl then it saves the location for the vehicle, and when you do /ll then it loads the location of the sl. what I want to do is that when you do /sl then it saves the speed&location of the vehicle and when you do /ll then it loads the location and the speed of the vehicle. getElementSpeed setElementSpeed My code is below, the issue is that it doesn't save the speed when you do /sl, could you try to fix it? it's pretty easy, I can see that now, but I get errors function TrainingSL() local car = getPedOccupiedVehicle(localPlayer) if not car then return end x, y, z = getElementPosition(car) rx, ry, rz = getElementRotation(car) sx, sy, sz = getElementVelocity(car) tx, ty, tz = getVehicleTurnVelocity(car) nitro = getVehicleUpgradeOnSlot(car) model = getElementModel(car) health = getElementHealth(car) outputChatBox("(/SL) Location saved.", source) local speed = getElementSpeed(car) end addCommandHandler("SL", TrainingSL) addCommandHandler("sl", TrainingSL) function TrainingLL() if not x then outputChatBox("(/LL) No locations saved.", source) else local car = getPedOccupiedVehicle(localPlayer) if not car then return end setElementVelocity(car,0,0,0) setVehicleTurnVelocity(car,0,0,0) setElementFrozen(car, true) setElementHealth(car, health) setElementPosition(car, x, y, z) setElementRotation(car, rx, ry, rz) triggerServerEvent('syncModel', resourceRoot, car, model) setElementModel(car, model) fixVehicle(car) setTimer(setElementFrozen,50,1,car,false) triggerServerEvent('syncModel', resourceRoot, car, spm) outputChatBox("(/LL) Location loaded.", source) setElementSpeed(car, speed) end end addCommandHandler("LL", TrainingLL) addCommandHandler("ll", TrainingLL) ty
-
Hello! I'm here to share a comment with you guys, (my opinion about ACM 2.0). I bought the script, and right after that, LinKin helped me to set it up for my server, and then he taught me how to use the script. ACM 2.0 is the best script I've used till now, it does everything for you and I couldn't ask for more actually. I'm going to share a photo of me and LinKin on my server (this is after he helped me with the script). Enjoy!