Jump to content

myonlake

Members
  • Posts

    2,312
  • Joined

  • Days Won

    41

Everything posted by myonlake

  1. Functions setPedSkin outputChatBox isObjectInACLGroup Handlers addCommandHandler The Code function militarySkin() local account = getAccountName(getPlayerAccount(player)) if isObjectInACLGroup("user." .. account, aclGetGroup("Military")) then setPedSkin(player, 287) outputChatBox("You are now on duty as a Military Soldier!", player, 0, 255, 0, false) else outputChatBox("You must be in Military to use this command!", player, 255, 0, 0, false) end end addCommandHandler("mduty", militarySkin)
  2. Quickly and Simple + Easy Ty No problem, thank Castillo for telling me about this earlier
  3. Use this! http://mta.dzek.eu/vehicle/ After it's finished, you add the folder to your resources folder.
  4. Hey guys, How to force a reconnect to a specific player, I haven't found any specific functions on MTA Wiki, but I think this would be useful sometimes. This is a kind of script that they have in Valhalla, I have no idea how they managed to do that, but I could use this to resolve some annoying bugs with even if the player is AFK. Thanks
  5. Hello, I've got this annoying bug, F11 map not showing to me. Only the text/blips/areas are showed to me, but no map image. I have tried to look for the image file in MTA 1.1 folders, it was there, and it was in the right location I guess (the original), so what's up? Should I need admin privileges on the folders?
  6. Well, I got this far. function giveMoneyToTaxi(player, seat, jacked) local seat = getPedOccupiedVehicleSeat(player) local veh = getPedOccupiedVehicle(player) local occupants = getVehicleOccupants(veh) local driver = getVehicleOccupant(veh) taxi = {[420]=true, [438]=true} skin = {[253]=true, [255]=true} if (driver) and (taxi[getElementModel(source)]) and (not skin[getElementModel(player)]) and (not seat == 0) then givePlayerMoney(source) else return false end end addEventHandler("onPlayerVehicleEnter", rElement, giveMoneyToTaxi) 5, 6, 7, 8 lines doing errors. Don't tell me that it's a minor error now
  7. I suggest to run all the resources that you can find in the: MTA San Andreas 1.1\server\mods\deathmatch\resources\[web] If you don't yet have webpanel -resource, get it here: https://community.multitheftauto.com/index.php?p= ... ils&id=487 Now put that resource in the same folder as all the other web files. Run that resource too, now check your server IP address, for example: 88.888.888.888, now see your HTTP port, for example: 22005. Now open your web browser, put your server IP and the port to the URL bar like this: 88.888.888.888:22005 It will ask your admin account, now login, there you go! Make sure that all the [web] resources are allowed by the admin ACL.
  8. Hey again, I would like to know the functions that I would need to use to detect the driver seat player and mine. I would like to give the driver some money when I enter as a passenger. So, give me the functions and I'll try to fix my script. PS. What about the "toggleCameraFixedMode", it looks like to not be working anymore, what's the new one? No fix at Wiki. Thanks
  9. Hello guys, I am doing a little script that removes a value from the saved value. For example, I have saved 1000 dollars on my account, I want to delete one dollar by setAccountData, how is it made. I have tried to do a - 1, but it seems to not be working. setAccountData(playerAccount, "dollars" - 1, cash) Well, it does an error: attempt to perform arithmetic on a string value I know some of you are willing to help, but I don't want to hear those annoying words like: "are you serious?". I am not perfect, especially because I am tired right now. EDIT: By the way, can you give me any kind of functions/events I should use to make a one specific car to be locked. Not all of the cars or all of the same ID cars, I want a specific one car to be locked, should I use setElementData on a spawned car? Thanks
  10. Well, if it still doesn't work, the problem is that the team is not yet created. You must do.. createTeam("Hitmen", red, green, blue) red, green, blue are not needed, but if you want to change the color, then use them.
  11. myonlake

    Car Alarm

    EDIT 2: Fixed, added "source" there EDIT: Now it's doing an error with the "isVehicleLocked" -function. Oh, just found out the same thing myself Yeah, thanks anyways!
  12. And if you didn't understand it, it's this: createMarker(x, y, z, "cylinder", size, red, green, blue, alpha) -- Put alpha as 0 to put it as invisible marker
  13. myonlake

    Car Alarm

    Hello, I am trying to do a car alarm system, but it doesn't play the sound when I try to enter a locked car. Here's the client sided code (only client side). function beepClient(thePlayer) local playervehicle = getPedOccupiedVehicle(thePlayer) if isVehicleLocked(playervehicle) then local x, y, z = getElementPosition(thePlayer) local beep = playSound3D("beep.mp3", x, y, z, false) setSoundVolume(beep, 1.0) setSoundMaxDistance(beep, 100) end end addEventHandler("onClientVehicleEnter", getRootElement(), beepClient) I have set the file to the meta.xml and everything seems just fine, but this doesn't give up any error anywhere, and it just simply doesn't work. Maybe it's just a little thing that I cannot regonize right now.
  14. Notepad++ has it already. I am using ++ myself
  15. myonlake

    PlaySound3D

    Hey guys! Alright so, I have a script that uses PlaySound3D, which is attached to a car. So, the problem I have is that it's doing the voice so little distance, that nobody could hear it. So, any idea how to do it like, everybody in a radius of 20 would hear it? I thought of a isPlayerInRangeOfPoint and if you're in it, it would play the sound, but, not sure does it work.
  16. myonlake

    Vehicle ID

    Okay well, Thank you for helping me out with that one function. Tho it just throws me a bunch of bad arguments as I don't know what is that if I want to give every vehicle a ID. The code I made.. -- Do the vehicle ID function idVehicle(theVehicle) setElementID(theVehicle, math.random(1, 9999)) end addEventHandler("onVehicleRespawn", getRootElement(), idVehicle) -- Show the entered vehicle's ID function showVehicleID(theVehicle, sourcePlayer) local vehicle = getElementID(theVehicle) outputChatBox("* This vehicle's ID is: " .. vehicle, sourcePlayer, 220, 220, 0, true) end addEventHandler("onVehicleEnter", getRootElement(), showVehicleID) -- Warp the specified ID to a location (x, y, z) function warpVehicle(sourcePlayer, commandName, vehicle, posX, posY, posZ) local veh = getElementID(vehicle) setElementPosition(vehicle, posX, posY, posZ) outputChatBox("* Vehicle ID " .. veh .. " spawned.", sourcePlayer, 0, 255, 0, true) end addCommandHandler("warpid", warpVehicle)
  17. myonlake

    Vehicle ID

    Hello, Okay so, I am not sure what kind of functions I should use for this so I hope you'd help me with this. So my main idea is to make a script that makes a really own ID for a spawned vehicle. For example. I spawn a banshee, and it will have an ID 9000. I know this is kinda "copying" from vG, but this is really useful for admins to spawn a specific vehicle again. So, any idea how to do this? What kind of functions I should use.
  18. Right, thank you once again
  19. Hello, I am wondering, that what is that function that shows the player's name and health on their head. I would like to hide it completely.
  20. In that case you should do it with the marker's alpha and colors. https://wiki.multitheftauto.com/wiki/CreateMarker createMarker ( x, y, z, "corona", 0.4, 0, 0, 0, 0 ) Red: 0 Green: 0 Blue: 0 Alpha: 0 Should work properly. If not, change alpha to 1 or something.
  21. myonlake

    Join Handler

    Yes, just that, and if I'm right, there's a spawn script in the 'play' folder.
  22. You want to hide the corona or the object?
  23. Is there any kind of way to make the script understand disappeared vehicles. If I blow a car up, it starts giving me an error because the emergency lights were on, but the car is missing, so now it tells me the error. Now the big ASAP problem is that this spams the server, and if it spams alot, server crashes. So any help? So in another words: is there a script that disallows everything to destroy a vehicle without doing anything (disappearing just like that) OR is there a script that lets the script know that the car is missing and then it wouldn't spam the error. It says it's a bad element/vehicle pointer @ setVehicleLightState and setVehicleHeadLightColor. Now I do have few other scripts that make the lights bugged, so I have that setVehicleLightState on because of that. blueTimers = {} redTimers = {} function EmergencyLights1(source) local theVehicle = getPedOccupiedVehicle(source) if theVehicle then if getVehicleOverrideLights(theVehicle) ~= 2 then setVehicleOverrideLights(theVehicle, 2) blueTimers[theVehicle] = setTimer(setLight98, 400, 1, theVehicle) else setVehicleOverrideLights(theVehicle, 0) setVehicleHeadLightColor(theVehicle, 255, 255, 255) if isTimer(blueTimers[theVehicle]) then killTimer(blueTimers[theVehicle]) end if isTimer(redTimers[theVehicle]) then killTimer(redTimers[theVehicle]) end end end end function setLight98(car) setVehicleHeadLightColor(car, 0, 0, 255) setVehicleLightState ( car, 0, 0 ) setVehicleLightState ( car, 1, 0 ) redTimers[car] = setTimer(setLight99, 400, 1, car) end function setLight99(car) setVehicleHeadLightColor(car, 255, 0, 0) setVehicleLightState ( car, 0, 0 ) setVehicleLightState ( car, 1, 0 ) blueTimers[car] = setTimer(setLight98, 400, 1, car) end addCommandHandler("coloremergency", EmergencyLights1)
  24. Hello, Both were good examples but it's not respawning the cars, it's destroying them: disappearing just like that. So, toggleVehicleRespawn wouldn't help me right now. bandi94, it works, but the problem is that I don't know where the original timer is. I am not sure is it in the freeroam script or not. I'm gonna post an update here if something works.
  25. Hello, I am wondering, that does MTA have a script that automaticly destroys all idle vehicles that are used but left idle. I have downloaded the 'sv' script from community, and I found a timer of it to destroy vehicles. Well I removed it, no errors, everything worked normally. But something is still destroying my vehicles while they're idle. I am using the default freeroam -resource. Does it have this timer that destroys all idle vehicles? I mean... I am not using vehicles from freeroam 'create', I am using /sv command, but it still keeps destroying my idle vehicles, SO does the freeroam resource delete also all /sv idle vehicles or is there a bug or MTA that does it? PS. If I don't search the timers, is it possible to defuse the timer with some other resource that has some kind of script that defuses it. Or does it effect?
×
×
  • Create New...