Jump to content

Gravestone

Members
  • Posts

    467
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Gravestone

  1. This table is created. Now what do I add in my script?
  2. This code mutes the player with a reason for a specific time when defined. For example you type '/p grav 1 6' this will punish a guy name grav for Rule #1 and for 6 minutes. I want my code to select the timer in an ascending order. I mean, the first mute for that serial goes for 1 min then the second goes for 2 mins and then 5 mins later 10 mins and so on. The timer maximum time stays at 6 hours. Any help would be highly appreciated. function punish(thePlayer, cmd, playername, rule, arg3, arg4) if hasObjectPermissionTo(thePlayer, "function.setPlayerMuted", false) then if rule then local rule = tonumber(rule) local player = getPlayerFromNamePart(playername or "") if player then if rule == 1 then local duration = (tonumber(arg3) or 0) * 60 * 3600000 setPlayerMuted(player, true, true, true, thePlayer, reason, duration) outputChatBox("#008AB8 • #ffffff"..getPlayerName(thePlayer).." #008AB8has muted #ffffff"..getPlayerName(player).." #008AB8for RULE #1 ( #ffffffNon-English#008AB8 ) #008AB8(#ffffff "..tonumber(arg3).." minutes #008AB8) ", root, 255, 255, 255, true) else outputChatBox("Error: Invalid rule ID",thePlayer, 255, 0, 0) end else outputChatBox("Error: Invalid player",thePlayer, 255, 0, 0) end else outputChatBox("Error: /p [Player's name] [Rule ID] [Duration]",thePlayer, 255, 0, 0) end end end addCommandHandler("p", punish) function getPlayerFromNamePart(name) if name then for i, player in ipairs(getElementsByType("player")) do if string.find(getPlayerName(player):lower(), tostring(name):lower(), 1, true) then return player end end end return false end
  3. Post the full code.
  4. dxDrawRectangle is used to draw a rectangle only, you can't make a function when the player clicks on it. Use GUI function instead.
  5. Define the problem you're facing.
  6. Lol @Dimos, do you think you can rape the player to stay at your server and don't quit neither reconnet? Lmao.
  7. You've posted the same topic twice, you'll get help by posting once, no need to post twice.
  8. Vehicle plate ID? If I understood you well, when you create a vehicle using createVehicle, the 8th argument is the text to be written on the vehicle's number plate.
  9. Gravestone

    Hi There

    Use the following functions: onClientGUIClick - as an event to trigger when the click clicks a button guiSetVisible - to set a GUI visible to the client.
  10. Try using event handler instead of command. function fanFunction ( player) local vehicle = getPedOccupiedVehicle(player) local sx,sy,sz = getElementVelocity ( vehicle ) setElementVelocity( vehicle ,sx, sy, sz+0.5 ) end addEventHandler("onClientResourceStart", getRootElement(), fanFunction) bindKey ( player, "lshift", "down", fanFunction)
  11. Start the timer when the player exits the vehicle using onVehicleExit and kill it when player enters using onVehicleEnter.
  12. Gravestone

    Help

    You need to define 'wlaa' timer. And why are you adding an event onPlayerDamage while it already exists? Try this: function healer(playerSource) if isTimer (wlaa) then return outputChatBox("Server: Please wait 3 seconds before you re-fill your HP again", playerSource, 255, 0, 0) else local money = getPlayerMoney ( playerSource ) if (money < 3000) then outputChatBox ("Server: You don't have enough money",playerSource, 255, 0, 0) return else takePlayerMoney ( playerSource , 3000 ) setElementHealth ( playerSource , getElementHealth ( playerSource )+100 ) outputChatBox ("You got 100 HP" , playerSource, 21 , 241 , 32 , true ) timer() end end end addCommandHandler ( "hp", healer ) function timer() wlaa = setTimer(healer, 3000, 1) end addEventHandler("onPlayerDamage", root, timer) The script is server sided btw.
  13. Gravestone

    help error

    Please view this topic before posting. https://forum.multitheftauto.com/viewtopic.php?f=91&t=47897
  14. This code will show the image only at the time when the cursor is on the button. I want the image to be shown all the time.
  15. When we move the cursor on the button then the button is highlighted. Is it possible that when the cursor is on the image, with the button as its parent, the button highlights? e.g button = guiCreateButton(163, 23, 109, 97, "", false) image = guiCreateStaticImage(10, 10, 89, 77, "icon/button.png", false, button)
  16. I made this code to add a VIP account for 1 week. The timer should start when the object is added. To test, I set the timer to 1 second. The object doesn't get removed. Any help guys? function addVIP (playerSource, commandName, accountName, type) if accountName then aclGroupAddObject (aclGetGroup("VIP"), "user."..accountName) outputChatBox ("Account '"..accountName.."' has been succesfully made VIP (3 Weeks)", playerSource) setTimer(removeVIP, 1000, 1) else outputChatBox ("No account name specified.", playerSource) outputChatBox ("Correct syntax: /giveVIP [Account Name]", playerSource) end end addCommandHandler ("giveVIP", addVIP) --ad The removing code: function removeVIP (accountName) aclGroupRemoveObject (aclGetGroup("VIP"), "user."..accountName) outputServerLog("Account "..accountName.."'s VIP expired.") end For this, error in debugscript: attempt to concatenate local 'accountName' (a nil value)
  17. MTA staff members can help me with this I guess?
  18. I don't get it. I DO NOT want random selection. Look, if there are 8 players in Drug Dealers and 7 players in US Army then when the player who type /dd will be sent to US Army. This is what I want it to be like.
  19. The script doesn't select 1 by 1, it is still selecting players randomly.
  20. When I change a game mode my every resource gets bugged. For example, it shows custom hud as well as GTA SA's hud, it plays original GTA SA's sound as well as my custom sounds, the weapon model pickups appear original but when equipped, it shows my custom weapons. How can I fix this bug?
  21. I don't have, that's why I posted here.
  22. Gravestone

    Webadmin

    Hello. I was wondering if there is anyway I can chat from throw the webadmin? Not through console, if I chat with console then it appears in chatbox 'Console: ..message'. I want to execute a message from the web which outputs in chatbox. Example 'say #00ff00Hello' and in chatbox it appears 'Hello'.
×
×
  • Create New...