Jump to content

Search the Community

Showing results for tags 'نضام تاجات خاصة'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 1 result

  1. هلا أخي معي مود تاجات خاصة بي السريال ابي احولها باسم الحساب client.lua CMD = 'tagsmanager' -- #Panel command to show < access = { -- #Console serials to access panel < ['AD7B8DE60D21E0F56B8968921D4D1404'] = true, --['serial'] = true, --['serial'] = true, --['serial'] = true, --['serial'] = true, } Cplayer = getLocalPlayer( ) -- #Tags system window GUIEditor = { edit = {}, button = {}, window = {}, label = {}, gridlist = {} } local screenW, screenH = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((screenW - 585) / 2, (screenH - 427) / 2, 585, 427, "# - | \"TAG\" System * Manager | - #", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 1.00) guiSetVisible(GUIEditor.window[1], false) GUIEditor.gridlist[1] = guiCreateGridList(10, 27, 565, 216, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "#Name", 0.3) guiGridListAddColumn(GUIEditor.gridlist[1], "# Tag", 0.75) guiGridListAddColumn(GUIEditor.gridlist[1], "#Status", 0.12) guiGridListAddColumn(GUIEditor.gridlist[1], "#Serial", 0.4) guiSetFont(GUIEditor.gridlist[1], "default-bold-small") GUIEditor.label[1] = guiCreateLabel(10, 253, 107, 21, "- Deactive player :", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetColor(GUIEditor.label[1], 69, 178, 255) guiLabelSetVerticalAlign(GUIEditor.label[1], "center") GUIEditor.button[1] = guiCreateButton(122, 253, 133, 21, "$Deactive selected", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFF4444") GUIEditor.label[2] = guiCreateLabel(10, 279, 565, 15, "ــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــ", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[2], "default-bold-small") guiLabelSetColor(GUIEditor.label[2], 69, 69, 69) guiLabelSetHorizontalAlign(GUIEditor.label[2], "center", false) GUIEditor.label[3] = guiCreateLabel(10, 304, 88, 21, "- Player serial :", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[3], "default-bold-small") guiLabelSetColor(GUIEditor.label[3], 69, 178, 255) guiLabelSetVerticalAlign(GUIEditor.label[3], "center") GUIEditor.edit[1] = guiCreateEdit(98, 304, 300, 21, "", false, GUIEditor.window[1]) GUIEditor.label[4] = guiCreateLabel(10, 335, 88, 21, "- Player TAG :", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[4], "default-bold-small") guiLabelSetColor(GUIEditor.label[4], 69, 178, 255) guiLabelSetVerticalAlign(GUIEditor.label[4], "center") GUIEditor.edit[2] = guiCreateEdit(98, 335, 300, 21, "", false, GUIEditor.window[1]) GUIEditor.button[2] = guiCreateButton(408, 304, 133, 21, "$Check serial", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "default-bold-small") guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFF4444") GUIEditor.button[3] = guiCreateButton(408, 335, 133, 21, "$Preview TAG", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[3], "default-bold-small") guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFFF4444") GUIEditor.label[5] = guiCreateLabel(10, 377, 98, 21, "- Console \"CMD\" :", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[5], "default-bold-small") guiLabelSetColor(GUIEditor.label[5], 69, 178, 255) guiLabelSetVerticalAlign(GUIEditor.label[5], "center") GUIEditor.button[4] = guiCreateButton(265, 377, 133, 21, "$Active this \"TAG\"", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[4], "default-bold-small") guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FF66FF31") GUIEditor.button[5] = guiCreateButton(442, 396, 133, 21, "$Close panel", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[5], "default-bold-small") guiSetProperty(GUIEditor.button[5], "NormalTextColour", "FFB90000") GUIEditor.button[6] = guiCreateButton(113, 377, 133, 21, "$Reset panel", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[6], "default-bold-small") guiSetProperty(GUIEditor.button[6], "NormalTextColour", "FFFEF447") -- #Tag manager window tagChoice = guiCreateWindow((screenW - 324) / 2, (screenH - 132) / 2, 324, 132, "# - | TAG manager | - #", false) guiWindowSetSizable(tagChoice, false) guiSetAlpha(tagChoice, 1.00) guiSetVisible(tagChoice, false) Note_tagChoice = guiCreateLabel(10, 22, 304, 21, "$Note : Do you want to use current tag ?", false, tagChoice) guiSetFont(Note_tagChoice, "default-bold-small") guiLabelSetColor(Note_tagChoice, 49, 83, 255) guiLabelSetVerticalAlign(Note_tagChoice, "center") Yes_tagChoice = guiCreateButton(20, 81, 122, 21, "$Yes, use this tag", false, tagChoice) guiSetFont(Yes_tagChoice, "default-bold-small") guiSetProperty(Yes_tagChoice, "NormalTextColour", "FF30FF35") No_tagChoice = guiCreateButton(182, 81, 122, 21, "$No, return home", false, tagChoice) guiSetFont(No_tagChoice, "default-bold-small") guiSetProperty(No_tagChoice, "NormalTextColour", "FFFF3030") -- #Client side functions function checkButtons() if (guiGetEnabled( GUIEditor.button[2] ) == false) and (guiGetEnabled( GUIEditor.button[3] ) == false) then guiSetEnabled( GUIEditor.button[4], true ) end end function ClickButtons() if ( source == GUIEditor.button[5] ) then guiSetVisible( GUIEditor.window[1], false ) showCursor( false ) elseif ( source == GUIEditor.button[2] ) then local serial = guiGetText( GUIEditor.edit[1] ) local serNum = guiEditGetCaretIndex ( GUIEditor.edit[1] ) if (serial == "") or (serNum ~= 32) then outputChatBox( 'ERROR : #FFFFFF This is incorrect serial !', 255, 0, 0, true ) return end triggerServerEvent( 'checkPlayerSerial', Cplayer, serial ) elseif ( source == GUIEditor.button[3] ) then local playerTag = guiGetText( GUIEditor.edit[2] ) if ( playerTag == "" ) then outputChatBox( 'ERROR : #FFFFFF Please write a correct tag !', 255, 0, 0, true ) return end if(outputChatBox( playerTag, 255, 255, 255, true ) ) then guiSetVisible( tagChoice, true ) guiSetVisible( GUIEditor.window[1], false ) else outputChatBox( 'Warning : #FFFFFF Cannot output tag, string is too long !', 255, 75, 0, true ) guiSetVisible( tagChoice, true ) guiSetVisible( GUIEditor.window[1], false ) end elseif ( source == Yes_tagChoice ) then guiSetEnabled( GUIEditor.button[3], false ) guiEditSetReadOnly( GUIEditor.edit[2], true ) guiSetVisible( GUIEditor.window[1], true ) guiSetVisible( tagChoice, false ) checkButtons() elseif ( source == No_tagChoice ) then guiSetVisible( GUIEditor.window[1], true ) guiSetVisible( tagChoice, false ) elseif ( source == GUIEditor.button[6] ) then guiSetText( GUIEditor.edit[1], '' ) guiSetText( GUIEditor.edit[2], '' ) guiEditSetReadOnly( GUIEditor.edit[1], false ) guiEditSetReadOnly( GUIEditor.edit[2], false ) guiSetEnabled( GUIEditor.button[4], false ) guiSetEnabled( GUIEditor.button[3], true ) guiSetEnabled( GUIEditor.button[2], true ) elseif ( source == GUIEditor.button[4] ) then if (guiGetEnabled( GUIEditor.button[2] ) == true) or (guiGetEnabled( GUIEditor.button[3] ) == true) then outputChatBox( 'ERROR : #FFFFFF Failed to get tag or serial !', 255, 0, 0, true ) return end local sourceSerial = guiGetText( GUIEditor.edit[1] ) local sourceTag = guiGetText( GUIEditor.edit[2] ) guiSetEnabled( GUIEditor.button[4], false ) setTimer( guiSetEnabled, 3000, 1, GUIEditor.button[4], true ) triggerServerEvent( 'checkTagstatement', Cplayer, sourceSerial, sourceTag ) elseif ( source == GUIEditor.button[1] ) then local selectedPlayer = guiGridListGetSelectedItem( GUIEditor.gridlist[1] ) if ( selectedPlayer == -1 ) then outputChatBox( 'ERROR : #FFFFFF Please select a player from list !', 255, 0, 0, true ) return end local sourceSerial = guiGridListGetItemText( GUIEditor.gridlist[1], selectedPlayer, 4 ) if ( sourceSerial ~= '' or not sourceSerial < 32 or not sourceSerial > 32 ) then triggerServerEvent( 'removePlayerFromDatabase', Cplayer, sourceSerial ) end end end addEventHandler( 'onClientGUIClick', root, ClickButtons ) addEvent( 'setButton&EditDisabled', true ) addEventHandler( 'setButton&EditDisabled', root, function() guiSetEnabled( GUIEditor.button[2], false ) guiEditSetReadOnly( GUIEditor.edit[1], true ) checkButtons() end ) function getTags() triggerServerEvent( 'getTagsFromDatabase', Cplayer ) end addEventHandler( 'onClientResourceStart', resourceRoot, getTags ) addEvent( 'databaseItemsToLost', true ) addEventHandler( 'databaseItemsToLost', root, function( database ) guiGridListClear( GUIEditor.gridlist[1] ) for i, _ in ipairs( database ) do local item = guiGridListAddRow( GUIEditor.gridlist[1] ) local playerName = guiGridListSetItemText( GUIEditor.gridlist[1], item, 1, string.gsub( database[i].name, '#%x%x%x%x%x%x', '' ), false, false ) local playerTag = guiGridListSetItemText( GUIEditor.gridlist[1], item, 2, string.gsub( database[i].tag, '#%x%x%x%x%x%x', '' ), false, false ) local tagState = guiGridListSetItemText( GUIEditor.gridlist[1], item, 3, database[i].state, false, false ) local playerSerial = guiGridListSetItemText( GUIEditor.gridlist[1], item, 4, database[i].serial, false, false ) if ( database[i].state == 'Enabled' ) then guiGridListSetItemColor( GUIEditor.gridlist[1], item, 3, 45, 200, 45 ) else guiGridListSetItemColor( GUIEditor.gridlist[1], item, 3, 200, 45, 45 ) end guiGridListSetItemColor( GUIEditor.gridlist[1], item, 1, 200, 200, 45 ) guiGridListSetItemColor( GUIEditor.gridlist[1], item, 4, 45, 45, 200 ) end end ) addEvent( 'resetGridlist', true ) addEventHandler( 'resetGridlist', root, function( ) guiGridListClear( GUIEditor.gridlist[1] ) end ) function openTAGSpanel() if ( access[getPlayerSerial( Cplayer )] ) then if (guiGetEnabled( GUIEditor.button[2] ) == true) or (guiGetEnabled( GUIEditor.button[3] ) == true) then guiSetEnabled( GUIEditor.button[4], false ) end guiSetVisible(GUIEditor.window[1], not guiGetVisible(GUIEditor.window[1])) showCursor(guiGetVisible(GUIEditor.window[1])) else outputChatBox( 'ERROR : #FFFFFF Access denied !', 255, 0, 0, true ) return end end addCommandHandler( CMD, openTAGSpanel ) server.lua -- #Server side functions local tagsDBconnect = dbConnect( 'sqlite', '[TAGS system] Database.db' ) dbExec( tagsDBconnect, ' CREATE TABLE IF NOT EXISTS `TagsSystemPro` (serial, name, tag, state) ' ) --dbExec( tagsDBconnect, ' DROP TABLE `TagsSystemPro` ' ) function getPlayerFromSerial ( serial ) assert ( type ( serial ) == "string" and #serial == 32, "getPlayerFromSerial - invalid serial" ) for index, player in ipairs ( getElementsByType ( "player" ) ) do if ( getPlayerSerial ( player ) == serial ) then return player end end return false end function takeTagsFromDB() local databaseItems = dbQuery( tagsDBconnect, ' SELECT * FROM `TagsSystemPro` ' ) local dbItems = dbPoll( databaseItems, -1 ) if ( type ( dbItems ) == 'table' and #dbItems == 0 or not dbItems ) then triggerClientEvent( 'resetGridlist', root ) return end triggerClientEvent( 'databaseItemsToLost', root, dbItems ) end addEvent( 'getTagsFromDatabase', true ) addEventHandler( 'getTagsFromDatabase', root, takeTagsFromDB ) addCommandHandler( 'myTag', function( myself ) local ifData = dbQuery( tagsDBconnect, ' SELECT * FROM `TagsSystemPro` WHERE serial = ? ', getPlayerSerial( myself ) ) local dbData = dbPoll( ifData, -1 ) if ( type ( dbData ) == 'table' and #dbData == 0 or not dbData ) then return end local TagString = dbData[1]['tag'] local TagState = dbData[1]['state'] if ( TagState == 'Enabled' ) then local state = 'Disabled' outputChatBox( 'Tags system : #FFFFFF Your tag has been : #FF0000' .. state, myself, 0, 255, 0, true ) dbExec( tagsDBconnect, ' UPDATE `TagsSystemPro` SET serial = ?, name = ?, tag = ?, state = ? WHERE serial = ? ', getPlayerSerial( myself ), getPlayerName( myself ), TagString, state, getPlayerSerial( myself ) ) takeTagsFromDB() else local state = 'Enabled' outputChatBox( 'Tags system : #FFFFFF Your tag has been : #1EFF00' .. state, myself, 0, 255, 0, true ) dbExec( tagsDBconnect, ' UPDATE `TagsSystemPro` SET serial = ?, name = ?, tag = ?, state = ? WHERE serial = ? ', getPlayerSerial( myself ), getPlayerName( myself ), TagString, state, getPlayerSerial( myself ) ) takeTagsFromDB() end end ) addEventHandler( 'onPlayerChat', root, function(message) local systemState = dbQuery( tagsDBconnect, ' SELECT * FROM `TagsSystemPro` WHERE serial = ? ', getPlayerSerial( source ) ) local dbValues = dbPoll( systemState, -1 ) if ( type ( dbValues ) == 'table' and #dbValues == 0 or not dbValues ) then return end local state = dbValues[1]['state'] if ( state == 'Disabled' ) then return end local tag = dbValues[1]['tag'] cancelEvent( ) outputChatBox( tag .. '#FFFFFF : '.. message, root, 255, 255, 255, true ) end ) addEventHandler( 'onPlayerChangeNick', root, function(oldPlayerName, newPlayerName) local ifData = dbQuery( tagsDBconnect, ' SELECT * FROM `TagsSystemPro` WHERE serial = ? ', getPlayerSerial( source ) ) local dbData = dbPoll( ifData, -1 ) if ( type ( dbData ) == 'table' and #dbData == 0 or not dbData ) then return end local TagString = dbData[1]['tag'] local TagState = dbData[1]['state'] dbExec( tagsDBconnect, ' UPDATE `TagsSystemPro` SET serial = ?, name = ?, tag = ?, state = ? WHERE serial = ? ', getPlayerSerial( source ), newPlayerName, TagString, TagState, getPlayerSerial( source ) ) takeTagsFromDB() end ) addEvent( 'removePlayerFromDatabase', true ) addEventHandler( 'removePlayerFromDatabase', root, function(serial) local getPlayerFromDB = dbQuery( tagsDBconnect, ' SELECT * FROM `TagsSystemPro` WHERE serial = ? ', serial ) local checkedPlayer = dbPoll( getPlayerFromDB, -1 ) if ( type ( checkedPlayer ) == 'table' and #checkedPlayer == 0 or not checkedPlayer ) then outputChatBox( 'ERROR : #FFFFFF This player is not exist in our database !', source, 255, 0, 0, true ) return end dbExec( tagsDBconnect, ' DELETE FROM `TagsSystemPro` WHERE serial = ? ', serial ) outputChatBox( 'Tags system : #FFFFFF Player has been removed from our database !', source, 0, 255, 0, true ) takeTagsFromDB() end ) addEvent( 'checkTagstatement', true ) addEventHandler( 'checkTagstatement', root, function( serial, tag ) local sourcePlayer = getPlayerFromSerial( serial ) local getResults = dbQuery( tagsDBconnect, ' SELECT * FROM `TagsSystemPro` WHERE serial = ? ', serial ) local checkValue = dbPoll( getResults, -1 ) if ( type ( checkValue ) == 'table' and #checkValue == 0 or not checkValue ) then dbExec( tagsDBconnect, ' INSERT INTO `TagsSystemPro` VALUES(?, ?, ?, ?) ', serial, getPlayerName( sourcePlayer ), tag, 'Enabled' ) outputChatBox( 'Tags system : #FFFFFF Player tag successfully added !', source, 0, 255, 0, true ) takeTagsFromDB() else outputChatBox( 'ERROR : #FFFFFF This player is already have tag, please remove it from list and try again !', source, 255, 0, 0, true ) return end end ) addEvent( 'checkPlayerSerial', true ) addEventHandler( 'checkPlayerSerial', root, function ( serial ) if ( getPlayerFromSerial(serial) ) then triggerClientEvent( source, 'setButton&EditDisabled', source ) outputChatBox( 'Tags system : #FFFFFF Serial checked successfully !', source, 0, 255, 0, true ) else outputChatBox( 'ERROR : #FFFFFF The player is not found in the server !', source, 255, 0, 0, true ) return end end ) وشكرا
×
×
  • Create New...