Jump to content

Spakye

Members
  • Posts

    104
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Spakye

  1. Hello, you can encrypt your script so people cant read it. You can't avoid people downloading client side script since it runs on their pc. As far as i know its the only solution but i could be wrong
  2. Hello with setElementDimension()
  3. Hello, could it be that the car explosion count as a player killing himself (suicide)? so then it print the suicide message and then the other one? maybe change the suicide message so they are not identical.
  4. Hello, you need to use toJSON to turn the table into a string to be able to save it, and then use fromJSON to turn it back into a table when you need to use it.
  5. Hello, I will try to give you some step by step indications on how you can do it rather than give you ready to use code. Client side, try to create a windows with guiCreateWindow() Try to make it appear and disappear with guiSetVisible(), you did not specify how and when you want the window to appear so i can only recommend trying with a commandHandler for now. You can easily replace it later on. Try to add a button to the window with guiCreateButton() and to attach it to a function with addEventHandler("onClientGUIClick", yourButton, youFunction) Try to make an easy function that output some text at first with outputChatBox() At that point you should be able to show the window, close the window, and print a message by clicking the button. Server Side, make a simple function that print some text like "server received the trigger", create an event with addEvent(), and add an event handler that calls the function you just made when the event is triggered. Back to client side try to add a server event trigger with triggerServerEvent() that will trigger the event you just created. If it works and you see your message sent from server side you have done the hardest part. Now you will do the same thing but in the other way. Create an event client side, trigger it from the server with triggerClientEvent(), make a function that shows your picture with guiCreateStaticImage(), hide the picture with setTimer() Thats pretty much it, its not very well explained and detailed but i can help you out if you struggle with something specific later on. Please just give it a try
  6. Damn i struggle to believe this is actually mta sa Really good job it looks very nice! I hope your project works out well and im looking forward to try it!
  7. giveWeapon(player23,...) instead of Player23
  8. Hello, you wrote Player23 instead of player23
  9. Hello, check IIYAMA resources https://community.multitheftauto.com/index.php?p=profile&id=285621 Project trains and Airplane. This resources add airplanes and trains going arround the map. Its not exactly what you want but it does bring some life to the gta map.
  10. hello can you share the code you have so far?
  11. Hello, use fadeCamera and spawnPlayer when a player joins. function spawnThePlayer() fadeCamera ( source, true) spawnPlayer ( source, 0, 0, 5) end addEventHandler ( "onPlayerJoin", root, spawnThePlayer )
  12. Cause the vehicle damage event parameters are different addEventHandler("onClientVehicleDamage", root, function(theAttacker, dmgType, loss,) if (dmgType == 19) then cancelEvent() local currentHealth = getElementHealth(source) setElementHealth(source, currentHealth - loss*2) -- doubling the damage end end )
  13. local rocketDmg = 50 function changeRocketDmg(attacker, dmgType, bodypart, loss) if (dmgType == 39) then cancelEvent() local playerHealth = getElementHealth ( localPlayer ) - rocketDmg if playerHealth <= 0 then killPed(localPlayer, attacker) else setElementHealth(localPlayer, playerHealth) end end end addEventHandler("onClientPlayerDamage", localPlayer, changeRocketDmg) Hello you can try this, i did this quickly on my phone so i didnt test it and there is maybe mistakes but the general idea should work i think. The problem with this method is that the rocket dmg is a set value when in reality you should take less dmg if you are far from the explosion or a lot of dmg if you stand right into it. You could do a percentage instead, you keep the first part of the code but then reduce loss value by 50% or something like that. local rocketDmgModifier = 0.5 -- from 0 to 1, 0 for 0% of the dmg and 1 for 100% of the dmg function changeRocketDmg(attacker, dmgType, bodypart, loss) if (dmgType == 39) then cancelEvent() local playerHealth = getElementHealth ( localPlayer ) - ( loss * rocketDmgModifier ) if playerHealth <= 0 then killPed(localPlayer, attacker) else setElementHealth(localPlayer, playerHealth) end end end addEventHandler("onClientPlayerDamage", localPlayer, changeRocketDmg) An other version with percentage rather than a set value. Again i didnt test it
  14. Do you use the default mta account system or do you have your own?
  15. Hello try this ? local jumpKeys function getJumpKeys() jumpKeys = getBoundKeys ( "jump" ) end addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), getJumpKeys ) function playerPressedKey(button, press) local moveState = getPedMoveState ( localPlayer ) if moveState == "sprint" then for k,v in pairs( jumpKeys) do if button == k then cancelEvent() end end end end addEventHandler("onClientKey", root, playerPressedKey)
  16. Hello, you have to pick a new message each time you open that gui. If you are using the basic admin resource that come with mta server ( which i think you do ) then you can edit the function aAdminMain.Open () inside c_gui.lua like so : local aMessages = { [[Admin panel by Lil_toady]], [[TEST1]], [[TEST2]], [[TEST3]], [[TEST4]], [[TEST5]] } local yourLabel -- creating both vars here so its accessible from anywhere in the file function aAdminMain.Open () if ( aAdminMain.Form == nil ) then local x, y = guiGetScreenSize() aAdminMain.Form = guiCreateWindow ( x / 2 - 310 - 20, y / 2 - 260 - 20, 620, 520, "Anti-Cheat Panel - v".._version, false ) aAdminMain.Panel = guiCreateTabPanel ( 0.01, 0.05, 0.98, 0.95, true, aAdminMain.Form ) aAdminMain.AddTab ( "Status", aAntiCheatTab, "anticheat" ) aAdminMain.AddTab ( "Status #2", aAntiCheatTab2, "anticheat" ) aAdminMain.AddTab ( "Block Img Mods", aBlockModsTab, "mods" ) aAdminMain.AddTab ( "Server Config", aServerConfigTab, "server" ) yourLabel = guiCreateLabel ( 0.75, 0.05, 0.45, 0.04, "", true, aAdminForm ) -- creating the label here with other gui elements addEventHandler ( "onClientGUITabSwitched", resourceRoot, aAdminMain.Switch ) addEventHandler ( "onAdminInitialize", aAdminMain.Form, aAdminMain.Initialize ) triggerEvent ( "onAdminInitialize", aAdminMain.Form ) end guiSetText ( yourLabel , aMessages[math.random(#aMessages)] ) -- updating the random message each time you open the window guiSetAlpha ( aAdminMain.Form, 1 ) guiSetVisible ( aAdminMain.Form, true ) showCursor ( true ) aAdminMain.Hidden = false end Please note that i didnt test it and didnt script in a long time so i maybe made a mistake.
  17. Hello you can use setPedWalkingStyle
  18. Hello, you can detect it with a colshape and attach it to the object or to the player.
  19. Hello, you are on the wrong forum im afraid. This forum is about Mta sa which is a mod to play san andreas online. Nothing to do with fiveM ?
  20. Hello, idk what Vulatic gamemode is but you probably need to start resources in a speficic order. Make sure to follow the setup guide correctly if there is one.
  21. Hello, you can detect when a player is leaving a colshape with onColShapeLeave event. You can also get all players with getElementsByType("player") and then loop through the table and check if the players are in the colshape with isElementWithinColShape
  22. Spakye

    question

    everything is in the resource's wiki, it works similar to gui. Just go down the list of elements you would like to create, pick what you like and check exemples
  23. Spakye

    question

    Hello, with dx functions like dxDrawText. You can also take a look at DGS resource https://wiki.multitheftauto.com/wiki/Resource:DGS
  24. Hello, you can use string.sub(theString, 2) to remove first letter and string.lower(theString) to remove uppercase
×
×
  • Create New...