Jump to content

PARKAH

Members
  • Posts

    32
  • Joined

  • Last visited

Everything posted by PARKAH

  1. For example there is this ragdoll GTA 4 style mod, is it possible to put it on my server?
  2. For some reason my admin panel is being really buggy. I have no idea why and I can't do various things, is there a way I can reinstall it?
  3. PARKAH

    Modloader

    How does this help me?
  4. The skin doesn't matter because it loads fine just doesn't work, it loads a green glow but it doesn't do anything.
  5. PARKAH

    Skin problem

    Yes thanks! What can be added to that to make players weapons save on death?
  6. PARKAH

    Modloader

    When I install a skin with modloader how am I meant to know which skin it replaces?
  7. PARKAH

    Skin problem

    addEventHandler( "onPlayerWasted", getRootElement( ), function() setTimer( spawnPlayer, 4000, 1, source, 1177.5682373047, -1323.2587890625, 14.077121734619 ) outputChatBox ( getPlayerName ( source ).." died and lost his/her clothes on the way to All Saints Hospital.") end ) What needs to be added to this to make it save your skin on death?
  8. I got it from a tutorial topic, but none of those are working
  9. @denny I only want it to spawn in one vehicle, so you're failing.
  10. marker = createMarker(1949, -1705, 13,"corona",2,0,255,0) addEventHandler("onClientMarkerHit",marker, function() local vh = getPedOccupiedVehicle ( source ) vehicles = {462} nm = tonumber ( math.random( #vehicles ) ) setElementModel ( vh, nm ) end)
  11. I'm not sure but isn't the save and load there?
  12. Somewhere on a MTA resource website, but you probably don't to help me now.
  13. Here I have a script, it is used for a car panel and shop, of course with other scripts that is. But I'm pretty sure this is the script used to save and load the car you have bought, and for some reason you load it it doesn't save the colour or tuning upgrades, what needs to be added and where? If you could copy this script, edit it and paste it with a reply on this thread it would be greatly appreciated thanks! function dxDrawColorText(str, ax, ay, bx, by, color, scale, font, alignX, alignY) bx, by, color, scale, font = bx or ax, by or ay, color or tocolor(255,255,255,255), scale or 1, font or "default" if alignX then if alignX == "center" then ax = ax + (bx - ax - callClientFunction(source, "dxGetTextWidth", str:gsub("#%x%x%x%x%x%x",""), scale, font))/2 elseif alignX == "right" then ax = bx - callClientFunction(source, "dxGetTextWidth", str:gsub("#%x%x%x%x%x%x",""), scale, font) end end if alignY then if alignY == "center" then ay = ay + (by - ay - callClientFunction(source, "dxGetFontHeight", scale, font))/2 elseif alignY == "bottom" then ay = by - callClientFunction(source, "dxGetFontHeight", scale, font) end end local alpha = string.format("%08X", color):sub(1,2) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor(getColorFromString("#"..col..alpha)) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) ax = ax + w color = tocolor(getColorFromString("#"..col..alpha)) end last = e + 1 s, e, cap, col = str:find(pat, last) end if last <= #str then cap = str:sub(last) callClientFunction(source, "dxDrawText", cap, ax, ay, ax + callClientFunction(source, "dxGetTextWidth", cap, scale, font ), by, color, scale, font ) end end addEventHandler ( "onResourceStart", resourceRoot, function ( ) for i,player in ipairs (getElementsByType("player")) do setElementData(player,"showCar",false) end executeSQLQuery ( "CREATE TABLE IF NOT EXISTS cars (accountName TEXT, CarName TEXT, Health TEXT)" ) outputDebugString ( "Successfully connected to DataBase" ) local markers = getElementsByType ( "marker", getResourceRootElement() ) for theKey,theMarkers in ipairs(markers) do local x,y,z = getElementPosition( theMarkers ) createBlip ( x, y, z, 55, 0, 0, 0, 255 ) end end ) addEventHandler("onPlayerJoin",root, function() setElementData(source,"showCar",false) end) addEventHandler ( "onPlayerLogin", root, function ( _, account ) triggerEvent("UpdateCarLists",source,source) for index, cars in ipairs ( getAccountCars ( source ) ) do triggerClientEvent("updateCarListc",source,source,cars["CarName"],cars["Health"],index) end end ) function doesCarExist ( player,Car ) local account = getPlayerAccount ( player ) local accountName = getAccountName ( account ) local result = executeSQLQuery ( "SELECT * FROM cars WHERE accountName = ? AND CarName = ?", tostring ( accountName ), tostring ( Car ) ) if ( type ( result ) == "table" and #result == 0 or not result ) then return false, "This Car does not exists." else return true end end function addCarToDatabase ( player,Car ) local account = getPlayerAccount ( player ) local accountName = getAccountName ( account ) if ( doesCarExist ( player,Car ) ) then return false, "A Car with this name already exist." end if ( executeSQLQuery( "INSERT INTO `cars` (`accountName`, `CarName`, `Health`) VALUES ('".. tostring ( accountName ) .."', '".. tostring ( Car ) .."', '1000');" ) ) then else return false, "Unable to create Car." end end function setCarHealth ( player,Car,He ) local Health = math.ceil ( He ) local account = getPlayerAccount ( player ) local accountName = getAccountName ( account ) if ( not doesCarExist ( player,Car ) ) then return false, "This Car does not exists." end return executeSQLQuery( "UPDATE `cars` SET `Health` = '".. tostring (Health) .."' WHERE `accountName` = '" .. tostring ( accountName ) .."' AND CarName = '".. tostring ( Car ) .."'" ) end function removeCarFromDatabase ( player,Car ) local account = getPlayerAccount ( player ) local accountName = getAccountName ( account ) if ( not doesCarExist ( player,Car ) ) then return false, "A Car with this name already exist." end if ( executeSQLQuery("DELETE FROM `cars` WHERE `accountName` = '" .. tostring ( accountName ) .. "' AND CarName = '".. tostring ( Car ) .."'" ) ) then else return false, "Unable to create Car." end end function getAccountCars ( player ) local account = getPlayerAccount ( player ) local accountName = getAccountName ( account ) local result = executeSQLQuery ( "SELECT * FROM cars WHERE accountName = ?", tostring ( accountName ) ) if ( type ( result ) == "table" and #result == 0 or not result ) then return { } else return result end end function getCarHealth ( player,Car ) local account = getPlayerAccount ( player ) local accountName = getAccountName ( account ) local result = executeSQLQuery ( "SELECT * FROM cars WHERE accountName = ? AND CarName = ?", tostring ( accountName ), tostring ( Car ) ) if ( type ( result ) == "table" and #result == 0 or not result ) then return "None" else return result[ 1 ][ "Health" ] end end ---------- Tirger addEvent("BuyVc",true) addEventHandler("BuyVc",root, function (vcName,vcPrize) if not doesCarExist ( source,vcName ) then takePlayerMoney ( source, tonumber(vcPrize) ) addCarToDatabase(source,vcName) outputChatBox("The car was purchased, Car Panel = ".. getElementData(source,"bin"),source,0,255,0) for index, cars in ipairs ( getAccountCars ( source ) ) do triggerClientEvent("updateCarListc",source,source,cars["CarName"],cars["Health"],index) end else outputChatBox("You already have one of these cars!",source,255,0,0) end end ) addEvent("UpdateCarLists",true) addEventHandler("UpdateCarLists",root, function (player) if getElementData(player,"showCar") == true then local vch = getElementHealth ( getElementData(player,"Car") ) if vch < 300 then removeCarFromDatabase(player,getElementData(player,"CarName")) setElementData(player,"showCar",false) destroyElement(getElementData(player,"Car")) removeElementData(player,"Car") end if vch > 1000 then setCarHealth(player,vcName,1000) else setCarHealth(player,vcName,vch) end end for index, cars in ipairs ( getAccountCars ( player ) ) do triggerClientEvent("updateCarListc",player,player,cars["CarName"],cars["Health"],index) end end ) addEvent("useCar",true) addEventHandler("useCar",root, function (vcName,vcHealth) if getElementData(source,"showCar") == true then local vch = getElementHealth ( getElementData(source,"Car") ) if vch < 300 then removeCarFromDatabase(source,getElementData(source,"CarName")) setElementData(source,"showCar",false) destroyElement(getElementData(source,"Car")) removeElementData(source,"Car") end destroyElement(getElementData(source,"Car")) end local x, y, z = getElementPosition ( source ) local vc = createVehicle ( getVehicleModelFromName ( vcName ), x + 1, y, z + 1 ) setElementData(vc,"CarF1",true) setElementData(vc,"CarF1Player",source) setElementHealth ( vc, getCarHealth(source,vcName) ) setElementData(source,"Car",vc) setElementData(source,"showCar",true) setElementData(source,"CarName",vcName) outputChatBox("You have spawned your car",source,0,255,0) end ) addEvent("You have locked your car",true) addEventHandler("lockCar",root, function (vcName) if getElementData(source,"showCar") == true then if getElementData(source,"CarName") == vcName then if isVehicleLocked ( getElementData(source,"Car") ) then setVehicleLocked ( getElementData(source,"Car"), false ) outputChatBox("unlock",source,0,255,0) else setVehicleLocked ( getElementData(source,"Car"), true ) outputChatBox("You have locked your car",source,255,0,0) end end end end ) addEvent("DestroyCar",true) addEventHandler("DestroyCar",root, function (vcName) if getElementData(source,"showCar") == true then if getElementData(source,"CarName") == vcName then local vch = getElementHealth ( getElementData(source,"Car") ) if vch < 300 then removeCarFromDatabase(source,getElementData(source,"CarName")) setElementData(source,"showCar",false) destroyElement(getElementData(source,"Car")) removeElementData(source,"Car") end if vch > 1000 then setCarHealth(source,vcName,1000) else setCarHealth(source,vcName,vch) end destroyElement(getElementData(source,"Car")) setElementData(source,"showCar",false) else outputChatBox("notacar",source,255,0,0) end else outputChatBox("Your car is currently invisible, click use to spawn it",source,255,0,0) end end ) function VehicleLoss(loss) if (getElementData(source,"CarF1") == true) then local vch = getElementHealth ( source ) if vch < 300 then removeCarFromDatabase(getElementData(source,"CarF1Player"),getVehicleName ( source )) setElementData(getElementData(source,"CarF1Player"),"showCar",false) destroyElement(source) removeElementData(getElementData(source,"CarF1Player"),"Car") removeElementData(source,"CarF1Player") setElementData(source,"CarF1",false) end setCarHealth(getElementData(source,"CarF1Player"),getVehicleName ( source ),vch-loss) end end addEventHandler("onVehicleDamage", getRootElement(), VehicleLoss) addEvent("onPlayerGarageEnter", true) addEventHandler("onResourceStart", getResourceRootElement(), function (resource) for i=0,49 do
  14. Wow, I decided to record me trying to do it and it decided to work when I recorded it Well, thanks everyone for trying to helping, here's the video if you want to watch it https://www.youtube.com/watch?v=gk42cdAdBqM
  15. The pictures were taken at different times, I I had tried redoing it all about 10 times. Didn't work any time.
  16. Then mine is; <meta> <info author="PARKAH" version="0.1" name="myserver" description="test" type="gamemode" /> <script src="script.lua" type="server" /> </meta>
×
×
  • Create New...