SDK
Members-
Posts
635 -
Joined
-
Last visited
Everything posted by SDK
-
Almost, param doesn't exist in your script (you just copied it from the wiki) function soundStart() sound = playSound3D("music.mp3", 253.234375, -1784.283203125, 4.2362642288208, true) setSoundMinDistance(sound, 10) setSoundMaxDistance(sound, 20) if sound then outputDebugString("3D Created successful", 3) else outputDebugString("Error creating 3D", 1) end end addEventHandler("onClientResourceStart", resourceRoot, soundStart) You're confused by the wiki example, it could be also done this way: mindistance = 10 maxdistance = 20 function soundStart() sound = playSound3D("music.mp3", 253.234375, -1784.283203125, 4.2362642288208, true) setSoundMinDistance(sound, mindistance ) setSoundMaxDistance(sound, maxdistance ) if sound then outputDebugString("3D Created successful", 3) else outputDebugString("Error creating 3D", 1) end end addEventHandler("onClientResourceStart", resourceRoot, soundStart)
-
That doesn't change anything bandi. Maybe you should try to move the script to clientside and use onClientPlayerWeaponSwitch, it could be more accurate then. Or onClientPlayerWeaponFire.
-
There's a small typo in the last function, keynames and keyNames need to be the same.
-
First idea already exists, it even works for checkpoints and vehicle pickups too. It's not added to the map editor gui tho, so you'll have to edit the .map file yourself. Take a look at the .map section here: https://wiki.multitheftauto.com/wiki/Resource:Race. It could be added to the gui if someone feels like it. About the settings, that's more a bug then a feature. And I believe it's already fixed in 1.1 resources, arran probably knows more about that.
-
Be more clear, what's the exact problem? + errors in debugscript 3 If you want to "delete" vehicles, use destroyElement, not blowVehicle.
-
https://wiki.multitheftauto.com/wiki/DxC ... reenSource
-
textitem = textCreateTextItem('', 0.5, ypos+1, 'medium', 255, 0, 0, 255, 3.0, 'center', 'center', 128) If you checked the textCreateTextItem wiki you should notice that x and y need to be between 0 and 1. ypos + 1 is bigger then 1.
-
Eh, maybe tell us what the problem is? And don't say "Don't work :("
-
To check, you'll need a loop: function checkPlayerMuted ( thePlayer ) for k, player in ipairs(muted) do if player == thePlayer then return true end end return false end To disable the chat (=muted), cancel the onPlayerChat event if the player is in the table: function checkMute ( ) local player = source if checkPlayerMuted ( player ) then cancelEvent() end end addEventHandler("onPlayerChat", root, checkMute)
-
Here are the playSoundFrontEnd hooks in race: http://code.google.com/p/mtasa-resource ... er.lua#362 race_server.lua, line 365-368 edit: Race is a complicated gamemode If you want a custom sound to be played, it would be like this: g_RaceStartCountdown:addClientHook(3, 'playSound', "three.mp3") g_RaceStartCountdown:addClientHook(2, 'playSound', "two.mp3") g_RaceStartCountdown:addClientHook(1, 'playSound', "one.mp3") g_RaceStartCountdown:addClientHook(0, 'playSound', "go.mp3")
-
What did you change beside the numbers Axel? ... @Krayzee, your script will spawn players when they join the server, not when (re)starting the resource. Try this, it will loop through all players and spawn them at that position when the resource starts: function resStart() local x, y, z = 1959.55, -1714.46, 10 for _, player in ipairs( getElementsByType ( 'player' ) ) do spawnPlayer(player, x, y, z) fadeCamera(player, true) setCameraTarget(player, player) outputChatBox("Script Testing", player) end end addEventHandler("onResourceStart", getResourceRootElement(), resStart)
-
Well, the error is pretty obvious isn't it? You have a bad argument in getElementModel, which means theVehicle isn't a vehicle. Post the code where you define "theVehicle". Also, your ifthenelse should be like this: skinid = getElementModel(player) carid = getElementModel(theVehicle) if skinid==280 or skinid==281 or skinid==282 and carid==596 or carid==598 or carid==597 and isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "police" ) ) then outputChatBox ("REMEMBER: This is a government car.") else setPlayerWantedLevel ( source, 4 ) outputChatBox ("You rob a Police car! A 4-level star has been given to you.") end
-
Use /debugscript 3 function hideJack(player,command,who,...) local targetPlayer = getPlayerFromName ( who ) if targetPlayer then local message = table.concat({...}, " ") outputChatBox(getPlayerName(targetPlayer ).."#EBDDB2: "..message ,root,255,255,255,true) end end addCommandHandler("yaziasda",hideJack)
-
https://community.multitheftauto.com/?p=resources ... ls&id=2676 Trials resource from Dakilla, just reuploaded
-
I think it's main feature is that it creates a new local scope, look at the examples here: http://lua-users.org/wiki/ScopeTutorial
-
You need a timer for that, you can't just put them behind each other.
-
That category is useless, since it also includes functions/events that weren't changed in 1.1. The list Arran made is way better.
-
It looks like the "Default" acl got renamed to "Owner", but it didn't change in the groups. Try changing it back to "Default"
-
There's also a resource with some effects that has fire: https://community.multitheftauto.com/index.php?p= ... ls&id=1292
-
That may be a bug in the map editor tho, try saving and reloading the map after you moved the pickup and check the .map file if the coords change. Also try updating your editor.
-
I think you need to specify the weapon ID (flowers = 14).
-
Assuming you can find the playername without passing all the command arguments to findPlayer: function pushim (thePlayer, commandName, namepart, ammount) player = findPlayer(namepart) if not player then outputChatBox("* /push: player not found", thePlayer) elseif isPedInVehicle(player) then local vehicle = getPedOccupiedVehicle(player) x,y,z = getElementVelocity(vehicle) if tonumber(amount) then amount = tonumber(amount) - 1 else amount = 0 end z = z + 0.10 + 0.20 * amount setElementVelocity ( vehicle, x, y, z ) outputChatBox( getPlayerName(thePlayer).. " Push " ..getPlayerName(player), getRootElement(), 255, 255, 0, true) end end addCommandHandler("push", pushim) function findPlayer(namepart)
-
You can also use the ALTER statement in executeSQLQuery http://www.w3schools.com/sql/sql_alter.asp
-
Hm, probably. Try this, I changed your line 17 and a small error on line 14 http://pastebin.com/SbB93gzp
-
If you know how to setup a normal server it will be easy, just stop the current gamemode and start the "editor" resource.