lucascba Posted July 4, 2014 Posted July 4, 2014 Hello community, I would like to know how to use the script and tried to notifications for exports ['notifications']: showBox ("info", "test") and does not work, how do I run? this is the resource: https://community.multitheftauto.com/index.php?p= ... ls&id=5812 PD:sorry for my bad English
_DrXenon Posted July 4, 2014 Posted July 4, 2014 Well, Try : I didn't try it, as i didn't download it... But you may try this: exports.notifications:showBox("info","text") for first message type... exports.notifications:showBox("error","text") for second message type... exports.notifications:showBox("warning","text") for third message type... ●●● Rage Gaming Society Coming Soon ●●●
lucascba Posted July 4, 2014 Author Posted July 4, 2014 does not work, look here let the entire script of how I'm doing: addEventHandler ("onResourceStart",getResourceRootElement(getThisResource()), function() local allGreenzones = getElementsByType ("radararea") for i,v in ipairs (allGreenzones) do local r,g,b,a = getRadarAreaColor (v) if (r == 0) and (g == 255) and (b == 0) and (a == 127) then local x,y = getElementPosition (v) local sx,sy = getRadarAreaSize (v) local col = createColCuboid (x,y, -50, sx,sy, 7500) setElementID (col, "greenzoneColshape") end end end) addEventHandler ("onColShapeHit", getRootElement(), function(hitElement, matchingDimension) if (isElement(hitElement)) and (getElementType (hitElement) == "player") and (getElementID (source) == "greenzoneColshape") then exports.notifications:showBox("info","ZonaProtegida") toggleControl (hitElement, "fire", false) toggleControl (hitElement, "next_weapon", true) toggleControl (hitElement, "previous_weapon", true) toggleControl (hitElement, "aim_weapon", false) toggleControl (hitElement, "vehicle_fire", false) showPlayerHudComponent (hitElement, "ammo", false) showPlayerHudComponent (hitElement, "weapon", false) triggerClientEvent (hitElement, "enableGodMode", hitElement) outputDebugString (getPlayerName(hitElement) .. " has entered the greenzone") end end) addEventHandler ("onColShapeLeave", getRootElement(), function(leaveElement, matchingDimension) if (getElementType (leaveElement) == "player") and (getElementID (source) == "greenzoneColshape") then outputChatBox ("Usted salio de la zona Protegida", leaveElement, 255, 0, 0, false) toggleControl (leaveElement, "fire", true) toggleControl (leaveElement, "next_weapon", true) toggleControl (leaveElement, "previous_weapon", true) toggleControl (leaveElement, "aim_weapon", true) toggleControl (leaveElement, "vehicle_fire", true) showPlayerHudComponent (leaveElement, "ammo", true) showPlayerHudComponent (leaveElement, "weapon", true) triggerClientEvent (leaveElement, "disableGodMode", leaveElement) outputDebugString (getPlayerName(leaveElement) .. " has left the greenzone") end end)
Moderators IIYAMA Posted July 4, 2014 Moderators Posted July 4, 2014 This is serverside, not clientside. So: exports.notifications:showBox(hitElement,"info","ZonaProtegida") As you can see in the script:(serverside) function showBox(player, value, str) if isElement(player) then triggerClientEvent(player, "CreateBox", getRootElement(), value, str) end end Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
lucascba Posted July 4, 2014 Author Posted July 4, 2014 worked for me thanks, but as I do to put it in another resource, for example a Job?
_DrXenon Posted July 4, 2014 Posted July 4, 2014 Use the functions i mentioned in client file And the functions iiyama mentioned in serverside files ●●● Rage Gaming Society Coming Soon ●●●
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now