Jump to content

Sawos

Members
  • Content Count

    30
  • Joined

  • Last visited

Everything posted by Sawos

  1. Hello there,today i bring an inventory script,as the name suggests it's an inventory to store all your items from weapons to food/repairkit ,to use an item it is easy as just pressing use within selecting the amount .It is very easy and stable and was built using SQL,hopefully it is up to standards. You still have the option to use commands : ./use weaponname amount ./use itemname ./store weaponname amount ./drop weaponname amount (need to be stored) Current Items: Food: Boosts the player's health by 10 if he's low. Repairkit: Gives the vehicle 10
  2. Well, I tought you would give me a lesson, but i will. If you leave it to "source" It won't make the player exits, cause the source element refers to the Vehicle not the player so without using The Loop to get the players it won't work, same thing with the Vehicle Loop without it, it won't dected any of the Vehicles at all : for i,player in pairs(getVehicleOccupants(source)) do setControlState(player,"enter_exit",true) and The issue was never from this Loop, cause without the loop the SetControlState won't be working plus even without both of them the issue still the
  3. Nope that's not the problem, if it was that i wouldn't post it.
  4. Hello Community, i would like to have some support here, the code works fine on this script which once the Vehicle damage is below "350", it gets Destroyed in a couple of seconds and then once the script calls this : setTimer( sec, 6000, 0 ) It doesn't spawn a single Vehicle as i wish to, it Spawns an infinate Vehicles on the same place. i just need help to make it spawn Only One. Here is the full code : function sec () local car = createVehicle ( 428, 2317.0588378906,2408.1867675781,10.8203125) setElementData(car,"sec",true) setVehicleDamageProof(car,true) end add
  5. Hello Community, i do have a script which when someone spawn the vehicle it shows up on The debug, This is the code : function spawner ( sourceplayer, commandname, carN) if not isPedInVehicle ( sourceplayer )then local x, y, z = getElementPosition ( sourceplayer ) local rx , ry, rz = getElementRotation ( sourceplayer ) local location = getZoneName ( x, y, z ) local car = createVehicle ( 434, x, y, z, rx, ry, rz) setElementData( sourceplayer, "housing", car ) warpPedIntoVehicle ( sourceplayer, car ) setElementAlpha(car, 180) triggerClientEvent("enableCollisions",sourceplayer,car) s
  6. this is really awesome man, good job for real, for How long you been coding all of this ? good luck on the sale.
  7. You should define all of 3 skills into the weapon (poor, std , pro) . and most importantly you didn't call the resource on the script starting with this : addEventHandler ( "onResourceStart", getRootElement(), stats ) and you cant remove these 2 lines unless you won't be using them in other side to trigger them : addEvent("stats",true) addEventHandler ("stats", root, stats) You're welcome
  8. function stats() weaponList = { "ak-47" } for _,weapon in ipairs( weaponList ) do for _,skill in ipairs( { "poor", "std", "pro" } ) do setWeaponProperty( weapon, skill, "maximum_clip_ammo", 1) end end end addEvent("stats",true) addEventHandler ("stats", root, stats) addEventHandler ( "onResourceStart", getRootElement(), stats )
  9. I Get No Errors/warnings but it doesn't work when i leave the vehicle, anyways thanks for the help
  10. bad argument @'getElementData' [Expected element at argument 1, got nil]
  11. Loading script failed: housingspawn\spawner.lua:34: ')' expected near ',' do i have to add the vehicle identify name ? Removed The "local" from SetElementData at the function Out and Now it shows me : attempt to concatenate a boolean value
  12. Nope, both didn't work. neither the collision thing and the destroy vehicle stopped working at all. also setElementCollisionsEnabled(car, true) a can't work with Vehicles.
  13. Yes @ShayF i have already seen that but the thing i'm still stuck at the PlayerExitVehicle thing
  14. doesn't work at all.. i literally needed some help here.. a real help Thanks
  15. function colloff () local theVeh = getElementData( sourceplayer, "freecar" ) setElementCollidableWith(theVeh, sourceplayer, false) end addEvent( "test", true ) addEventHandler( "test", localPlayer, colloff ) This should work fine ? when i trigger it to server side ? bad argument @'setElementCollidableWith' [expected element at argument1, got boolean]
  16. I'm using the debugscript command everytime i log in. That's why i needed some help cause the debug was showing no Warnings/errors at all. Will try out what u just replied, thanks Since it's server side and setElementCollidableWith works with Client Only, do u have any idea how may i code it to client side so i can trigger it to server side, In other words, Shall i use the GetElementData on the funtcion of setElementCollidableWith (client side) !!
  17. Hello Community, i've been coding a very small Script which makes me a spawn a specific "Vehicle" with a command, It workd literally fine at first. Later on, i've tried to add this : setElementCollisionsEnabled(car, false) to the car which i spawn, but the thing is once i spawn the vehicle, it goes directly up into the Air like there is none of Gravity if you know i mean, here is the code : allowedTeams = { ["Staff"] = true,} function spawner ( sourceplayer, commandname) if allowedTeams[getTeamName(getPlayerTeam( sourceplayer))]then local x, y, z = getElementPosition ( source
  18. Take a Look at this Please : https://wiki.multitheftauto.com/wiki/ToggleControl You might be using The ToggleControl function which has to be Client side.
  19. Hello MTA Community, i've made a script which Makes the Team "name" undamageable until they get a wanted level, i've tried it in many ways and i'm still having this error : ANTIDM/Server.lua:3: syntax error near 'end' Client Side : dmteam = { ["Emergency"] = true, } function antidm (Player) Player = getLocalPlayer() if dmteam[getTeamName(getPlayerTeam(Player))] and triggerServerEvent("Dm", Player, Player) then cancelEvent() end end addEventHandler("onClientPlayerDamage", getRootElement(), antidm) Server Side : function check(Player) (exports.SACGpolice:getWa
  20. local friends = { ["Emergency"] = true, } function friendy () for index, theTeam in ipairs(friends) do if ( getTeamFriendlyFire ( theTeam ) == false ) then setTeamFriendlyFire ( theTeam, true ) end end end addEventHandler("onClientPlayerDamage", getRootElement(), friendy) Well, i wanted to restrict The Emergency team from getting Killed by each other for an exemple, The Scripts works fine without any Warnings/Errors But It's not running Correctly, there has to be a mistake. The Second Part : I've made a script in the past days experiencing The "setWeaponProperty"
  21. Yeap, thanks it worked.
×
×
  • Create New...