Jump to content

Anubhav

Members
  • Posts

    2,277
  • Joined

  • Last visited

Everything posted by Anubhav

  1. Anubhav

    Server Load

    As he said. You'll need: downloadFile or fetchRemote to download files and those things.
  2. function startBlips ( button ) if ( button == spawnCar ) then local markerTableData = destinationCoords[math.random ( #destinationCoords )] local x = markerTableData[1] local y = markerTableData[2] local z = markerTableData[3] startMarker = createMarker ( x, y, z, "cylinder", 3, 255, 255, 51 ) startBlip = createBlipAttachedTo ( startMarker, 51 ) setElementVisibleTo( startBlip, root, false ) setElementVisibleTo( startBlip, source, true ) end end addEventHandler ("onClientPlayerVehicleEnter", getRootElement (), startBlips )
  3. Anubhav

    about ipairs

    No you can't afaik. Maybe you can but not realy sure.
  4. Anubhav

    Help SQL

    addEventHandler ( "onResourceStart", getResourceRootElement( getThisResource () ), function () connection = dbConnect( "mysql", "dbname=memo;host=127.0.0.1;port=3306;", "root", pass )
  5. You can try editing interiors resource if possible else you cannot.
  6. Hello baysapo mein. Yaha pa koy kuch bat nahi karta kya? isko mein chat and fun banata hu. --- kuck rules hein gande bath nahi bolna ache pash ana or mta forum rules bhi. MAZA KARO! danyawad
  7. How don't you know the ID? You can replace it with any vehicle ( dff and txd ) if its a vehicles else if its weapon replace it with any weapon ID u want.
  8. function onPlayerTargeted ( loss, thePlayer ) local object = getElementModel ( source ) if object == 18450 then local vehicle = getPedOccupiedVehicle ( thePlayer ) blowVehicle ( vehicle ) end end addEventHandler ( "onClientObjectDamage", root, onPlayerTargeted )
  9. function enterClubConfirmed( ) oldBalance = exports [ "bank-reloaded" ]:getBankAccountBalance ( "stolka" ) if not oldBalance then exports ["bank-reloaded"]:setBankAccountBalance( "stolka", 0) oldBalance = exports [ "bank-reloaded"]:getBankAccountBalance( "stolka" ) end outputChatBox(tostring(oldBalance)) exports [ "bank-reloaded" ]:setBankAccountBalance ( bankAccount, tonumber( oldBalance ) + 120 ) fadeCamera( player, true, 1.5 ) setElementDimension( player, 2 ) setElementInterior( player, 2 ) end addEvent( "onPlayerClubConfirm", true ) addEventHandler( "onPlayerClubConfirm", getRootElement(), enterClubConfirmed )
  10. addCommandHandler ( "staffchat", fuction ( thePlayer, _, ... ) if ( isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(thePlayer)), "staff" ) ) then for i, p in ipairs ( getElementsByType ( "player" ) ) do if ( isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(p)) "staff" ) ) then outputChatBox ( "[staff] ".. getPlayerName ( p ) ..": ".. table.concat({...}, " "), p, 0, 0, 120 ) end end end end ) If your nick wouldn't be acc could create problems.
  11. Anubhav

    Small help

    I fixed it myself thanks for help.
  12. Anubhav

    Small help

    Still same error. I meant that when I use that function it gives error. The ipair and node thingy gets boolean.
  13. setTimer( function() for k,v in ipairs(getElementsByType("player")) do if getTeamName(getPlayerTeam(v)) == "Staff" then setElementHealth(v, getElementHealth(v)+10) end end end, 1000, 0)
  14. Anubhav

    Small help

    function getResourceMaps(resource) local scripts = {} local resourceName = tostring(resource) local theMeta = xmlLoadFile(":"..resourceName.."/meta.xml") for i, node in ipairs (xmlNodeGetChildren(theMeta)) do if (xmlNodeGetName(node) == "map") then local script = xmlNodeGetAttribute(node, "src") if (script) then table.insert(scripts, script) end end end return scripts end xmlNodeGetChildren and ipairs got boolean all time. The resourceName is "play".
  15. function createTeamsOnStart () civilTeam = createTeam ( "Civilians", 0, 153, 0 ) criminalTeam = createTeam ( "Criminals", 255, 0, 0 ) end addEventHandler("onResourceStart", resourceRoot, createTeamsOnStart ) function becomeCivil ( thePlayer ) setPlayerTeam ( thePlayer, getTeamFromName(civilTeam) ) outputChatBox ("You are now a Civilian!",thePlayer,0, 153, 0 ) if ( civilTeam ) then toggleControl (thePlayer, "fire", false ) toggleControl (thePlayer, "aim_weapon", false ) else toggleControl (thePlayer, "fire", true ) toggleControl (thePlayer, "aim_weapon", true ) end end function becomeCriminal ( thePlayer ) setPlayerTeam ( thePlayer, getTeamFromName(criminalTeam) ) outputChatBox ("You are now a Criminal!", thePlayer, 255, 0, 0 ) if ( getTeamFriendlyFire ( criminalTeam ) == false ) then setTeamFriendlyFire (getTeamFromName(criminalTeam), true) end end addEventHandler("onPlayerDamage", root, function(a) if getTeamName(getPlayerTeam(a)) == "Criminals" and getTeamName(getPlayerTeam(source)) == "Civilians" then cancelEvent() end end ) function checkRestrictions( ) if getTeamName(getPlayerTeam(source) == "Criminals" then toggleControl ( source, "fire", true ) toggleControl ( source, "aim_weapon", true ) end end addEventHandler ( "onPlayerWeaponSwitch", getRootElement (), checkRestrictions ) addCommandHandler( "criminal", becomeCriminal ) addCommandHandler( "quitjob", becomeCivil )
  16. 1. No, the first one downloads first. 2. I don't know. 3. Yes.
  17. local replaceModel = 1 function infmod() if getElementData(source,"state") ~= "alive" then if replaceModel == 1 then replaceModel = 2 txd = engineLoadTXD("infernus.txd", 411) engineImportTXD(txd, 411) dff = engineLoadDFF("infernus.dff", 411) engineReplaceModel(dff, 411) elseif replaceModel == 2 then replaceModel = 1 engineRestoreModel ( 411 ) end end end addEvent ( "restoreClientModel", true ) addEventHandler ( "restoreClientModel", getRootElement(), infmod ) addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), infmod) bindKey ("F6", "down", infmod )
  18. Keep increasing then number then try.
×
×
  • Create New...