Jump to content

NeXTreme

Members
  • Posts

    117
  • Joined

  • Last visited

Everything posted by NeXTreme

  1. I really wonder where you "took some of the code from", since none of my public resources have this sort of code in them.
  2. Aww. Another thing you can try then is change both scripts: Client-side function Scripting () triggerServerEvent("spawnPed", getLocalPlayer(),getLocalPlayer()) end Server-side function spawnPed (player) local x,y,z = getElementPosition (player) pedio = createPed (0, x-2, y+2, z) end addEvent("spawnPed", true) addEventHandler("spawnPed", getRootElement(),spawnPed)
  3. I guess your problem is in the server-side part, I don't usually work with the source variable in events, but.... function spawnPed () -- No "source" in the function parameters here local x,y,z = getElementPosition (source) pedio = createPed (0, x-2, y+2, z) end addEvent("spawnPed", true) addEventHandler("spawnPed", getRootElement(),spawnPed)
  4. Solved my problem. I encoded the PHP script file in ANSI, previously it was encoded in UTF-8. Try to do the same with that file of yours and see if it works
  5. Ports work fine for me, and I'm using MTA 1.3. I don't know why it would work on 1.2 and not on 1.3, unless you maybe changed some settings in your router. Oh and, as for checking if your port is open... I'd suggest you use PortForward.com's checker, it was the only thing that accurately showed me if my port is open. http://portforward.com/help/portcheck.htm
  6. I've made a new PHP file called "test.php" and put just a mta::doReturn in there, and it worked, it returned what it was supposed to. Funny thing is, I have this same code in the non-working script (with all other stuff commented out), and it doesn't return anything from there. WTF?
  7. I don't know about the webhost, I have a couple other scripts that work perfectly.
  8. NeXTreme

    Some mathz

    I don't know, I'd say no I guess.
  9. Well just happens I'm working with callRemote also, and my PHP script returns nil, like yours, no matter what the code is, and my only include is the MTA SDK. Go figure.
  10. I have no idea what you want, try to explain it better?
  11. Ah well I've solved the problem. It was a function that kept calling itself (which usually results in an error somewhat similar to to "too long execution, aborting script", I forgot how exactly it goes.). I guess that error message got me confused and I didn't really check the code well enough.
  12. Well if there's another resource that intercepts chat messages, these two resources will both output a message by themselves (they don't know the other resource has already cancelled the chat event). If you want to get around this, I'd suggest you add the code from this chat filter to the freeroam resource, and make it filter the chat there.
  13. NeXTreme

    Some mathz

    You could use a matrix to do this on client side However, you could also do this: -- "vehicle" is the car that hit your marker -- "marker" is the marker that got hit (obviously) px,py,pz = getElementPosition(vehicle) rx,ry,rz = getElementRotation(vehicle) rz = rz -- change this to "rz = rz + 180" if you wish to move the marker to the other side of the car distanceFromVehicle = 7 -- how far away from the vehicle should the marker be mx = px + math.cos(math.rad(rz)) * distanceFromVehicle my = py + math.sin(math.rad(rz)) * distanceFromVehicle mz = pz setElementPosition(marker,mx,my,mz) Probably not the best code, but it should get the job done
  14. Well I tried out your PHP script on my server (just the "test.php"), and I get an error Fatal error: Call to undefined function config_get() in /home/whocares/public_html/MTA/test.php on line 370 So it's either just me missing an include or whatever, or it's also on your side As far as my PHP knowledge goes, I think this should work.
  15. Yeah hi, so do you have any other resource that might "intercept" chat messages? Like anti-spam?
  16. This isn't so much of a help request, I'd just like to know what causes this error, if anyone knows. Happens whenever I click a GUI button in my script (and no, there aren't any intesive operations in the function it triggers, just an outputChatBox), also when I restart the resource my screen freezes for a second or two, and If I stay alt-tabbed out of MTA for a few minutes, my GTA just throws a runtime error and crashes. Cheers.
  17. Yeah I realize that. I just attempted to fix the problem, not create a working script
  18. Uhm, yeah... function rndColors() local color = {} color[1] = math.random(0,126) color[2] = math.random(0,126) color[3] = math.random(0,126) color[4] = math.random(0,126) setVehicleColor ( theVehicle, color[1], color[2], color[3], color[4] ) outputChatBox( "Enjoy the PARTY!", source, 0, 255, 0 ) end function makeTimer(player,command) theVehicle = getPedOccupiedVehicle( player ) if ( theVehicle == false ) then outputChatBox ( "Get into a vehicle first!", player, 255, 50, 0, true ) else setTimer( rndColors, 100, 1 ) outputChatBox ( "You are in vehicle!!", player, 255, 50, 0, true ) end end addCommandHandler(" discovehicle", makeTimer ) Thar?
  19. Uhm yeah it's kinda hard for us to help if you post just one line of code?
  20. I use fileDelete method alot, and seems to work just fine. Here's the "tutorial" about it viewtopic.php?f=148&t=36847
  21. Hey. I have a bunch of SQL queries the server performs when saving data. Problem I'm having is some data might have a character like ' or " in the query, so the query will fail. I also don't want to use the executeSQLQuery's escaping system, those question mark things. What characters are actually being escaped in these SQL queries? I'd like a function for it, but I don't know which characters to escape Regards, NeXTreme
  22. NeXTreme

    Nitro shader

    Your answer should be here viewtopic.php?f=91&t=39542
  23. triggerServerEvent() addEvent() addEventHandler() That's what ya need. I'm not writing the whole code for you though
  24. NeXTreme

    SQL question

    So this is SQLite I guess? If you know which columns you have duplicate: executeSQLQuery("DELETE FROM tableName WHERE forSale='yes' AND owner='Dave' LIMIT 1") The "LIMIT 1" is the key here, it limits the query to affect only one row This is what I know from MySQL, I don't know if it will work with SQLite also, I don't use it.
×
×
  • Create New...