Jump to content

botanist

Members
  • Posts

    613
  • Joined

  • Last visited

Everything posted by botanist

  1. That will get the local time of the client, isn't it? Or does it gets the servertime? An easier question isn't possible lol
  2. You want to disable commands and messaging? Just use the toggleControl function to completely disable the chatbox. toggleControl ( "chatbox", false ) Set that to true, and it will allow you to use the chatbox again.
  3. WHUTTEFUK? Using serverside function handlers while using the getLocalPlayer function too? Wtf, what do you want to use, a client or serverside script? Tell me what you want, and I could easily help you.
  4. You don't need to do that, because that's already what I've made. Explanation: On the top of the script we got isSoundPlayer = false, this will mean when a player joins, he doesn't have to hear the sound. After flying and get a speed higher than 230 units (Which we check here: getVehicleSpeed ( getPedOccupiedVehicle ( localPlayer ) ) >= 230 ), we are looking to that boolean again if it's still false: if (...) isSoundPlayed == false then If it's still false, the script will be passed. There will the sound be played, and the boolean will be set to true, which means we played the sound. isSoundPlayed = true If the player is flying less than 230 units, we would pass the "else" statement, and that will check if the boolean we used is set to true. If so, we set it to false. And since this event is triggered everytime your game renders ( Amount of renders in 1 second = FPS, that may sound familiar ), we are checking your speed also enough times. You should do what varez said, stopping the sound. I never worked with sounds, so that's the reason why I forgot that to place in the script I've made And I'm bored at the moment, so here it is all ready: local localPlayer = getLocalPlayer ( ) local isSoundPlayed = false local knallSound = nil --nil means literally "nothing", or "empty". addEventHandler ( "onClientRender", getRootElement ( ), function ( ) if isPedInVehicle ( localPlayer ) and getVehicleType ( getPedOccupiedVehicle ( localPlayer ) ) == "Plane" then if getVehicleSpeed ( getPedOccupiedVehicle ( localPlayer ) ) >= 230 and isSoundPlayed == false then knallSound = playSound ( "files/knall.mp3" ) isSoundPlayed = true --You can add here some more stuff if you reached 230 KM/H. else if isSoundPlayed == true and isElement ( knallSound ) then isSoundPlayed = false stopSound ( knallSound ) end end end end ) function getVehicleSpeed ( vehicle ) local vx, vy, vz = getElementVelocity ( vehicle ) return math.sqrt ( vx^2 + vy^2 + vz^2 ) * 161 end Should really give no problems. @ varez below: solved.
  5. local localPlayer = getLocalPlayer ( ) local isSoundPlayed = false addEventHandler ( "onClientRender", getRootElement ( ), function ( ) if isPedInVehicle ( localPlayer ) and getVehicleType ( getPedOccupiedVehicle ( localPlayer ) ) == "Plane" then if getVehicleSpeed ( getPedOccupiedVehicle ( localPlayer ) ) >= 230 and isSoundPlayed == false then local sound = playSound ( "files/knall.mp3" ) isSoundPlayed = true --You can add here some more stuff if you reached 230 KM/H. else if isSoundPlayed == true then isSoundPlayed = false end end end end ) function getVehicleSpeed ( vehicle ) local vx, vy, vz = getElementVelocity ( vehicle ) return math.sqrt ( vx^2 + vy^2 + vz^2 ) * 161 end I didnt test that, but it should work. Besides that, you script was totally wrong Too much to explain so early in the morning
  6. Well, the problem is that that's exactly the point I already know Now I need to get the rotation of some surface, so I can place an object perfectly aligned to it.
  7. Simple question, difficuilt answer lol.. I know it's possible, because the Grapple recourse uses it too, but I can't figure out how to do the job. I want to calculate the face of some pointed wall, so I would be possible to place an object to it, perfectly iligned to the wall. Since the Grapple resource can do it (Your player will always be flat to some wall), and I don't know how Grapple did it (Well, a little bit. But there's no explanation in that script, so I don't know what to use and what not.) I wanna ask how I can do this myself. Anyone has a simple example for me? Or even a fully working math?
  8. Triple HD 5970 in your system? Hmm. I like that idea too. I'm 16 But I'm personally too lazy for this. I'm already getting bored of small, nonworking scripts. Although 1500$ is tempting me . But I do not believe him. Why paying 1500 when you can learn scripting on your own? In my eyes, 1500$ is too much to be serious for just a MTA server. You'll never get that money back out the server, no matter how much you advertise it. Or you need to get EVERY SA:MP player to MTA, and let them all donate. Can we see some proof of your money so we know this is not fake? Imagine someone is taking the job, and you promise him he'll get the money when he's done. At the moment he's done, he gives you the script, and you are gone without paying money. That's what I think here, unless you give us some proof.
  9. Select the middle of an arrow ( So the middle of 3 points ). With that point you can move and rotate objects. Press and hold CTRL to choose a rotation key, which are the arrow keys and "page up" + "page down".
  10. That's the old RCG. Try the new one Besides that, you need to start your server from windows, and then writing "start rcg" in the console that appears. Now join your server with MTA.
  11. Dude, those maps maps are awesome! Though I personally don't like the DM/DD idea, I like them more as racemaps with ghostmode enabled. 5/5
  12. Thnx, getResourceConfig works. But wtf. I'm on a different PC now, I tried xmlLoadFile ("vehicles.xml") and that still works. And zones.xml still doesn't. BUT, xmlLoadFile ("playerutils/zones.xml") DOES work here, so maybe this all was a MTA or Win7 bug? It's strange, but it works.
  13. Well, the streaming limit isn't the real big problem. MTA supports 250 objects streamed in per player, this includes custom placed models because they are still object elements. Besides that: Watch your polycount. San Andreas can handle a lot of polys for vehicles, but that's really different for objects. Too many polys per object/collsision will crash the RenderWare engine of San Andreas. Keep the polycount of your collisions below 6000 per object. San Andreas can handle 8000 maximum, but it's better to use less than that. I forgot how many polys you could use in your DFF files, but this was MUCH higher than the max polycount for collisions.
  14. impossible? I can screen it if you want But here is the zones.xml: <root> <group type="Airports"> <tele name="Los Santos Airport" posX="1647" posY="-2237" posZ="155" /> <tele name="Las Venturas Airport" posX="1266" posY="1324" posZ="12" /> <tele name="San Fierro Airport" posX="-1362" posY="-247" posZ="14" /> </group> <group type="Stuntified streets and cities"> <tele name="Grove Street" posX="2495" posY="1690" posZ="14" /> <tele name="San Fierro Building Jump" posX="-2210" posY="1252" posZ="87" /> </group> </root>
  15. Well, if I need to call the XML from the playerutils folder, how is it then ever possible that vehicles.xml does work? That's kinda strange to me. And I tried placing the XML files in the root folder, but even then the zones.xml won't work, while vehicles.xml and all others does work
  16. Hmm, EVERY script works, they all use the same technique. But this one doesn't work, and I don't know why. xmlLoadFile( "zones.xml" ) That will return false. But IT IS placed in the meta: <config src="playerutils\zones.xml" type="client" /> While this one is returning true, and works: xmlLoadFile( "vehicles.xml" ) <config src="playerutils\vehicles.xml" type="client" /> Both XML files are using the same syntax: <root> <group type="Fruit"> <food name="Strawberry" color="Red" /> <food name="Banana" color="Yellow" /> </group> </root> So, what the hack is the problem?
  17. No-hooh, I'm not converting it to a number. Damn, I'm not completely that dumb as you might think. But thanx anyway, it works now. I don't know what's different from first, I don't what caused the problem, and I don't know what fixed it.. WTF again, but now it isn't a problem anyomore.
  18. Using their names like guiGridListSetItemData(... , name ) doesn't work either.
  19. And what if I tell you it still doesn't work by just using player? That's why I don't know the problem, I tried it already.
  20. Well, with or without tonumber, it doesn't work. But I use the same system to build weather, weapon, skin and animation gridlists, with almost the same code, and they all work. The only difference is that they work with XML files and the warpto with getElementsByType. So I still don't know the problem.
  21. Forgot to mention that, but it wouldnt be too hard by considering about this: getLocalPlayer ( ), isn't it? And the error is described the second script, it always returns me the error message. --.... Blah if selected then triggerServerEvent ( "warpMeTo", getLocalPlayer ( ), selected ) else outputChatBox ( "Error while warping you." ) -- Always returns this end end
  22. local thisPlayer = getLocalPlayer ( ) function populateWarpToGridlist ( ) -- Populating and showing the gridlist with all the players inside guiGridListClear ( GUIPopupGrid_Grid ) guiSetText ( GUIPopupGrid_Window, "Warp To" ) for _,player in ipairs ( getElementsByType ( "player" ) ) do local row = guiGridListAddRow ( GUIPopupGrid_Grid ) local name = getPlayerName ( player ) guiGridListSetItemText ( GUIPopupGrid_Grid, row, 1, name, false, false) guiGridListSetItemData ( GUIPopupGrid_Grid, row, 1, tostring ( player ) ) end showGridlistGUI ( ) setElementData ( thisPlayer, "PopupType", "warpto" ) end That clientscript looks fine to me. It builds up all players, without faults. But, I cannot warp to them by doubleclicking someone. The itemdata seem to give always an error. local row, col = guiGridListGetSelectedItem ( GUIPopupGrid_Grid ) local selected = guiGridListGetItemData ( GUIPopupGrid_Grid, row, col ) if getElementData ( thisPlayer, "PopupType" ) == "warpto" then selected = tonumber ( selected ) if selected then triggerServerEvent ( "warpMeTo", getLocalPlayer( ), selected ) else outputChatBox ( "Error while warping you." ) -- Always returns this end end But it's the same technique as all my other gridlists, and they all work, except this one. WHY?
×
×
  • Create New...