-
Posts
1,491 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Walid
-
function onWasted() local account = getPlayerAccount(source) if account and not isGuestAccount(account) then local jailtime = getAccountData(account, "Jailtime" ) or 0 local theWeapon = getPedWeapon (source) local weaponAmmo = getPedTotalAmmo (source) if not tonumber(jailtime) or tonumber(jailtime) == 0 then outputChatBox ("1", root) fadeCamera (source, false) setTimer (spawnPlayer, 1000, 1, source, 1161.3000488281, -1376.0999755859, 4, 0, getPedSkin (source), 0, 0, getPlayerTeam(source)) setTimer (setElementHealth, 1500, 1, source, 10) setTimer (setCameraTarget, 1250, 1, source, source) setTimer (fadeCamera, 2000, 1, source, true) setTimer (giveWeapon, 2000, 1, source, theWeapon, weaponAmmo, true) elseif tonumber(jailtime) > 0 then outputChatBox ("2", root) fadeCamera (source, false) setTimer (spawnPlayer, 1000, 1, source, 264.20001220703, 77.599998474121, 1001, 0, getPedSkin (source), 6, 1, getPlayerTeam(source)) setTimer (portjail, 1500, 1) setTimer (setElementHealth, 1500, 1, source, 10) setTimer (setCameraTarget, 1250, 1, source, source) setTimer (fadeCamera, 2000, 1, source, true) setTimer (giveWeapon, 2000, 1, source, theWeapon, weaponAmmo, true) end end end addEventHandler ("onPlayerWasted", getRootElement(), onWasted)
-
I create something like this in my server i don't know if it's possible to decompile it or not , it work with all file Format (.TXD, .DFF, .COL , .PNG , .JPEG etc ...)
-
testLineAgainstWater ()
-
Try sth like this function getValidID() local result = dbPoll(dbQuery(db, "SELECT ID FROM Vehicles ORDER BY ID ASC"), -1) newID = false for i, id in pairs (result) do if id["ID"] ~= i then newID = i break end end if newID then return newID else return #result + 1 end end
-
All what you need isPedInVehicle() -- To check if the player is currently in a vehicle. getPedOccupiedVehicle() -- Gets the vehicle that the player is currently in. getElementModel() -- Get the vehicle model ID getVehicleController() -- Get the controller (driver) of the vehicle
-
This is the simplest way to run MTA on Mac : Making Your Own Wrapper
-
You are using fileExists to skip downloadFile, but fileExists does not check the file content. downloadFile automatcially checks the existing file first, and will immediately trigger onClientFileDownloadComplete if download is not required.
-
All what you need getElementPosition() getGroundPosition()
-
1) Check your meta.xml file. 2) Check mods path. 3) Try using outputDebugString to see what the problem is.
-
try this local downloadFiles = { {"txd", "vehicles/tampa.txd", 549}, {"dff", "vehicles/tampa.dff", 549}, } addEventHandler( "onClientResourceStart", resourceRoot, function () for _, downFile in pairs( downloadFiles ) do downloadFile ( downFile[2] ) end end ) addEventHandler ( "onClientFileDownloadComplete", resourceRoot, function ( file, success ) if ( success == true ) then for _, downFile in pairs( downloadFiles ) do if ( file == downFile[2]) then local txdalp = engineLoadTXD ( downFile[2] ) local dffalp = engineLoadDFF ( downFile[2], downFile[3] ) engineImportTXD ( txdalp, downFile[3] ) engineReplaceModel ( dffalp, downFile[3] ) end end end end ) function checkIfPlayerAlreadyHasDownloaded() for _, downFile in pairs( downloadFiles ) do downloadFile ( downFile[2] ) end end addEventHandler("onClientPlayerSpawn",root,checkIfPlayerAlreadyHasDownloaded)
-
So the The solution is: 1) Remove fileExists(). 2) Always call downloadFile for files with download="false". 3) Only use the file after onClientFileDownloadComplete is triggered.
-
You are using fileExists to skip downloadFile, but fileExists does not check the file content. downloadFile automatcially checks the existing file first, and will immediately trigger onClientFileDownloadComplete if download is not required. Simply If you are only using downloadFile to download mod files after other resources, then do not use downloadFile, and instead set '-1' in the resource meta.xml
-
i don't recommend you to use DownloadFile "onClientPlayerSpawn". Read the note : This function may cause performance issues with client and/or server.
-
You don't need to use if source == vehicle then just attach the handler to the vehicle like this local vehicle = createVehicle(564, -2839.9,202,16.9) function vehicle_demage() outputChatBox("vehicle demaged") end addEventHandler("onVehicleDamage", vehicle, vehicle_demage)
-
Check this one: Call
-
@Bonus in your code Skin is not defined here
-
function onPlayerQuit ( ) local playeraccount = getPlayerAccount (source) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local playerskin = getElementModel (source) setAccountData (playeraccount, "player.skin", playerskin ) end end addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) function onPlayerLogin (_, playeraccount ) local playerskin = getAccountData ( playeraccount, "player.skin" ) if (playerskin) then setElementModel (source, tonumber(playerskin)) end end addEventHandler ( "onPlayerLogin", root, onPlayerLogin )
-
do it by yourself. -- Functions getElementModel() getPlayerAccount() isGuestAccount() setAccountData() getAccountData() -- Events "onPlayerQuit" "onPlayerLogin"
-
Replace "onPlayerMarkerHit" with "onMarkerHit" .
-
it's only client-side not server-side. ???? so why you add the event handler here ???? are you sure that it's your code. addEvent("showClientMenuItem", true) addEventHandler("showClientMenuItem", getLocalPlayer(), showClientMenuItem)