Jump to content

WASSIm.

Members
  • Posts

    1,412
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by WASSIm.

  1. function () if (source == Select5) then if isPedOnGround ( localPlayer ) then local row9, col9 = guiGridListGetSelectedItem(AnimationGRID) local SSS9 = guiGridListGetItemText(AnimationGRID, row9, col9) if (SSS9) then if (SSS9 == "dance 1") then triggerServerEvent("dance", localPlayer) elseif (SSS9 == "dance 2") then triggerServerEvent("dance2", localPlayer) elseif (SSS9 == "dance 3") then triggerServerEvent("dance3", localPlayer) elseif (SSS9 == "dance 4") then triggerServerEvent("dance4", localPlayer) elseif (SSS9 == "dance 5") then triggerServerEvent("dance5", localPlayer) elseif (SSS9 == "dance 6") then triggerServerEvent("dance6", localPlayer) elseif (SSS9 == "STOP") then triggerServerEvent("dance7", localPlayer) elseif (SSS9 == "Sit 1") then triggerServerEvent("Sit1", localPlayer) elseif (SSS9 == "Sit 2") then triggerServerEvent("Sit2", localPlayer) elseif (SSS9 == "Sit 3") then triggerServerEvent("Sit3", localPlayer) elseif (SSS9 == "Sit 4") then triggerServerEvent("Sit4", localPlayer) end end else outputChatBox("You're Not On The Ground", 255, 255, 0) end end end )
  2. hi guys i have problem to startResource. if stop this resource all resources in table stop. local ZAResources = { ["ZO-spawn"]=true, ["ZA-gang"]=true, ["ZA-level"]=true, ["ZA-misc"]=true, ["ZA-zombies"]=true, ["ZA-dxhelp"]=true, ["ZA-bosses"]=true, ["ZA-headlook"]=true, ["ZA-superman"]=true, ["ZA-Anti"]=true, ["ZA-damage"]=true, ["ZA-texture"]=true, ["ZA-blips"]=true, ["ZA-radar"]=true, ["ZA-staff"]=true, ["ZA-hud"]=true, ["ZA-vehicles"]=true, ["ZA-zones"]=true, ["ZA-interiors"]=true, ["ZA-gates"]=true, ["ZA-weapon-stid"]=true, ["ZA-warroom"]=true, ["ZA-Mods"]=true, ["ZA-heligrab"]=true, ["ZA-down"]=true, ["ZA-login"]=true, ["ZA-save"]=true, ["ZA-respawn"]=true, ["ZA-chat"]=true, ["ZA-LaserPointer"]=true, ["ZA-Glue"]=true, ["ZA-maps"]=true, ["ZA-tags"]=true, ["ZA-setting"]=true, ["ZA-info"]=true, ["ZA-ban"]=true } addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function( ) for i, resources in ipairs(getResources()) do if ( ZAResources[getResourceName(resources)] ) then local resourceName = getResourceName(resources) local start = startResource ( resources ) if ( start ) then outputDebugString ( resourceName.." was started successfully." ) else outputDebugString ( resourceName.." Failed to Started.", 1 ) end end end end )
  3. http://www.mediafire.com/download/z08cz ... /moneys.db
  4. dbConnect المشكلة ليست في :بل في function setAccountMoney ( account, theMoney ) local handler = connection if ( not handler ) then return false, "Couldn't connect to SQLite database." end return dbExec( handler, "UPDATE moneys SET Money = '".. tostring ( theMoney ) .."' WHERE account = '" .. tostring ( account ) .."'" ) end
  5. resource مثبت والمشكلة تظهر لي إذا توقف dbConnect
  6. EDIT مرحبا .انا بحاجة الى مساعدة debugscript: 112: dbExec failed; (1) no such table: moneys addEventHandler ( "onResourceStart", resourceRoot, function ( ) connection = dbConnect( "sqlite", ":server/databases/moneys.db" ) exports [ "scoreboard" ]:addScoreboardColumn ( "Money", root, 7, "Money", 6 ) if ( connection )then dbExec ( connection, "CREATE TABLE IF NOT EXISTS moneys (ID INTEGER PRIMARY KEY NOT NULL, account TEXT, Money INT)" ) outputDebugString ( "Successfully connected to moneys.db" ) else outputDebugString ( "Failed to connect to moneys.db", 3 ) end end ) addEventHandler("onResourceStart",resourceRoot, function () for index, player in ipairs(getElementsByType("player")) do local account = getPlayerAccount(player) if (not account or isGuestAccount(account)) then return false end local accountName = getAccountName(account) local money = getAccountMoney ( accountName ) if (account) then if not ( money ) then addMoneyToDatabase ( accountName ) setPlayerMoney(player, 0) else setPlayerMoney(player, tonumber(money)) end end end end) addEventHandler("onResourceStop",resourceRoot, function () for index, player in ipairs(getElementsByType("player")) do local money = getPlayerMoney(player) local account = getPlayerAccount(player) if (not account or isGuestAccount(account)) then return false end local accountName = getAccountName(account) if (account) then setAccountMoney(accountName, tonumber(money)) setPlayerMoney(player, 0) end end end) addEventHandler("onPlayerLogout",root, function (_,account) local money = getPlayerMoney(source) local accountName = getAccountName(account) setAccountMoney(accountName, money) setPlayerMoney(source, 0) end ) addEventHandler("onPlayerQuit",root, function ( ) local money = getPlayerMoney(source) local account = getPlayerAccount(source) if (not account or isGuestAccount(account)) then return false end local accountName = getAccountName(account) if (account) then setAccountMoney(accountName, money) setPlayerMoney(source, 0) end end ) addEventHandler("onPlayerLogin",root, function (_,account) local accountName = getAccountName(account) local handler = connection local money = getAccountMoney ( accountName ) if not ( money ) then addMoneyToDatabase ( accountName ) setPlayerMoney(source, 0) else local money = money setPlayerMoney(source, money) end end) function addMoneyToDatabase ( account ) local handler = connection if ( not handler ) then return false, "Couldn't connect to SQLite database." end return dbExec( handler, "INSERT INTO moneys (ID, account, Money) VALUES (NULL, '".. tostring ( account ) .."', '0')" ) end function getAccountMoney ( account ) local handler = connection if ( not handler ) then return false, "Couldn't connect to SQLite database." end local query = dbQuery ( handler, "SELECT * FROM moneys WHERE account = ?", tostring ( account ) ) local result, numrows, errmsg = dbPoll ( query, -1 ) if ( type ( result ) == "table" and #result == 0 or not result ) then return false else return tostring ( result[ 1 ][ "Money" ] ) end end function setAccountMoney ( account, theMoney ) local handler = connection if ( not handler ) then return false, "Couldn't connect to SQLite database." end return dbExec( handler, "UPDATE moneys SET Money = '".. tostring ( theMoney ) .."' WHERE account = '" .. tostring ( account ) .."'" ) end
  7. guiSetAlpha not working with GUI Static Images
  8. use this guiSetProperty guiSetProperty( theImage, "Alpha", Alpha )
  9. https://community.multitheftauto.com/in ... ls&id=7022
  10. https://community.multitheftauto.com/in ... ls&id=8122 DONE
  11. use this: https://community.multitheftauto.com/in ... ls&id=3379
  12. WASSIm.

    a question

    this exmple make all players have custom blip local playerBlips = {} local image = "icon.png" addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), function () for k, thePlayer in ipairs ( getElementsByType( "player" ) ) do if not ( playerBlips[thePlayer] ) then playerBlips[thePlayer] = exports.customblips:createCustomBlip ( 0, 0, 16, 16, image ) end end end ) addEventHandler( "onClientPlayerJoin", root, function() if not ( playerBlips[source] ) then playerBlips[source] = exports.customblips:createCustomBlip ( 0,0, 16, 16, image ) end end ) addEventHandler( "onClientRender", root, function () for thePlayer, theBlip in pairs( playerBlips ) do if ( isElement( thePlayer ) ) and not ( thePlayer == localPlayer ) then if ( theBlip ) then local x,y,z = getElementPosition( thePlayer ) exports.customblips:setCustomBlipPosition ( theBlip, x, y ) end end end end ) addEventHandler("onClientPlayerQuit",root, function () if ( isElement( playerBlips[source] ) ) then destroyElement( playerBlips[source] ) playerBlips[source] = nil end end )
×
×
  • Create New...