Jump to content

Dev

Members
  • Posts

    127
  • Joined

  • Last visited

Everything posted by Dev

  1. Dev

    [SOLVED] PHP SDK

    Ah yea, works now! thanks mate. I thought the html and body tags were necessary.
  2. Dev

    [SOLVED] PHP SDK

    Hey, So, I've been trying to make this example work on the wiki page for PHP SDK, I have Apache 2.2 and PHP 5.3 installed and successfully running on my PC, I also have the PHP SDK files in my htdocs folder of Apache along with this new call.php file I just created, but for some reason it is only returning 'nil'. If someone has any idea or past experiences with SDK, please help me out. -- call.lua function result(sum) if sum ~= "ERROR" then outputDebugString(tostring(sum)) end end function phpCall( ) callRemote ( "localhost:80/call.php", result, 12, 16 ) end addCommandHandler("call", phpCall) // call.php <html> <body> <?php include( "mta_sdk.php" ); $input = mta::getInput(); mta::doReturn($input[0] + $input[1]); ?> </body> </html>
  3. That's cool, nice job! will it be available at community resources?
  4. Dev

    [HELP] dbPoll

    Paste your /debugscript, also if possible give us a screenshot of your database.
  5. Dev

    team color

    Are you using a custom nametag resource or default MTA nametags?
  6. This one will come in handy!
  7. You can use this code, however the co-ordinates I have placed in 'theCoordinates' table are just imaginary, you will have to replace them with your own. local theCoordinates = { [1] = { a, b, c } [2] = { d, e, f } [3] = { g, h, i } [4] = { j, k, l } } local lastCoordinate = nil function getRandomCoordinate( ) local index = tonumber( math.random( 1, 4 ) ) if ( index ~= lastCoordinate ) then lastCoordinate = index local x, y, z = unpack( theCoordinates[ index ] ) return x, y, z else getRandomCoordinate( ) end end
  8. Sorry, your code is wrong too laserlaser. function seatBeltOn( player ) local check = getPedOccupiedVehicle ( player ) if ( check == true ) then local beltOn = getElementData( player, "seatbelt" ) if ( not beltOn ) then setElementData( player, "seatbelt", true) exports.global:sendLocalMeAction( player, "puts their seatbelt on.") else setElementData( player, "seatbelt", false) exports.global:sendLocalMeAction( player, "takes their seatbelt off.") end elseif ( check == false ) then outputChatBox("You are not in a car!", player, 255, 0, 0 ) end end addCommandHandler("seatbelt", seatBeltOn)
  9. Dev

    Unique ID

    If you wish to permanently delete it from the database you will have to execute an SQL query to the database for the removal of the row which holds the vehicle's data. Something like this, if you're using the vG/Vedic script. local mysql = exports.sql function deleteVehicle( thePlayer, commandName, vehicleID ) if ( vehicleID ) then local vehicleID = tonumber( vehicleID ) local didFind = false for key, theVehicle in ipairs ( getElementsByType("vehicle") ) do if ( tonumber( getElementData( theVehicle, "id" ) ) == vehicleID ) then destroyElement( theVehicle ) didFind = true break end end if ( didFind ) then local delete = mysql:query_free("DELETE FROM `vehicles` WHERE `id`=".. mysql:escape_string( tostring( vehicleID ) ) .."") if ( delete ) then outputChatBox("The vehicle was successfully deleted!", thePlayer, 0, 255, 0) else outputChatBox("MySQL Error!", thePlayer, 255, 0, 0) end else outputChatBox("Couldn't find vehicle with ID ".. vehicleID, thePlayer, 255, 0, 0) end else outputChatBox("SYNTAX: /".. commandName .." [ Vehicle ID ]", thePlayer, 255, 194, 14) end end addCommandHandler("delveh", deleteVehicle, false, false )
  10. Nope, like you said, trigger a server side event from client side to use the giveWeapon and takeWeapon functions.
  11. Dev

    Car names

    Ah nice, you can also use dxDrawText instead of outputChatBox to show the vehicle name on player's screen.
  12. Dev

    explosion

    You cannot put them later if you're creating the marker on script start.. if you wish to put them later, you need to place the createMarker function within an event and then provide the variables to it upon event trigger.
  13. Dev

    [HELP]isPedDead

    function createCriminal( res ) criminal5 = createPed( 28, 293.54177856445, -147.95318603516,1004.0625, -90 ) setElementFrozen( criminal5, true ) end addEventHandler("onResourceStart", resourceRoot, createCriminal) function checkKills( _, thePlayer ) if ( source == criminal5 ) then givePlayerMoney( thePlayer, 1000 ) end end addEventHandler("onPedWasted", root, checkKills) There, I changed it all to server-side.
  14. Dev

    explosion

    What error does it output? are you actually providing correct values to the posx, posy, posz vars?
  15. Dev

    Car names

    You cannot actually change the vehicle's name, but you can set an element data which will store the vehicle's modified name, and when someone gets in the vehicle, you can use outputChatBox to tell them the new name.
  16. I'm sick of people asking for my edit of vG script every other day. -.-
  17. Wow, this is good news, I've always been a fan of GTA:VC, let's hope you guys keep pushing forward with this project.
  18. Dev

    Help

    You didn't put any code to toggle the value of 'status'.
  19. I don't really think any of MTA's older or coming releases had or would have any effect on the FPS, it's mostly similar to single player.
  20. Looks like an interesting gamemode idea, good luck with it.
  21. Lonely's code probably fixed it.
  22. Dev

    Flash MTA Game

    Haha'.. looks nice.
×
×
  • Create New...