-
Posts
1,255 -
Joined
-
Last visited
Everything posted by .:HyPeX:.
-
Should this work, if i got table like this? teams = {teamACL = {'name' = "", tag = ""}, teamACL2 = -- etc, } for v, i in ipairs(teams) do if string.find(newnick, v.tag) then if isObjectInACLGroup("user." ..(getAccountName(getPlayerAccount(player)), aclGetGroup(v)) then local team = getTeamFromName(v.name) if team then setPlayerTeam(player, team) else outputChatBox("Team wasnt found!", getRootElement()) end else kickPlayer(player, "You must be in the ACL group and logged in!") outputChatBox("Player ".. getPlayerNametagText(player).."#ffffff was kicked for trying to fake team "..v.name, getRootElement()) end end Also, could i make a account saving with json like this? local JsonCreate = toJSON(teams) setAccountData(account, "teams", JsonCreate) Thanks in advance, HyPeX.
-
You can't create a new weapon, it has to be a model and/or texture replace. Dont mentioning the fact that weapons are like "hard-coded" into gta, and cant be totally replaced, the aiming and stuff will be the same, like dont expect replacing a rocket laucher and making it a sub machine gun.
-
You could delete them one by one.. wich is not that good, but this deletes it. /deletetime [toptime pos]
-
Hello? any help anyone?, it cant find somehow the target..
-
no create marker is down in the base not in the interior? hmm i dont know the problem in it ;S A marker deploys "onClientMarkerHit" at that marker at that place, it wont do anything to the location ur going IF you are, to come back you should create a marker at the destination (not exactly same at it will create a loop) but close to go back.
-
Bump, i just gave off the reasons, im quite amazed why it just says target cant be found.. function addMutedPlayer(thePlayer, cmd, Target, time) if hasObjectPermissionTo(thePlayer, "command.mute") then for i,v in ipairs(getElementsByType("player")) do local playername0 = string.gsub(getPlayerName(v), "#%x%x%x%x%x%x", "") local playername1 = string.lower(playername0) if string.match(playername1, Target) then local serialA = getPlayerName(thePlayer) local serialB = getPlayerSerial(v) MutedPlayers[serialB] = serialA if time then MutedTime = time * 1000 MutedPlayer[thePlayer] = setTimer(function() MutedPlayers[SerialB] = nil end, MutedTime, 1) outputChatBox("#00aaff[AntiSpam]: Player ".. getPlayerName(v) .."#00aaff was muted by ".. getPlayerName(thePlayer), getRootElement(), 255,255,255,true) outputChatBox("#00aaff[AntiSpam]: Mute Time: #00aaff ".. string.format ( '%02d:%02d', math.floor(MutedTime/60/1000), math.fmod(math.floor(MutedTime/1000),60)), getRootElement(), 255,255,255,true) else outputChatBox("#00aaff[AntiSpam]: Player ".. getPlayerName(v) .."#00aaff was muted by ".. getPlayerName(thePlayer), getRootElement(), 255,255,255,true) end else outputChatBox("#00aaff[AntiSpam]: Player Could not be found!", thePlayer, 255,255,255,true) end break end else return outputChatBox("#00aaff[AntiSpam]: You cant use this!", thePlayer, 255,255,255,true) end end addCommandHandler("mp", addMutedPlayer, false,false) function DelMutedPlayer(thePlayer, cmd, Target) if hasObjectPermissionTo(thePlayer, "command.unmute") then for i,v in ipairs(getElementsByType("player")) do local playername0 = string.gsub(getPlayerName(v), "#%x%x%x%x%x%x", "") local playername1 = string.lower(playername0) if string.match(playername1, Target) then local serialB = getPlayerSerial(v) if isTimer(antiSpamMuted[thePlayer]) then antiSpamMuted[source] = nil end MutedPlayers[serialB] = nil MutedPlayer[thePlayer] = nil outputChatBox("#00aaff[AntiSpam]: Player ".. getPlayerName(v) .."#00aaff was unmuted by ".. getPlayerName(thePlayer), getRootElement(), 255,255,255,true) else outputChatBox("#00aaff[AntiSpam]: Cant find player!", thePlayer, 255,255,255,true) end break end else return outputChatBox("#00aaff[AntiSpam]: You cant use this!", thePlayer, 255,255,255,true) end end addCommandHandler("ump", DelMutedPlayer, false,false)
-
or just .. local image = .. gui image creation .. local timer = setTimer(function() guiSetVisible(image, false) -- False to hide, true to show end, 20000, 1) Note: i belive you need to define this type of timers to work. (with function)
-
Thanks it is working really well, but im struck with a point, i cant make the difference when there is no reason and there is no time, so its not saying reason when time is nill... just says muted. function addMutedPlayer(thePlayer, cmd, Target, time, reason) if hasObjectPermissionTo(thePlayer, "command.mute") then for i,v in ipairs(getElementsByType("player")) do local playername0 = string.gsub(getPlayerName(v), "#%x%x%x%x%x%x", "") local playername1 = string.lower(playername0) if string.match(playername1, Target) then local serialA = getPlayerName(thePlayer) local serialB = getPlayerSerial(v) MutedPlayers[serialB] = serialA if time then MutedTime = time * 1000 MutedPlayer[thePlayer] = setTimer(function() MutedPlayers[SerialB] = nil end, MutedTime, 1) if reason then outputChatBox("#00aaff[AntiSpam]: Player ".. getPlayerName(v) .."#00aaff was muted by ".. getPlayerName(thePlayer), getRootElement(), 255,255,255,true) outputChatBox("#00aaff[AntiSpam]: Mute Time: #00aaff ".. string.format ( '%02d:%02d', math.floor(MutedTime/60/1000), math.fmod(math.floor(MutedTime/1000),60)) .. " , reason: ".. reason, getRootElement(), 255,255,255,true) else outputChatBox("#00aaff[AntiSpam]: Player ".. getPlayerName(v) .."#00aaff was muted by ".. getPlayerName(thePlayer), getRootElement(), 255,255,255,true) outputChatBox("#00aaff[AntiSpam]: Mute Time: #00aaff ".. string.format ( '%02d:%02d', math.floor(MutedTime/60/1000), math.fmod(math.floor(MutedTime/1000),60)) .. " , reason: - ", getRootElement(), 255,255,255,true) end else if time == nil and reason then outputChatBox("#00aaff[AntiSpam]: Player ".. getPlayerName(v) .."#00aaff was muted by ".. getPlayerName(thePlayer).." | reason: ".. reason, getRootElement(), 255,255,255,true) else outputChatBox("#00aaff[AntiSpam]: Player ".. getPlayerName(v) .."#00aaff was muted by ".. getPlayerName(thePlayer), getRootElement(), 255,255,255,true) end end break end end else return outputChatBox("#00aaff[AntiSpam]: You cant use this!", thePlayer, 255,255,255,true) end end addCommandHandler("mp", addMutedPlayer, false,false) EDIT: Im also struck at the point where i want to make a gui to manage muted players and players itself.. i can do the players part, but i kinda need some help on the muted players part.. so as to get muted time, reason, whos muted, serial, etc.
-
I found a problem on the almost finished script.. Error on line 38: table index is nill ----Anti-Spam-Script-by-HyPeX-- ----Locals---- local resRoot = getResourceRootElement(getThisResource()) ------------------------------- ----Messages of Startup---- outputChatBox ("#00aaff[AntiSpam]: Script v1.2 by HyPeX Started.",root, 255, 255, 255, true) outputChatBox ("#00aaff[AntiSpam]: Aviable commands: sleft",root , 255, 255, 255, true) ------------------------------- ----Functions--- function credits() outputChatBox ( "Anti-Spam Script By HyPeX Loaded", source, 55, 125, 255 ) end addEventHandler("onPlayerJoin", root, credits) MutedPlayers = {} MutedPlayer = {} antiSpam = {} antiSpamFlood = {} antiSpamCheck = {} antiSpamMuted = {} function addMutedPlayer(thePlayer, cmd, Target, time) for i,v in ipairs(getElementsByType("player")) do local playername0 = string.gsub(getPlayerName(v), "#%x%x%x%x%x%x", "") local playername1 = string.lower(playername0) if string.match(playername1, Target) then local serialA = getPlayerNameClean(thePlayer) local serialB = getPlayerSerial(v) MutedPlayers[serialB] = serialA if time then MutedTime = time * 1000 MutedPlayer[source] = setTimer(function() MutedPlayers[SerialB] = nil end, MutedTime, 1) outputChatBox("#00aaff[AntiSpam]: Player ".. getPlayerNameClean(v) .."#00aaff was muted by ".. getPlayerNameClean(thePlayer), getRootElement(), 255,255,255,true) outputChatBox("#00aaff[AntiSpam]: Mute Time: #00aaff for ".. time .. " seconds!", getRootElement(), 255,255,255,true) else outputChatBox("#00aaff[AntiSpam]: Player ".. getPlayerName(v) .."#00aaff was muted by ".. getPlayerName(thePlayer), getRootElement(), 255,255,255,true) end break end end end addCommandHandler("mp", addMutedPlayer, false,false) function DelMutedPlayer(thePlayer, cmd, Target) for i,v in ipairs(getElementsByType("player")) do local playername0 = string.gsub(getPlayerName(v), "#%x%x%x%x%x%x", "") local playername1 = string.lower(playername0) if string.match(playername1, Target) then local serialB = getPlayerSerial(v) MutedPlayers[serialB] = nil outputChatBox("#00aaff[AntiSpam]: Player ".. getPlayerName(v) .."#00aaff was unmuted by ".. getPlayerName(thePlayer), getRootElement(), 255,255,255,true) break end end end addCommandHandler("ump", DelMutedPlayer, false,false)
-
I just like placing apart the unmute timer from the mute itself, this way an unmute would work (supposing target is in server)? function addMutedPlayer(thePlayer, cmd, Target, time) for i,v in ipairs(getElementsByType("player")) do local playername0 = string.gsub(getPlayerName(v), "#%x%x%x%x%x%x", "") local playername1 = string.lower(playername0) if string.match(playername1, Target) then local serialA = getPlayerSerial(thePlayer) local serialB = getPlayerSerial(v) MutedPlayers[serialB] = serialA if time then MutedTime = time * 1000 muted = setTimer(function() MutedPlayers[SerialB] = nil end, MutedTime, 1) break end end end end addCommandHandler("mp", addMutedPlayer, false,false) function DelMutedPlayer(thePlayer, cmd, Target) for i,v in ipairs(getElementsByType("player")) do local playername0 = string.gsub(getPlayerName(v), "#%x%x%x%x%x%x", "") local playername1 = string.lower(playername0) if string.match(playername1, Target) then local serialB = getPlayerSerial(v) MutedPlayers[serialB] = nil break end end end addCommandHandler("ump", DelMutedPlayer, false,false)
-
Just continuing, faced another problem, removing the value after a predefined time, but i get errors. function addMutedPlayer(thePlayer, cmd, Target, time) for i,v in ipairs(getElementsByType("player")) do local playername0 = string.gsub(getPlayerName(v), "#%x%x%x%x%x%x", "") local playername1 = string.lower(playername0) if string.match(playername1, Target) then local serialA = getPlayerSerial(thePlayer) local serialB = getPlayerSerial(v) MutedPlayers[serialB] = serialA MutedTime = time * 1000 muted = setTimer(function(), MutedPlayers[SerialB] = nil end, MutedTime, 1) end end end addCommandHandler("mp", addMutedPlayer, false,false) Line 11: unexpected symbol near ',' line 12: '' expected near 'end' line 13: '' expected near 'end' line 14: '' expected near 'end'
-
Thanks for the help, i'll soon see if it works and it goes on
-
Thanks didnt thought of that, will it also directly add it? or i need to insert it first? @Castillo its just how i like it, and well, never knew that existed!
-
oh god.. to ask the "CREATOR" of the original script if he allows you to modify his work!
-
Hi guys, should this work? im not sure if it will recognize the definition of serialB when setting up a value in the table.. MutedPlayers = {} function addMutedPlayer(thePlayer, cmd, Target) for i,v in ipairs(getElementsByType("player")) do local playername0 = string.gsub(getPlayerName(v), "#%x%x%x%x%x%x", "") local playername1 = string.gsub(playername0, "[A]", "a") local playername2 = string.gsub(playername1, "[b]", "b") local playername3 = string.gsub(playername2, "[C]", "c") local playername4 = string.gsub(playername3, "[D]", "d") local playername5 = string.gsub(playername4, "[E]", "e") local playername6 = string.gsub(playername5, "[F]", "f") local playername7 = string.gsub(playername6, "[G]", "g") local playername8 = string.gsub(playername7, "[H]", "h") local playername9 = string.gsub(playername8, "[i]", "i") local playername10 = string.gsub(playername9, "[J]", "j") local playername11 = string.gsub(playername10, "[K]", "k") local playername12 = string.gsub(playername11, "[L]", "l") local playername13 = string.gsub(playername12, "[M]", "m") local playername14 = string.gsub(playername13, "[Ñ]", "n") local playername15 = string.gsub(playername14, "[N]", "ñ") local playername16 = string.gsub(playername15, "[O]", "o") local playername17 = string.gsub(playername16, "[P]", "p") local playername18 = string.gsub(playername17, "[Q]", "q") local playername19 = string.gsub(playername18, "[R]", "r") local playername20 = string.gsub(playername19, "[s]", "s") local playername21 = string.gsub(playername20, "[T]", "t") local playername22 = string.gsub(playername21, "[u]", "u") local playername23 = string.gsub(playername22, "[V]", "v") local playername24 = string.gsub(playername23, "[W]", "w") local playername25 = string.gsub(playername24, "[X]", "x") local playername26 = string.gsub(playername25, "[Y]", "y") local playername27 = string.gsub(playername26, "[Z]", "z") if string.match(playername27, Target) then local serialA = getPlayerSerial(thePlayer) local serialB = getPlayerSerial(v) table.insert(MutedPlayers, serialB) MutedPlayers.serialB = serialA end end end
-
That you should ask the owner of the script first.
-
What ur doind is simpy really hard, and in some vehicles you cant, just on the whones where you can see it. Making it move.. im not sure if it is working alone already, but you cant move it.
-
You just copied over the script from another resource, before trying to edit it, learn some scripting.. And by the way, you have the script's owner's approval to use it?
-
https://wiki.multitheftauto.com/wiki/Vehicle Search related function, at bottom of page, you might find what you want..
-
Remember to mention that only works on client side
-
How would you define extreme lags? is it a FPS issue, or the server lags? And by the way, my timer is just to replace his timer, you should have the full function.
-
Hmm no error ;S i made a Map in this Resource folder and puted in this map with the script in. OH OH OH! now i know the problem! last time i had a META also! so this is the LUA right? Dude do you know scripting at all? you need to place a code into the meta and load it, just start reading imo.. https://wiki.multitheftauto.com/wiki/Sc ... troduction
-
Not really, it should be like this: CrappyTimer = setTimer(function() addEventHandler("onClientRender", getRootElement(), renderDisplay) CrappyTimer = nil end, 50000, 1)
-
I think i got it, he isnt triggering the event onZombieSpawn on the zombie, he is just triggering (i think becouse we dont have the full script, and source should work)
-
Can you post a pick of the problem so we can understand the real problem??
