Jump to content

cheez3d

Members
  • Posts

    290
  • Joined

  • Last visited

Everything posted by cheez3d

  1. function kickPlayerCommand(player,command,target,...) local reason = {...} if target then local whoToKick = getPlayerFromName(target) if whoToKick then kickPlayer(whoToKick,player,(table.concat(reason," ") ~= "" and table.concat(reason," ") or "No reason specified!")) end else outputChatBox("ERROR - No target specified!",player,255,0,0) outputChatBox("SYNTAX: /ikick [reason]",player,0,255,0) end end addCommandHandler("ikick",kickPlayerCommand,true) Try this.
  2. You can use interpolateBetween for a nice smooth effect when changing sky color.
  3. Any debugscript errors? Use /debugscript 3 in game and show us what you get.
  4. What errors do you receive?
  5. cheez3d

    SQLite

    executeSQLQuery("CREATE TABLE IF NOT EXISTS `dbName` (ID INT(5) NOT NULL AUTO_INCREMENT, Name TEXT NOT NULL), PRIMARY KEY (ID)")
  6. getPedControlState() setPedControlState() setTimer()
  7. Try this. window_Close = guiCreateButton(659,700,39,31,"X",false,window) guiSetFont(window_Close,"default-bold-small") guiSetProperty(window_Close, "NormalTextColour", "FF80FF00") addEventHandler("onClientGUIClick",window_Close,function() guiSetVisible (window, false) showCursor (false) playSound("open.wav") end,false) function onresourceStart () guiSetVisible(window,false) bindKey ("F9", "down", showUserPanel) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart) function showUserPanel () getVisible = guiGetVisible (window) if not getVisible then guiSetVisible (window, true) showCursor (true) playSound("open.wav") end end
  8. You must attach a function that will close the window to the event that is triggered when you click that button ("onClientGUIClick").
  9. I extracted this from an old script i made. You might find it helpful. if string.find(guiGetText(source),"%W") then guiSetEnabled(NextStepchoosenameTXT,false) guiStaticImageLoadImage(NextStepchoosename,"pictures/button_disabled.png") guiSetText(errorOutput,"Your first name must not contain non-alphanumeric characters!") end http://www.lua.org/pil/20.2.html - patterns are explained here
  10. You post a topic daily asking for help and you call yourself a good scripter. Cool story bro.
  11. You can use string functions.
  12. If i'm not mistakin, the surface type is stored in the .col file of the object.
  13. pedCreated = function (player,_,pedid) local x, y, z = getElementPosition(player) local pedModel = createPed(tonumber(pedid), x, y + 5, z) end addCommandHandler("ped", pedCreated) This is a server-side script. What it does is: it gets the id you specify when you use the command (example: /ped 23) and stores it in pedid as a string. Then it runs the function and creates a ped with the id you specified.
  14. cheez3d

    Colored Road

    You must make the textures of the object yourself and use https://wiki.multitheftauto.com/wiki/EngineImportTXD
  15. Did you properly set the info of the song? Right click the song and go to Properties then go to the Details tab and add Title and Author if not set.
  16. getElementPosition() dxDrawImageSection()
  17. local keyButton = guiCreateButton(0,0,93,29,"",false) guiSetFont(keyButton,"default-bold-small") addCommandHandler("updatebutton",function() local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle then if isVehicleLocked(vehicle) then guiSetText(keyButton,"Unlock!") else guiSetText(keyButton,"Lock!") end else outputChatBox("ERROR - You are not currently driving a vehicle!",255,0,0) end end) Use /updatebutton to check if the vehicle is locked or not.
  18. The button becomes visible when you enter a car (so there is no need to use that timer) and it disappears when you start exiting the car. What exactly doesn't work for you?
  19. local keyButton = guiCreateButton(0,0,93,29,"",false) guiSetFont(keyButton,"default-bold-small") guiSetVisible(keyButton,false) addEventHandler("onClientVehicleEnter",root,function() guiSetVisible(keyButton,true) if isVehicleLocked(source) then guiSetText(keyButton,"Unlock!") else guiSetText(keyButton,"Lock!") end end) addEventHandler("onClientVehicleStartExit",root,function() guiSetVisible(keyButton,false) end)
  20. Yes, you can create your wanted level system any way you want (using element data or the classic GTA Star wanted level). You made a mistake in your code: if wantedlvl <= 0 then You put < instead of > and there is now need to add the =. What you wrote right there means that if the player's wanted level is smaller than or equal to 0 then he should be added to the wanted list which has no logic. Use > instead.
  21. You should use setElementData() to set the players' wanted level and then loop trough all the players and check if they have a wanted level greater than 0 like so: for _,player in ipairs (getElementsByType("player")) do if getElementData(player,"wantedLevel") > 0 then local row = guiGridListAddRow(playerGrid) guiGridListSetItemText(playersGrid,row,playcol,string.gsub(getPlayerName(player),"#%x%x%x%x%x%x",""),false,false) end end
  22. cheez3d

    Spawn

    Sorry, my mistake
  23. cheez3d

    Spawn

    local spawnLocations = { {331.06286621094,1855.9083251953,7.828125}, {216.45199584961,1822.6893310547,6.4140625}, {211.66558837891,1810.6231689453,21.8671875} } local respawnPlayer = function() local chosenSpawnLocation = math.random(1,#spawnLocations) spawnPlayer(source,spawnLocations[chosenSpawnLocation][1],spawnLocations[chosenSpawnLocation][2],spawnLocations[chosenSpawnLocation][3]) end addEventHandler("onPedWasted",root,respawnPlayer)
  24. You must have different servers for different gamemodes and use redirectPlayer() redirectPlayer()
×
×
  • Create New...