-
Posts
467 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Gravestone
-
Which function is this event handling? addEventHandler( "givePlayerLicenseClient", getRootElement(), givePlayerLicense )
-
Try this local chatRadius = 50 addEventHandler("onPlayerChat", root, function chatbox(text, msgtype) local posX, posY, posZ = getElementPosition( source ) local chatSphere = createColSphere( posX, posY, posZ, chatRadius ) local account = getAccountName(getPlayerAccount(source)) local name = getPlayerName(source) local color = string.format("#%02X%02X%02X", getPlayerNametagColor(source)) local nearbyPlayers = getElementsWithinColShape( chatSphere, "player" ) destroyElement( chatSphere ) if (msgtype == 0) then cancelEvent() end for index, nearbyPlayer in ipairs( nearbyPlayers ) do if isObjectInACLGroup("user." .. account, aclGetGroup("Owner")) then outputChatBox("#000000✪#FF7500OWNER#000000✪ "..color.."" .. name .. ":#f7fc00 " .. text, nearbyPlayer, 255,255,255, true) outputServerLog("CHAT: #990000✪#000000OWNER#990000✪ " .. name .. ": " .. text) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Founder")) then outputChatBox("#990000✬#000000FOUNDER#990000♫ "..color.."" .. name ..":#f7fc00 " .. text, nearbyPlayer, 255,255,255, true) outputServerLog("CHAT: #00a2fc~founder~" .. name .. ": " .. text) elseif isObjectInACLGroup("user." .. account, aclGetGroup("CoOwner")) then outputChatBox("#ff0000✪#00ff70CO-OWNER#ff0000✪ "..color.."" .. name ..":#f7fc00 " .. text, nearbyPlayer, 255,255,255, true) outputServerLog("CHAT: #00a2fc~founder~" .. name .. ": " .. text) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Administrator")) then outputChatBox("#ff0000ADMINISTRATOR|"..color.."" .. name ..":#FFFFFF " .. text, nearbyPlayer, 255,255,255, true) outputServerLog("CHAT: #00a2fc~founder~" .. name .. ": " .. text) elseif isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then outputChatBox("#000000Trainee #00ff00Admin| "..color.."" .. name ..":#FFFFFF " .. text, nearbyPlayer, 255,255,255, true) outputServerLog("CHAT: #00a2fc~SuperModerator~" .. name .. ": " .. text) elseif isObjectInACLGroup("user." .. account, aclGetGroup("LeadMod")) then outputChatBox("#0000FFLead Mod| "..color.."" .. name .. ":#FFFFFF " .. text, nearbyPlayer, 255,255,255, true) outputServerLog("CHAT: #00ff00~LeadModerator~ " .. name .. ": " .. text) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then outputChatBox("#3366ffModerator| "..color.."" .. name .. ":#FFFFFF " .. text, nearbyPlayer, 255,255,255, true) outputServerLog("CHAT: #00ff00~Moderator~ " .. name .. ": " .. text) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Trainee")) then outputChatBox(" #FFFF00Trainee| "..color.."" .. name .. ":#FFFFFF " .. text, nearbyPlayer, 255,255,255, true) outputServerLog("CHAT: #FFFF00~Vip~" .. name .. ": " .. text) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Recruiter")) then outputChatBox(" #FF0000RECRUITER "..color.."" .. name .. ":#FFFFFF " .. text, nearbyPlayer, 255,255,255, true) outputServerLog("CHAT: #FFFF00~recruiter~" .. name .. ": " .. text) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Console")) then outputChatBox(" #00a2fc~|CREATOR|~ "..color.."" .. name .. ":#f7fc00 " .. text, nearbyPlayer, 255,255,255, true) outputServerLog("CHAT: #00a2fc~|OWNER|~" .. name .. ": " .. text) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Everyone")) then outputChatBox(""..color.."".. name .. ":#FFFFFF " .. text, nearbyPlayer, 255, 255, 255, true) outputServerLog("CHAT: " .. name .. ": " .. text) end end end )
-
May I know what "attempted to compare number with nil" means?
-
Then the player's account does not have "Jailtime" data set on.
-
Replace this if tonumber(jailtime)) > 0 then with this if tonumber(jailtime) >= 1 then
-
So you want to trigger the function from client to server and from server back to client, Lol. Remove the server side code and simply use this: fired = false function projectile_sound(veh) local x,y,z = getElementPosition (veh) local sound_shoot = playSound3D("files/fire"..math.random(1 ,3)..".wav", x, y, z, false) setSoundMaxDistance( sound_shoot, 400 ) setSoundVolume(sound_shoot, 1) attachElements ( sound_shoot, veh, 0,0,0 ) setTimer ( function() local sound_reload = playSound3D("files/reload.wav",x,y,z, false) setSoundMaxDistance( sound_reload, 100 ) setSoundVolume(sound_reload, 1) attachElements ( sound_reload, veh, 0,0,0 ) end, 1000, 1 ) end function fire() if fired == false then local vehicle = getPedOccupiedVehicle(localPlayer) if getElementModel(vehicle) == 457 then projectile_sound(vehicle) fired = true setTimer ( function() fired = false end, 5000, 1 ) end end end bindKey("mouse1", "down", fire)
-
Nvm, I found out what was wrong. Thanks for your help @Gr0x and @Walid.
-
That's the problem, it returns if it exists on the server.
-
Try using a timer instead. function disableControls(wndItems) for i,ctrlName in ipairs({ "Balas(Explosivas)" }) do guiSetEnabled(getControl(wndItems, ctrlName), false) end end setTimer(disableControls, 1000, 1)
-
getElementsWithinColShape
-
onClientResourceStart's first parameter is the resource that has been started.
-
Didn't see the download attribute thing. Anyways that's working now. Now I want to see if the client has downloaded the files. Used onClientDownloadComplete to replace models when he's in game. Now when the client re joins, the models do not replace. Tried fileExists but it checks if the file exists in the server. How do I fix this?
-
What's the error with this code? Post your serverside code which triggers this function.
-
There is no function in Freeroam to enable/disable controls by default. You can create your own. e.g function disableControls(wnd, ...) for i,ctrlName in ipairs({ ... }) do guiSetEnabled(getControl(wnd, ctrlName), false) end end function enableControls(wnd, ...) for i,ctrlName in ipairs({ ... }) do guiSetEnabled(getControl(wnd, ctrlName), true) end end
-
Make sure while triggering this event you defined the vehicle element.
-
'btn' element doesn't use 'x' attribute. Btw it's getControls, not getControl.
-
I want to create a GUI window displaying all weapon/vehicle mods. I want to know when the client click to download them, how can I download the file? downloadFile doesn't work until I add the mods to meta and if I do so, the mods download when the resource start. I hope you people get what I am trying to do.
-
Not working either. That doesn't make any difference since the variable stays global in both cases.
-
I'm using this code to create/remove water shader. The shader is created successfully but the problem is in removing it. The second function removes it. No errors in the debug.
-
I don't understand, do we need to define the localPlayer in setFPSLimit or what?
-
I'm adding a setting which allows you to customize your FPS limit. How can I make setFPSLimit work for the local player only?
-
@EstrategiaGTA, it works man. Thanks alot!
-
I made a guiwindow with a 'close' button on it. The button's parent is the window. A function is that onClienGUIClick with the button as the source, the window closes but there's a problem that even if the player doesn't click on the button and click anywhere on the window, it still closes. Any ideas how to fix it? BTNClose = guiCreateButton(234, 325, 95, 30, "Close", false, Window) addEventHandler("onClientGUIClick", BTNClose, closeMain) function closeMain() if (guiGetVisible(Window) == true ) then guiSetVisible(Window, false) showCursor(false) end end
-
Both the codes are not working good. I can't figure out what's wrong.