
BieHDC
Members-
Posts
296 -
Joined
-
Last visited
Everything posted by BieHDC
-
Now i get this error: ERROR: BieHDChexagontowers\hexatowers.lua:25: attempt to index global 'disallowed' (a nil value) Here is the disallowed vehicle list: disallowedVehicle = {[430] = true, [435] = true, [450] = true, [591] = true, [606] = true, [607] = true, [610] = true, [611] = true, [584] = true, [608] = true, [592] = true, [577] = true, [472] = true, [473] = true, [493] = true, [595] = true, [484] = true, [430] = true, [453] = true, [452] = true, [446] = true, [454] = true, [539] = true, [538] = true, [537] = true, [590] = true, [569] = true, [570] = true, [449] = true}
-
I already saw it but i dont kwon where and how to put in
-
Hello, i want to make a random car map with markers and i have dissallowed vehicles. Now when the vehicle isnt allowed i get a predefined vehicle (id=429), but i want that it will as often math.random, until a allowed vehicle is calculated. Please help me fix Here is code: function generateZufallCarID () vehicleID = math.random(399, 609) if disallowedVehicle[vehicleID] then return 429 else return vehicleID end end
-
not my i only wanna modify for my server
-
what command name?
-
local eof = nil function outputPanelLog(outputs,comment) local panellog = nil if fileOpen ( "panellog.txt" ) then panellog = fileOpen ( "panellog.txt" ) eof = fileGetSize ( panellog ) fileSetPos ( panellog, eof ) else panellog = fileCreate ( "panellog.txt" ) end local time = getRealTime() local curTime = "[".. time.year+1900 .."-".. time.month+1 .."-"..time.monthday.." "..time.hour..":"..time.minute.."]" local str = outputs -- if string.len( comment ) > 0 then -- str = str .. "\\ " .. comment -- end str = str .. "\r\n" eof = fileWrite ( panellog, curTime .. " * FTAPANEL: " .. outputs .. "." .. "\n" ) fileSetPos ( panellog, eof ) fileClose ( panellog ) outputDebugString ( "Log Written" ) for index, player in ipairs ( getElementsByType ( "player" ) ) do if isPlayerAdmin ( player ) then outputConsole ( " * FTAPANEL: " .. outputs .. ".", player ) end end end function getdxtxt ( motdt, _source) local logK = _source .. " set the dxMOTD to \"" .. motdt .. "\"" outputPanelLog(logK) for _, player in ipairs ( getElementsByType ( "player" ) ) do triggerClientEvent ( player, "rendertxt", player, motdt ) triggerClientEvent ( player, "setBox", player, motdt ) end motdhandle = fileCreate("motdk.txt") if motdhandle then fileWrite(motdhandle , motdt) fileFlush (motdhandle) fileClose(motdhandle) end end addEvent ( "getdx", true ) addEventHandler ( "getdx", root, getdxtxt ) function readfile() local openmotd = fileOpen("motdk.txt") local motdt = fileRead (openmotd, 100) triggerClientEvent ( source, "rendertxt", source, motdt ) triggerClientEvent ( source, "setBox", source, motdt ) fileClose(openmotd) end addEvent("joinmotd",true) addEventHandler("joinmotd", root, readfile) function isPlayerAdmins(source) if isPlayerAdmin (source) then triggerClientEvent("ClientGui",getRootElement(),source) end end function onLoad () for index, player in ipairs ( getElementsByType ( "player" ) ) do if isPlayerAdmin ( player ) then bindKey ( player, "F2", "down", isPlayerAdmins ) end end end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource() ), onLoad) function onJoin () if isPlayerAdmin (source) then bindKey ( source, "F2", "down", isPlayerAdmins ) end end addEventHandler ( "onPlayerLogin", getRootElement(), onJoin ) function onJoin () unbindKey ( source, "F2", "down", isPlayerAdmins ) end addEventHandler ( "onPlayerLogout", getRootElement(), onJoin ) function isPlayerAdmin(source) local accountname = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user." ..accountname, aclGetGroup("Admin")) then return true elseif isObjectInACLGroup("user." ..accountname, aclGetGroup("SuperModerator")) then return true end end function isPlayerInTeam( thePlayer, teamName ) local pTeam = getPlayerTeam( thePlayer ) local fTeam = getTeamName( teamName ) if ( pTeam ) and ( fTeam ) then if ( pTeam == fTeam ) then return true end end end function adminChat ( thePlayer, commandName, ... ) local text = table.concat ( { ... }, " " ) local playerName = getPlayerName ( thePlayer ) for _, player in ipairs ( getElementsByType ( "player" ) ) do if isPlayerAdmin ( player ) then outputChatBox ( "#FF0000[#CCCCCCAdmin#FF0000] #FF0000".. playerName .."#CCCCCC: #FF0000".. text, player, 255, 255, 255, true ) end end end addCommandHandler ( "ac", adminChat, true ) ----[Admin Display Server]---- function outputMessage(text) outputChatBox ("#FFD700Admin#FFFF00: "..text, getRootElement(), 255, 255, 255, true ) --output that text end addEvent("ServerOutput",true) addEventHandler("ServerOutput", root,outputMessage) ----[Hide Name Server]---- function hideNameTag ( source ) if isPlayerNametagShowing ( source ) == true then setPlayerNametagShowing ( source, false ) end end addEvent("hideName",true) addEventHandler("hideName", root,hideNameTag) function showNameTag ( source ) setPlayerNametagShowing ( source, true ) end addEvent("showName",true) addEventHandler("showName", root, showNameTag) ----[HideRadar Blip]---- function hideRadarBlip ( source ) for index, element in ipairs ( getAttachedElements ( source ) ) do if ( getElementType ( element ) == "blip" ) then destroyElement ( element ) end end end addEvent("hideBlip",true) addEventHandler("hideBlip", resourceRoot,hideRadarBlip) function createRadarBlip ( source ) r = math.random(1,255) g = math.random(1,255) b = math.random(1,255) pBlip = createBlipAttachedTo ( source, 0, 2, r, g, b ) end addEvent("createBlips",true) addEventHandler("createBlips", resourceRoot, createRadarBlip) function destroyBlipsAttachedTo() local attached = getAttachedElements ( source ) if ( attached ) then for k,element in ipairs(attached) do if isElement ( element ) then if getElementType ( element ) == "blip" then destroyElement ( element ) end end end end end addEventHandler ( "onPlayerQuit", getRootElement(), destroyBlipsAttachedTo ) ---- [invisibility - Player(ped)] ----- function invisible ( source ) if not ( getElementAlpha(source) == 0 ) then setElementAlpha ( source, 0 ) end end addEvent("noalpha",true) addEventHandler("noalpha", resourceRoot, invisible) function notinvisible ( source ) if ( getElementAlpha(source) == 0 ) then setElementAlpha ( source, 255 ) end end addEvent("noalpha1",true) addEventHandler("noalpha1", resourceRoot, notinvisible) ------------------ ---- Car Mods ---- ------------------ ---- [ God Mode ] ---- function nocardamage ( source ) if ( isPedInVehicle ( source ) ) then if ( isVehicleDamageProof ( getPedOccupiedVehicle ( source ) ) == false ) then setVehicleDamageProof ( getPedOccupiedVehicle ( source ), true ) end else outputChatBox ( "You must be inside a vehicle to set this.", source ) end end addEvent("cardamage", true ) addEventHandler("cardamage", resourceRoot, nocardamage ) function disabledamage ( source ) if ( isPedInVehicle ( source ) ) then setVehicleDamageProof ( getPedOccupiedVehicle ( source ), false ) end end addEvent("nodamage", true) addEventHandler("nodamage", resourceRoot, disabledamage ) ---- [Car Invisibility] ---- function carinvis(source) if not ( getElementAlpha ( getPedOccupiedVehicle ( source ) ) == 0 ) then setElementAlpha ( getPedOccupiedVehicle ( source ), 0 ) end end addEvent("nocaralpha",true) addEventHandler("nocaralpha", resourceRoot,carinvis) function tcarinvis(source) setElementAlpha ( getPedOccupiedVehicle ( source ), -1 ) end addEvent("nocaralpha1",true) addEventHandler("nocaralpha1", resourceRoot,tcarinvis) --- [Kill] --- function noElementHealth ( playerName, _source ) -- local comment = table.concat( arg, " " ) local logK = _source .. " killed " .. playerName outputPanelLog(logK) local _source = getPlayerFromName ( _source ) if isPlayerAdmin ( _source ) then local killed = setElementHealth ( getPlayerFromName ( playerName ), 0 ) end end addEvent("nohp", true) addEventHandler("nohp",resourceRoot, noElementHealth ) ---- [ Set Nametag Text ] ---- function setnametxt ( playerName, newNametagText ) setPlayerNametagText ( getPlayerFromName ( tostring(playerName) ), newNametagText ) end addEvent ("nametxt",true) addEventHandler("nametxt", resourceRoot, setnametxt ) ---- [ Lock / UnLock ] ---- function slock ( targetLock )
-
Hello, i have downloaded a script and want to costumize it for my server. It has a key bind but i want a command handler. The Client side is crypted, but maybe we dont need it. Here is the bind code: function onLoad () for index, player in ipairs ( getElementsByType ( "player" ) ) do if isPlayerAdmin ( player ) then bindKey ( player, "F2", "down", isPlayerAdmins ) end end end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource() ), onLoad) function onJoin () if isPlayerAdmin (source) then bindKey ( source, "F2", "down", isPlayerAdmins ) end end addEventHandler ( "onPlayerLogin", getRootElement(), onJoin ) function onJoin () unbindKey ( source, "F2", "down", isPlayerAdmins ) end addEventHandler ( "onPlayerLogout", getRootElement(), onJoin )
-
Thank you very much and if i use onGamemodeMapStart instead of onPlayerSpawn?
-
That sounds very complicated It not simple for to ask you, but can you please make me the script?
-
and maybe you can also help me there viewtopic.php?f=91&t=59991
-
that i was looking for thx only for beeing sure i have to click on execute server
-
With this recource i cant add recources into Admin group, only editing the rights
-
Hello, how the subject already tell, i want to play the music serverside. Why? I wanna make a Harlem Shake Map and the Music should be 100% sincron with the moving objects, which are also serverside. The sound should start whan map start, like moving objects. I already scriped something, but i want to now if it could work: -- define the onGamemodeMapStart handler function function onGamemodeMapStart() -- play sound callClientFunction(source, "sound = playSound", "harlem.mp3) end -- add the event handler addEventHandler("onGamemodeMapStart", root, onGamemodeMapStart)
-
In this yt video is the same problem i have
-
Yes it has "Admin"> "Moderator"> "SuperModerator"> "Admin"> "RPC"> "resource.admin"> "resource.webadmin"> "resource.login_panel"> "resource.race-winmoney"> "user.MyUser">
-
I and the Panel have full Admin rights "Admin"> .... "resource.admin"> "function.aclReload" access="true"> "function.aclSave" access="true"> "function.aclCreate" access="true"> "function.aclDestroy" access="true"> "function.aclSetRight" access="true"> "function.aclRemoveRight" access="true"> "function.aclCreateGroup" access="true"> "function.aclDestroyGroup" access="true"> "function.aclGroupAddACL" access="true"> "function.aclGroupRemoveACL" access="true"> "function.aclGroupAddObject" access="true"> "function.aclGroupRemoveObject" access="true"> "function.refreshResources" access="true"> "function.setServerConfigSetting" access="true"> "function.updateResourceACLRequest" access="true"> "command.aclrequest" access="true">
-
Hello, i was already looking in Google for Managing ACL through the Admin Panel, but i havent found anything. The Problem is, if i want to add a recource to group Admin, i get error that it isnt working. Debugscript 3 doesnt show anything. So can somebody please tell me how to manage ACL through Admin Panel? Thanks
-
Works perfect thank you very much
-
Now i get this: WARNING: [gamem.....\offedit.lua:185: Bad argument @ ´executeCom..ler´[Expected element at argument 2, got number ´1655´] some for line 186 with -130 So the numbers are not translated sucsessfully?
-
ok i will give the script admin rights
-
ok clear^^ i will try i get acsess deneded but i am admin on my server. Has the script to run as admin?
-
i dont know what that means i should be only like executeing in F8 or / command in chat
-
Would it look like this? function makejump(plr) executeCommandHandler("mdestroy", plr) executeCommandHandler("mcreate 1655", plr) executeCommandHandler("rz -130", plr) end addCommandHandler("mjump", makejump)
-
Would that look like: function makejump (player) addCommandHandler("cmd", mdestroy) addCommandHandler("cmd", mcreate 1655) addCommandHandler("cmd", rz -130) end addCommandHandler( "mjump", makejump ) Does it execute command "mdestroy" and then "mcreate 1655 ..... It schould execute the commands like i type in in F8 Command Panel
-
No i only wanna execute the 3 commands not more. I will post the full script Everything works exept last funktion local playerobj = {} local marker = {} objectid = {} maxobjects = 500 function playerLeave () setElementData ( source, "tempbuilder", false ) setElementData ( source, "permbuilder", false ) end function playerJoin () setElementData ( source, "tempbuilder", false ) setElementData ( source, "permbuilder", false ) local pname = getClientName(source) if (pname == "example") or (pname == "example2") then setElementData ( source, "permbuilder", true ) end end function thisResourceStart () local players = getElementsByType ( "player" ) for k,v in ipairs(players) do setElementData ( v, "tempbuilder", false ) setElementData ( v, "permbuilder", false ) local pname = getClientName(v) if (pname == "example") or (pname == "example2") then setElementData ( v, "permbuilder", true ) end end end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), thisResourceStart ) addEventHandler ( "onPlayerJoin", getRootElement(), playerJoin ) addEventHandler ( "onPlayerQuit", getRootElement(), playerLeave ) function createCurrentObject (player,cmd,objid) if ( hasObjectPermissionTo ( player, "function.unbanSerial", true)) or (getElementData ( player, "permbuilder" ) == true) or (getElementData ( player, "tempbuilder" ) == true) then if playerobj[player] then outputChatBox ( "You are already editing an object. Please save or delete to make another.", player ) else local x, y, z = getElementPosition(player) destroyMObj (player) playerobj[player] = createObject(tonumber(objid), x + 5, y + 5, z - 1) if marker[player] then destroyElement(marker[player]) end if playerobj[player] then marker[player] = createMarker ( x, y, z, "arrow", 5, 255, 255, 0, 255) attachElementToElement ( marker[player], playerobj[player], 0, 0, 10) else outputChatBox ( "" ..objid.. " does not appear to be a valid model ID.", player ) end end else outputChatBox ( "You do not have permission to build.", player ) end end addCommandHandler( "mcreate", createCurrentObject ) function moveObjZ (player,cmd,newz) if ( hasObjectPermissionTo ( player, "function.unbanSerial", true)) or (getElementData ( player, "permbuilder" ) == true) or (getElementData ( player, "tempbuilder" ) == true) then if playerobj[player] then local x, y, z = getElementPosition(playerobj[player]) moveObject ( playerobj[player], 200, x, y, z + tonumber(newz) ) end else outputChatBox ( "You do not have permission to build.", player ) end end addCommandHandler( "oz", moveObjZ ) function moveObjX (player,cmd,newx) if ( hasObjectPermissionTo ( player, "function.unbanSerial", true)) or (getElementData ( player, "permbuilder" ) == true) or (getElementData ( player, "tempbuilder" ) == true) then if playerobj[player] then local x, y, z = getElementPosition(playerobj[player]) moveObject ( playerobj[player], 200, x + tonumber(newx), y, z ) end else outputChatBox ( "You do not have permission to build.", player ) end end addCommandHandler( "ox", moveObjX ) function moveObjY (player,cmd,newy) if ( hasObjectPermissionTo ( player, "function.unbanSerial", true)) or (getElementData ( player, "permbuilder" ) == true) or (getElementData ( player, "tempbuilder" ) == true) then if playerobj[player] then local x, y, z = getElementPosition(playerobj[player]) moveObject ( playerobj[player], 200, x, y + tonumber(newy), z ) end else outputChatBox ( "You do not have permission to build.", player ) end end addCommandHandler( "oy", moveObjY ) function moveRotZ (player,cmd,newrz) if ( hasObjectPermissionTo ( player, "function.unbanSerial", true)) or (getElementData ( player, "permbuilder" ) == true) or (getElementData ( player, "tempbuilder" ) == true) then if playerobj[player] then local x, y, z = getElementPosition(playerobj[player]) moveObject ( playerobj[player], 200, x, y, z, 0, 0, tonumber(newrz) ) end else outputChatBox ( "You do not have permission to build.", player ) end end addCommandHandler( "rz", moveRotZ ) function moveRotX (player,cmd,newrx) if ( hasObjectPermissionTo ( player, "function.unbanSerial", true)) or (getElementData ( player, "permbuilder" ) == true) or (getElementData ( player, "tempbuilder" ) == true) then if playerobj[player] then local x, y, z = getElementPosition(playerobj[player]) moveObject ( playerobj[player], 200, x, y, z, tonumber(newrx), 0, 0 ) end else outputChatBox ( "You do not have permission to build.", player ) end end addCommandHandler( "rx", moveRotX ) function moveRotY (player,cmd,newry) if ( hasObjectPermissionTo ( player, "function.unbanSerial", true)) or (getElementData ( player, "permbuilder" ) == true) or (getElementData ( player, "tempbuilder" ) == true) then if playerobj[player] then local x, y, z = getElementPosition(playerobj[player]) moveObject ( playerobj[player], 200, x, y, z, 0, tonumber(newry), 0 ) end else outputChatBox ( "You do not have permission to build.", player ) end end addCommandHandler( "ry", moveRotY ) function destroyMObj (player,cmd) if ( hasObjectPermissionTo ( player, "function.unbanSerial", true)) or (getElementData ( player, "permbuilder" ) == true) or (getElementData ( player, "tempbuilder" ) == true) then if playerobj[player] then for i=0,maxobjects do if objectid[i] == playerobj[player] then local numstr = tostring(i) outputChatBox ( "Object ID deleted: " ..numstr.. "", player ) local succeed = destroyElement(playerobj[player]) if marker[player] then destroyElement(marker[player]) end objectid[i] = nil playerobj[player] = nil break end end end if marker[player] then destroyElement(marker[player]) end if playerobj[player] then destroyElement(playerobj[player]) end playerobj[player] = nil else outputChatBox ( "You do not have permission to build.", player ) end end addCommandHandler( "mdestroy", destroyMObj ) function clearObjects (player) if ( hasObjectPermissionTo ( player, "function.unbanSerial", true)) or (getElementData ( player, "permbuilder" ) == true) then for i=0,maxobjects do if objectid[i] then destroyElement(objectid[i]) end end objectid = nil objectid = {} local players = getElementsByType ( "player" ) for k,v in ipairs(players) do if marker[v] then destroyElement(marker[v]) end if playerobj[v] then destroyElement(playerobj[v]) end playerobj[v] = nil end if marker[player] then destroyElement(marker[player]) end if playerobj[player] then destroyElement(playerobj[player]) end playerobj[player] = nil outputChatBox ( "Map cleared.", player ) else outputChatBox ( "You do not have permission to build.", player ) end end addCommandHandler( "mclear", clearObjects ) function makejump (player) do mdestroy do mcreate 1655 do rz -130 end addCommandHandler( "mjump", makejump )