-
Posts
843 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Bilal135
-
Works perfect but if I already have a weapon, then it should also get removed. How can I do that? I tried setPedWeaponSlot(source, 0) but it didn't work so....
-
That is a complete resource. If you have noticed, that is a "Skin Shop". So what's the matter?
-
@Walid, LOL, you still don't understand me? Well I simply wanted to prevent players from getting weapons if they have getElementData(source, "invincible", true). So, I just found this in freeroam/fr_server.lua.. function giveMeWeapon(weapon, amount) if weapon > 50 then return end if table.find(getOption('weapons.disallowed'), weapon) then errMsg((getWeaponNameFromID(weapon) or tostring(weapon)) .. 's are not allowed', source) else giveWeapon(source, weapon, amount, true) end end I edited, and made it like this.. function giveMeWeapon(weapon, amount) if getElementData(source, "invincible", true) then toggleControl (source, "fire", false) toggleControl (source, "next_weapon", false) toggleControl (source, "previous_weapon", false) toggleControl (source, "aim_weapon", false) toggleControl (source, "vehicle_fire", false) end if getElementData(source, "invincible", false) then toggleControl (source, "fire", true) toggleControl (source, "next_weapon", true) toggleControl (source, "previous_weapon", true) toggleControl (source, "aim_weapon", true) toggleControl (source, "vehicle_fire", true) end if weapon and weapon > 50 then return end if table.find(getOption('weapons.disallowed'), weapon) then errMsg((getWeaponNameFromID(weapon) or tostring(weapon)) .. 's are not allowed', source) else giveWeapon(source, weapon, amount, true) end end It won't work.
-
The script I made was "No Deathmatch Mode", which gives godmode power to those who tick the checkbox. So I want, for example, if they have enabled "No Deathmatch Mode", and if they try to /wp or something to get weapons, it would give them an error that "Getting weapon in no dm mode isn't allowed".
-
One more problem, how I do I prevent players from getting weapons if they have checked "GUIEditor.checkbox[1]"?
-
Thanks Walid, works.
-
CLIENT: GUIEditor = { checkbox = {}, staticimage = {}, label = {}, button = {}, window = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(542, 254, 348, 92, "No Deathmatch Mode", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.label[1] = guiCreateLabel(10, 25, 283, 15, "You can enable or disable 'No Deathmatch' mode.", false, GUIEditor.window[1]) GUIEditor.staticimage[1] = guiCreateStaticImage(10, 50, 34, 26, "icon.png", false, GUIEditor.window[1]) GUIEditor.checkbox[1] = guiCreateCheckBox(49, 52, 234, 24, "Enable / Disable No Deathmatch Mode", false, false, GUIEditor.window[1]) guiSetFont(GUIEditor.checkbox[1], "default-bold-small") GUIEditor.button[1] = guiCreateButton(303, 52, 31, 25, "X", false, GUIEditor.window[1]) guiSetVisible(GUIEditor.window[1], false) end ) addCommandHandler("nodm", function() guiSetVisible(GUIEditor.window[1], true) showCursor(true) end ) function onGuiClick() if (source == GUIEditor.button[1]) then guiSetVisible(GUIEditor.window[1], false) showCursor(false) end end addEventHandler("onClientGUIClick", root, onGuiClick) function checkBox() if ( getElementType(source) == "gui-checkbox" ) then if ( guiCheckBoxGetSelected(GUIEditor.checkbox[1])) then setElementData(localPlayer, "invincible", true) else setElementData(localPlayer, "invincible", false) end end end addEventHandler("onClientGUIClick", root, checkBox, false) addEventHandler ( "onClientPlayerDamage",localPlayer, function () if getElementData(source,"invincible") then cancelEvent() end end)
-
Doesn't work at all.
-
Well, I did something like this. Doesn't work. function checkBox() if ( getElementType(localPlayer) == "GUIEditor.checkbox[1]" ) then if (guiCheckBoxGetSelected(localPlayer)) then setElementData(localPlayer, "invincible", true) else setElementData(localPlayer, "invincible", false) end end end addEventHandler ( "onClientPlayerDamage",localPlayer, function () if getElementData(localPlayer,"invincible") then cancelEvent() end end) No errors in debug.
-
CLIENT: function checkBox() if (guiCheckBoxGetSelected(GUIEditor.checkbox[1])) then setElementData(localPlayer, "invincible", true) else setElementData(localPlayer, "invincible", false) end end addEventHandler ( "onClientPlayerDamage",root, function () if getElementData(localPlayer,"invincible") then cancelEvent() end end) The player health still decreases. No errors in debug.
-
Manufacturer: Dell Processor: Intel® Core i5 2450M CPU @2.50GHz 2.50 GHz Installed Memory (RAM): 6.00 GB System Type: 64-bit Operation System OS: Windows 7 Professional
-
Thanks! Works perfect!
-
Lol! Everyone has my name. Must be some bug in script. Please fix it.
-
Error: Lua 25 Unexpected Symbol near )
-
I tried this, it should make the nametag color random of players which are not in a team, and which are in a team, they should have their team nametag colors. But it doesn't work. addEventHandler( "onClientRender",root, function( ) local px, py, pz, tx, ty, tz, dist px, py, pz = getCameraMatrix( ) for _, v in ipairs( getElementsByType 'player' ) do tx, ty, tz = getElementPosition( v ) dist = math.sqrt( ( px - tx ) ^ 2 + ( py - ty ) ^ 2 + ( pz - tz ) ^ 2 ) if dist < 30.0 then if isLineOfSightClear( px, py, pz, tx, ty, tz, true, false, false, true, false, false, false,localPlayer ) then local sx, sy, sz = getPedBonePosition( v, 6 ) local x,y = getScreenFromWorldPosition( sx, sy, sz + 0.3 ) if x then -- getScreenFromWorldPosition returns false if the point isn't on screen local team = getPlayerTeam(localPlayer) if team then local r, g, b = getTeamColor(team) setPlayerNametagColor(localPlayer, r, g, b) else local r, g, b = getPlayerNametagColor(localPlayer) dxDrawText( getPlayerName( localPlayer ), x, y, x, y, tocolor(255, 255, 0), 0.85 + ( 15 - dist ) * 0.04, "default-bold", "center" ) end end end end end )
-
function donatorL1 (player) local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "DL1" ) ) then outputChatBox("Welcome To Your Donator Level 1", player, 60, 255, 0) end end addEventHandler ( "onPlayerLogin", getRootElement(), donatorL1 )
-
[PROJECT] Laptop into dedicated server!
Bilal135 replied to FlyingSpoon's topic in Hosting solutions
You better purchase a laptop cooling pad as well, because if you are going to keep it on for a month, it will be heated up and eventually, it will shut down it self. -
I created a script so it creates nametag on the top of the head using dxCreateText. It creates the nametag near the leg. How can I make it appear on the top of player's head? thanks. local rootElement = getRootElement() local screenWidth, screenHeight = guiGetScreenSize() function NPCnametag() local sx,sy = getScreenFromWorldPosition (getElementPosition(localPlayer)) if sx then dxDrawText(""..getPlayerName(localPlayer),sx,sy,screenWidth, screenHeight,tocolor ( 255, 255, 0, 255 ), 1.4,"default-bold") end end function HandleTheRendering() addEventHandler("onClientRender",rootElement, NPCnametag) end addEventHandler("onClientResourceStart",rootElement, HandleTheRendering)
-
server: function setPlayerHealth ( ) local newHealth = getElementHealth ( source ) setElementHealth ( source, newHealth+25 ) takePlayerMoney ( source, 1500 ) end addEvent ( "setPlayerHealth", true) addEventHandler ( "setPlayerHealth", root, setPlayerHealth)
-
That's cool. It would be more better if you rename those to something that explains what they are for. For example "Come fly with me" should be "Flying Cars"...This is more better. But as you wish, everyone is free to edit the resource and release as they wish, but please don't forget to put my credits.
-
Hello everybody! I just created the version two of one of my oldest and most rated resources, which was MTA Cheats and Codes (https://forum.multitheftauto.com/viewtopic.php?f ... +and+Codes). I made a completely new topic because I rewrote the whole code, and this time, I'll release it uncompiled. The main update is that this is now done in GUI, which is much better than typing commands. You can open / close the panel using F4 button on keypad. Screenshot: This supports 21 cheats currently, but I may add more soon when I get more ideas. Download: https://community.multitheftauto.com/index.php?p= ... s&id=11435 If you're here to say "Nothing new", then please don't comment. Learn to appreciate someone's work for community. Thanks! Please rate it 5.
-
Thanks! I will take your suggestions.
-
Thanks everybody! (I'll look into your advice Johnny)
-
Hello everybody! I'm here to present a simple, basic and an useful script. This is the first time that I ever created something with GUI Grid list, and I'm here to release it to you guys. So this resource, opens a GUI by either pressing F6 or typing /musicplayer. I've added six songs, but you can change them by your self, its easy to edit the resource. You can play or stop the song. I've added the original song files, thats why it's more than 40 MB. You can even edit and put the links of the songs, but those take a bit of time to load, your choice. Screenshot: http://imgur.com/TX6Qko8 Download: https://www.mediafire.com/?bd0te6vqitskgoj Enjoy, thanks!