Jump to content

Captain Cody

Members
  • Posts

    2,753
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Captain Cody

  1. local x, y = getElementPosition(player) local sx,sy = guiGetScreenSize() local Resx = "Put X here" local Resy = "Put Y here" x = (x/6000)*Resx*(1*sx) y = (y/6000)*Resy *(1*sy)
  2. You have nothing defining the OnClientRender event handlers. You need them for Dx functions to work correctly. (Core seams just fine though)
  3. Captain Cody

    Help

    Resource root should work just fine. Sends it server side with the player defined as client. Any ways, check debugscript and make sure that the server side is defined before client side I believe it is.
  4. Captain Cody

    Help

    Anything in /debugscript 3 ?
  5. Just put it in an actual code.. setAmbientSoundEnabled( "gunfire", false ) Put that as client.lua And put that as meta.xml Put them both in one folder, refresh scripts and start it.
  6. Captain Cody

    Help

    Client = Button = {} function openThePanel () if not MainWindow then showCursor(true) MainWindow = guiCreateWindow(185, 5, 382, 600, "-x[ Vip Panel #By LuckyDude ]x-", false) guiWindowSetSizable(MainWindow, false) guiSetProperty(MainWindow, "CaptionColour", "FF19FBFF") Button[1] = guiCreateButton(17, 41, 165, 49, "Health +100", false, MainWindow) guiSetProperty(Button[1], "NormalTextColour", "FFFD0101") Button[2] = guiCreateButton(201, 41, 165, 49, "Armor +100", false, MainWindow) guiSetProperty(Button[2], "NormalTextColour", "FF007577") Button[3] = guiCreateButton(18, 120, 348, 45, "Vip Car", false, MainWindow) guiSetProperty(Button[3], "NormalTextColour", "FF16EE10") Button[4] = guiCreateButton(18, 175, 348, 45, "Fly With Car", false, MainWindow) guiSetProperty(Button[4], "NormalTextColour", "FFDCE916") Button[5] = guiCreateButton(18, 230, 348, 45, "Drive On Water", false, MainWindow) guiSetProperty(Button[5], "NormalTextColour", "FF0F0AF4") Button[6] = guiCreateButton(18, 285, 348, 45, "Invisible Skin", false, MainWindow) guiSetProperty(Button[6], "NormalTextColour", "FFC928DC") Button[7] = guiCreateButton(18, 340, 348, 45, "Invisible Car", false, MainWindow) guiSetProperty(Button[7], "NormalTextColour", "FF3493A4") Button[8] = guiCreateButton(18, 395, 348, 45, "Vip Weapon (Minigun)", false, MainWindow) guiSetProperty(Button[8], "NormalTextColour", "FF68785F") Button[9] = guiCreateButton(18, 450, 348, 45, "Vip Skin", false, MainWindow) guiSetProperty(Button[9], "NormalTextColour", "FF63B771") Button[10] = guiCreateButton(18, 505, 348, 45, "High Jump", false, MainWindow) guiSetProperty(Button[10], "NormalTextColour", "FF4D2454") GUIEditor.label[1] = guiCreateLabel(18, 565, 235, 30, "Vip Panel by: LuckyDude", false, MainWindow) guiSetVisible (MainWindow, false) --- Events addEventHandler("onClientGUIClick", Button[1], setCrysis, false) addEventHandler("onClientGUIClick", Button[2], regenArmor , false) addEventHandler("onClientGUIClick", Button[3], vipcar, false) addEventHandler("onClientGUIClick", Button[4], fly, false) addEventHandler("onClientGUIClick", Button[5], hover, false) addEventHandler("onClientGUIClick", Button[6], toggleInvis, false) addEventHandler("onClientGUIClick", Button[7], invisibility, false) addEventHandler("onClientGUIClick", Button[8], vipweap, false) addEventHandler("onClientGUIClick", Button[9], setvip, false) addEventHandler("onClientGUIClick", Button[10], highjump, false) else destroyElement(MainWindow) MainWindow = nil showCursor(false) end end addCommandHandler ("skinpanel",openThePanel) ----------- NEEDS TO BE ADDED SERVER function regenArmor() triggerServerEvent ("setArmour", resourceRoot) end flyEnabled = false function fly() if not flyEnabled then setWorldSpecialPropertyEnabled ( "aircars", true ) flyEnabled = true else setWorldSpecialPropertyEnabled ( "aircars", false ) flyEnabled = false end end function hover () if not isWorldSpecialPropertyEnabled( "hovercars" ) then outputChatBox("Water drive: on ", 255, 255, 0 ) setWorldSpecialPropertyEnabled( "hovercars", true ) else outputChatBox("Water drive: off ", 255, 255, 0 ) setWorldSpecialPropertyEnabled( "hovercars", false ) end end function highjump () if not isWorldSpecialPropertyEnabled( "extrajump" ) then setWorldSpecialPropertyEnabled( "extrajump", true ) else setWorldSpecialPropertyEnabled( "extrajump", false ) end end function invisibility () triggerServerEvent ("setInvisiblity", resourceRoot) -- Same as below?? \/ end function toggleInvis () triggerServerEvent ("setInvisiblity", resourceRoot) -- Same as above?? /\ end screamTXD = engineLoadTXD("vip.txd") engineImportTXD(vipTXD, 25 ) screamDFF = engineLoadDFF("vip.dff") engineReplaceModel(vipDFF, 25) --- Loads for everyone -- function setvip () triggerServerEvent ("setElementModelClient", resourceRoot) end function vipcar () triggerServerEvent ("GiveVIPCar", resourceRoot) end function vipweap () triggerServerEvent ("GiveVIPGun", resourceRoot) end --- showingDX = false function showDX() --- Not sure what this is used for, but it'll actually work now if showingDX then removeEventHandler("onClientRender",root, dx) else addEventHandler("onClientRender",root, dx) end end Server = function setArmour() for _,player in ipairs(getElementsByType("player")) do local arm = getPedArmor(player) if arm < 100 then local nuarm = arm + 10 elseif nuarm > 100 then local nuarm = 100 end setPedArmor(player,nuarm) end end addEvent( "setArmour", true ) addEventHandler( "setArmour", resourceRoot, setArmour) function invisibility () if(getElementAlpha(client) > 200) then setElementAlpha(getPedOccupiedVehicle(client), 0) else setElementAlpha(getPedOccupiedVehicle(client), 255) end end addEvent( "setInvisiblity", true ) addEventHandler( "setInvisiblity", resourceRoot, invisibility) function SetHisModel () setElementModel(client,25) end addEvent( "setElementModelClient", true ) addEventHandler( "setElementModelClient", resourceRoot, SetHisModel) function GiveHimCar () local x, y, z = getElementPosition ( client ) local vehicle = createVehicle ( 411, x, y, z + 10 ) warpPedIntoVehicle(client,vehicle) end addEvent( "GiveVIPCar", true ) addEventHandler( "GiveVIPCar", resourceRoot, GiveHimCar) function GiveHimGun () giveWeapon ( client, 38, 5000 ) end addEvent( "GiveVIPGun", true ) addEventHandler( "GiveVIPGun", resourceRoot, GiveHimGun) Make sure to add it to the meta file. And remember, client side == Only that player, not everyone. And @Shaman123 there was more then that needed to be server side.
  7. Captain Cody

    Help

    I've found multiple mistakes you have made, working on fixing them now.
  8. Well you need to account for screen size local x,y = guiGetScreenSize() local valuea, valueb = 1/x,1/y Then multiply the values you get there into the x and y. valuea goes to X valueb goes to y Try that I'm not to sure if it will work.
  9. 1 player, sure you don't need tables. 2+ Players.. Yes you do need tables. Basicly everything that involves more then one person that is server side requires one sort of table or another.
  10. This particular code here looks just fine, but as Labi said, we need the whole code to see if there are other possible errors.
  11. Captain Cody

    Help

    The invisibly thing was just fine other then the fact that it's a bit screwed up for the task he's working for. #1 This sets his invisibly to 0 if it's already 0. #2 It's client side, won't do any good for other players. #3 You're missing a few ends. Any ways as for the other parts of the code. You need to make the GUI a function instead of on a onClientResourceStart even handler.
  12. All it takes is one missing comma or what not to mess it all up.
  13. If you have any questions about this ask here.
  14. local x, y = getElementPosition(player) x = x/6000*resx -- Resx Put how big your mini map is in X y = y/6000*resy -- Resy Put how big your mini map is in y Not tested at all but in theory it should work. 6000x600 is the size of SA so You get your players location and you divide it by 6000, giving you value in-between 0 and 1 (Bigger if out of bounds) Then you multiply that value by the size of your map. (Pixels in this case) thus accurately giving you the location hopefully. But you also have to take into account a stretched picture. Meaning if your picture is at all stretched, you have to play around with the ResX and Res Y values a bit.
  15. Well really client side was useless in the first place in my own opinion. All it does it tell the debugscript client side and freeze / unfreeze the player. All could be done server side.
  16. Make sure it is put client side. /run throws it server side.
  17. @LabiVila, I belive he was just asking for, no admins present.
  18. -- Server Side addEventHandler( "onPlayerNetworkStatus", root, function( status, ticks ) if status == 0 then kickPlayer(source,"Your network has frozen") end end ) You can remove client.
  19. Really it all depends on your processor and hard drive set up. The better it is, the lower the impact. Even with a crappy set up MTA servers are very low-resource applications.
  20. Server onMarkerHit is screwed up for some reason.
  21. From what it seams there's a code error at the website. But I'm not to sure. Make sure you are using value = getServerIp()
  22. Oh in that case you can script one in. There may be exports to do it in the score board.
  23. If you pair a lowlod to it, it helps alot. The 300 distance is for the object itself, not the low- lod.
  24. Virtual machines would be the best way most likely. You can run them all at lowest possible priority on each. Allowing you to do the bots without the extra lag incoming. Wouldn't be as good as Simples but it would be a heck of a lot easier.
×
×
  • Create New...