SDK
Members-
Posts
635 -
Joined
-
Last visited
Everything posted by SDK
-
Look at the example: https://wiki.multitheftauto.com/wiki/ExecuteSQLSelect You need to use result[1].playerHealth or result[1]["playerHealth"], not a number.
-
I accidentally left in the return part, I hope you removed it in your script? I tested it, and it worked, the objects always faced me with the same side. Post the whole thing you made.
-
Bandi, get out if you can't even put brackets behind your functions. function radio () local id = getElementModel(source) if (id== 411 ) then playSound("http://myradio.com/listen.pls") end end addEventHandler("onClientVehicleEnter", getLocalPlayer(), radio) And crc mismatch means something went wrong when downloading the file. Restart, check meta, remove strange characters from resource/script names.
-
I meant, what do the variables mean ... Anyway, try this local ex, ey, ez = hitX, hitY, hitZ -- 3D point that needs to be rotated local px, py, pz = getElementPosition(source) -- 3D point that needs to be rotated to local rotx = math.atan2 (pz - ez, getDistanceBetweenPoints2D ( px, py, ex, ey ) ) local roty = 0 local rotz = math.pi - math.atan2 ( ( ex - px ), ( ey - py ) ) rotx, roty, rotz = math.deg (rotx), math.deg(roty), math.deg(rotz) return setElementRotation(element, rotx, roty, rotz) createObject ( object, hitX, hitY, hitZ, rotx, roty, rotz )
-
IIRC you should use playSound ( "url" ). The new sound functions from 1.1 aren't documented properly yet, but there are some events already on the wiki: https://wiki.multitheftauto.com/wiki/OnClientSoundStream.
-
I'm not sure if it's possible. I know the rcg (rollercoaster generator) resource uses element parents when creating the map, but I believe that's because it's a running script together with the mapeditor. Edit: Tip: if you don't know how, look somewhere else. Take a look at the edf file of the ctf gamemode, it uses in combination with team elements.
-
I think I understand what you mean, but I don't get what the comments in your code mean. Try a + 180 in your createObject
-
That's all nice, but his script won't work, since you can't use markerhits when the marker is attached to something afaik.
-
change "passage destination" to "passage_destination"
-
Your code (well, 1 line) should work, but it could be that something else is interfering. Put the code and map in a separate resource to test it, disable the other stuff and see if it works.
-
You should try to use debug techniques on your scripts. Add outputChatBox(tostring(radar)) after the getElementByID line, see what it outputs. If it's "false", it didn't find the element, which means something is wrong between meta/script/map.
-
About time someone made it Nice work
-
Yes, thanks for stating the obvious. @Xdr About 2, I'm not sure what you meant and I never touched Pawn so I wrote something that could be wrong. Could you explain more'?
-
So you still have to create the objects yourself. What the map editor does is creating a visual representation of your mine, so mappers can easily put it somewhere. Then it stores all the necessary data (position and rotation) in the .map file. The objects shouldn't be in the .map file, since you can easily create them in your gamemode. So when you load the map with your gamemode, you load all the custom elements (and there position+rotation) and then create the visuals (objects) yourself.
-
1. Easy, functions work just like variables in Lua, and you can overwrite them locally. function setPlayerMoney () -- insert your variables you want in here, like "player" and "money" --insert your code end If you still want to use the original setPlayerMoney function, save it somewhere first: setPlayerMoneyOriginal = setPlayerMoney function setPlayerMoney ( player, addmoney ) local money = getPlayerMoney ( player ) setPlayerMoneyOriginal ( player, money + addmoney ) end 2. You can trigger your own custom event then: function a () local player = source triggerEvent ( "onCustomPlayerJoin", root, player ) end addEventHandler("onPlayerJoin", root, a ) function b (player) outputChatBox("Joined: " .. getPlayerName(player)) end addEvent ( "onCustomPlayerJoin" ) addEventHandler("onCustomPlayerJoin", root, b)
-
Hm, that's an unusual bug, won't be an easy fix I guess. It sounds like a clientside bug, but you're running it serverside. Try removing all non-essential code, like creating dummy/destroying the blip/passenger part/health sync, and test it again. Option 2: instead of moving the player in the vehicle and creating a dummy ped, you could do/try it the other way around. Put a ped in the vehicle, and make it remote controlled. The_GTA made a script for that a while ago. (It's for controlling other players, but that shouldn't be a problem since players are ped's)
-
Also: [ code=text]: local smiley = " " [ code=lua]: local smiley = " " [ lua]: local smiley = " \"{SMILIES_PATH}/icon_cool.gif\" alt=\"\" title=\"Cool\" /> "
-
Oh right, I missed that line, but it still won't work. First, user is probably a string with the irc user's nick. Second, that command is most likely an admin-only command, so you'll have to work around that. Your best options are to either somehow export the race function to set the nextmap or to write your own nextmap script.
-
But, objects (players) can be in multiple groups. You should check if the player's account is in a group using isObjectInACLGroup, and give priority to the most important one.
-
Replace getThisResource() with getResourceFromName("race") (And you do know you're not doing anything with the found map in this script, right? I mean, it won't be "set next")
-
And findMap() is ... ?
-
Yup, that one is wrong. Clientside outputChatBox has no visibleTo param.
