Jump to content

WzKhalifa

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by WzKhalifa

  1. Well what the script below does is simple, if the (crim) out he pays the police, holding the criminal and informs the police, the more he can not hold the player as he left the game, will be whether to keep some of the cache the (crim) soon after he left? if ( not isElement ( crim ) ) then -- If the criminal then log out givePlayerMoney ( cop, 4999 ) -- Pay cash the police exports['VDBGPolice']:jailPlayer ( crim, 900, false, cop, "Police Arrest" ) -- Here he holds criminal for 900 seconds, more as it turned out, can not exports['VDBGMessages']:sendClientMessage ( "The player you have held out and you will $ 5000,00", cop, 0, 255, 0 ) -- Inform the police who handcuffed the criminal end Function that holds the player in the script (VDBGPolice) local jailedPlayers = { } function isPlayerJailed ( p ) if ( p and getElementType ( p ) == 'player' ) then if ( jailedPlayers[p] ) then return tonumber ( getElementData ( p, 'VDBGPolice:JailTime' ) ) else return false end end return nil end function jailPlayer ( p, dur, announce, element, reason ) if( p and dur ) then local announce = announce or false jailedPlayers[p] = dur setElementInterior ( p, 0 ) setElementDimension ( p, 33 ) setElementPosition ( p, 2232.94, -1055.15, 655.27 ) setElementData ( p, 'VDBGPolice:JailTime', tonumber ( dur ) ) setElementData ( p, "isGodmodeEnabled", true ) exports['VDBGJobs']:updateJobColumn ( getAccountName ( getPlayerAccount ( p ) ), 'TimesArrested', "AddOne" ) if ( announce ) then local reason = reason or "Classified" local msg = "" if ( element and reason ) then msg = getPlayerName ( p ).." has been jailed by "..getPlayerName ( element ).." for "..tostring ( dur ).." seconds ("..reason..")" elseif ( element ) then msg = getPlayerName ( p ).." has been jailed by "..getPlayerName ( element ).." for "..tostring ( dur ).." seconds" end exports['VDBGMessages']:sendClientMessage ( msg, root, 0, 120, 255 ) exports['VDBGLogs']:outputPunishLog ( tostring ( msg ) ) end triggerEvent ( "onPlayerArrested", p, dur, element, reason ) triggerClientEvent ( p, "onPlayerArrested", p, dur, element, reason ) return true end return false end or create some function within the first script like this informing time setElementData ( p, 'VDBGPolice:JailTime' stating the value too, more like I'm starting my knowledge in lua get lost
  2. So I spent the wrong function, it is here, try to add a onPlayerQuit in onMarkerHit region, for both work together when the player pass the marker, and the prisoner and reconnect the onPlayerQuit function into action .. this script is client-side local locs = { { 1549.45, -1718.64, 13.86 } } local e = { ['blip'] = { }, ['marker'] = { } } addEvent ( "onPlayerStartArrested", true ) addEventHandler ( "onPlayerStartArrested", root, function ( p, c) if ( c == localPlayer ) then for i, v in ipairs ( locs ) do local x, y, z = unpack ( v ) e['marker'][i] = createMarker ( x, y, z - 1, "cylinder", 1.8, 0, 120, 255, 120 ) e['blip'][i] = createBlip ( x, y,z, 30 ) addEventHandler ( "onClientMarkerHit", e['marker'][i], function ( p ) if ( p == localPlayer ) then for i, v in pairs ( e ) do for i, v in pairs ( v ) do if ( isElement ( v ) ) then destroyElement ( v ) end end end triggerServerEvent ( "vdbgpolice:onJailCopCrimals", localPlayer ) end end ) end end end )
  3. I need to put the onPlayerQuit function to the player go to jail, I've tried everything, more unable, someone help? function jailPlayer ( p, dur, announce, element, reason ) if( p and dur ) then local announce = announce or false jailedPlayers[p] = dur setElementInterior ( p, 2 ) setElementDimension ( p, 33 ) setElementPosition ( p, 2559, -1291, 1032 ) setElementData ( p, 'VDBGJail:JailTime', tonumber ( dur ) ) setElementData ( p, "isGodmodeEnabled", true ) exports['VDBGJobs']:updateJobColumn ( getAccountName ( getPlayerAccount ( p ) ), 'TimesArrestedOfficer', "AddOne" ) if ( announce ) then local reason = reason or "Ter estrela." local msg = "" if ( element and reason ) then msg = getPlayerName ( p ).." Was arrested for "..getPlayerName ( element ).." by "..tostring ( dur ).." seconds ("..reason..")" elseif ( element ) then msg = getPlayerName ( p ).." Was arrested for "..getPlayerName ( element ).." by "..tostring ( dur ).." seconds" end exports['VDBGMessages']:sendClientMessage ( msg, root, 0, 120, 255 ) exports['VDBGLogs']:outputPunishLog ( tostring ( msg ) ) end triggerEvent ( "onPlayerArrested", p, dur, element, reason ) triggerClientEvent ( p, "onPlayerArrested", p, dur, element, reason ) return true end return false end
  4. This download function, is working just fine, however when the low player for the first time, he Substitutes vehicle, but when I log back in, it will not replace the texture, just wanted to ask for it to be replaced after downloading and when I log back in, and if possible put a dx stating that're on download
  5. So actually I wanted to ask script download files, and soon after he bring down, he replacing textures of vehicles just downloaded, and so the player to reconnect replace it again, and so the feature start also replace the textures help
  6. in the case was going to be like this? client finishes download + linking feature function onDownloadFinish ( file, success ) if success then local ID = modelID [ file ]; if ID then if string.find ( file, ".txd" ) then txd = engineLoadTXD ( file ); engineImportTXD ( txd, ID ); end if string.find ( file, ".dff" ) then dff = engineLoadDFF ( file, ID ); engineReplaceModel ( dff, ID ); end end end end addEventHandler ( "onClientFileDownloadComplete", getRootElement(), onDownloadFinish ) addEventHandler ( "onClientResourceStart", getRootElement(), onDownloadFinish )
  7. Remembering that he is saving the files ( 400.txd / 400.dff ), just is not replacing the vehicle model. Lines in the metafile:
  8. Help Help I got a DownLoadFile in the community. However need to put a DxDrawImage on the bottom during download, and when I have the onClientDownloadComplete it replaces the TXD, if I log back .. no longer works .. does not replace again, I feel that we have put onClientResourceStart filePath = { { "400.txd", 400 }; { "400.dff", 400 }; -- { "Arquivo", ID }; }; modelID = { }; function checkTransfer ( ) if isTransferBoxActive ( ) == true then setTimer ( checkTransfer, 1000, 1 ); else for i, v in ipairs ( filePath ) do local file, ID = v [ 1 ], v [ 2 ]; if not modelID [ file ] then downloadFile ( file ); modelID [ file ] = ID; end end end end addEventHandler ( "onClientResourceStart", resourceRoot, checkTransfer ); addEventHandler("onClientDownloadComplete", getRootElement(), function ( file, success ) if success then local ID = modelID [ file ]; if ID then if string.find ( file, ".txd" ) then txd = engineLoadTXD ( file ); engineImportTXD ( txd, ID ); end if string.find ( file, ".dff" ) then dff = engineLoadDFF ( file, ID ); engineReplaceModel ( dff, ID ); end end end end );
×
×
  • Create New...