Jump to content

x[تعديل]x تاج


Recommended Posts

السلام عليكم

انا معي جريد لست

فيها اسماء الاعبين

و بطن

عاوز لما احدد علي حد في الجريد لست

و اكتب في الادت اي شئ

و اضغط بطن يعطيلو التاج

مثلا

انا اخترت نفسي

و كتبت في الايدت كده

Owner

و ضغط بطن

يطلع في الشات كده

*[ Owner ]x |xSaedAmer

|xSaedAmer ده اسمي

Edited by Guest
Link to comment

كده ؟

+

فين الكود الي هو يعرف ان انا مختار لاعب من الجريد لست

وكيف اخليها كده

*[ التاج ]x اسم الاعب

كلنت

  
addEventHandler("onClientGUIClick",root, 
function() 
  
if(source == GUIEditor.button[1]) then 
  
if guiGetText (GUIEditor.edit[1]) ~= '' then 
  
setElementData (localPlayer,'tag',guiGetText (GUIEditor.edit[1])) 
  
end 
  
elseif(source == GUIEditor.button[2]) then 
  
setElementData (localPlayer,'tag',false) 
  
end 
  
end) 

سيرفر

addEventHandler("onPlayerChat",root,function (msg) 
local tag = getElementData(source,"tag")    
outputChatBox(tag ..' '.. getPlayerName(source) .. ' : '.. msg,root, r, g, b, true) 
return cancelEvent() 
end) 
  

Link to comment
  
addEventHandler("onClientGUIClick",root, 
function() 
  
if(source == GUIEditor.button[1]) then 
  
if guiGetText (GUIEditor.edit[1]) ~= '' then 
  
guiGridListGetSelectedItem ( gridList ) 
guiGridListGetItemText ( gridList, rowIndex, Playrs ) 
setElementData (localPlayer,'tag',guiGetText (GUIEditor.edit[1])) 
  
end 
  
elseif(source == GUIEditor.button[2]) then 
  
setElementData (localPlayer,'tag',false) 
  
end 
  
end) 

Link to comment

function guiGridListGetSelectedItemText ( gridList, column ) 
    local item = guiGridListGetSelectedItem ( gridList ) 
    local text = guiGridListGetItemText ( gridList, item, column or 1 ) 
    if ( text ~= '' ) then 
        return text 
    else 
        return false 
    end 
end 
  
function centerWindow(center_window) 
    local screenW,screenH=guiGetScreenSize() 
    local windowW,windowH=guiGetSize(center_window,false) 
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2 
    guiSetPosition(center_window,x,y,false) 
end 
  
function SetWindowVisible ( Panel , StatsP , StatsC ) 
    guiSetVisible( Panel , StatsP) 
        showCursor( StatsC ) 
            centerWindow( Panel ) 
end 
  
  
local screenW, screenH = guiGetScreenSize() 
Tag_Window = guiCreateWindow((screenW - 353) / 2, (screenH - 285) / 2, 353, 285, "Tags System", false) 
guiWindowSetSizable(Tag_Window, false) 
guiSetVisible(Tag_Window,false) 
Tag_GridList = guiCreateGridList(10, 24, 332, 207, false, Tag_Window) 
Tag_Column = guiGridListAddColumn(Tag_GridList, "Players", 0.9) 
Tag_Edit = guiCreateEdit(9, 240, 260, 24, "", false, Tag_Window) 
Tag_Buuton_G = guiCreateButton(273, 240, 69, 24, "Give Tag", false, Tag_Window) 
guiSetFont(Tag_Buuton_G, "default-bold-small")  
guiSetFont(Tag_GridList, "default-bold-small")     
  
addCommandHandler('TagPanel', 
function ( ) 
guiGridListClear ( Tag_GridList ) 
    for _,Value in next, getElementsByType ( "player" ) do 
        local Row = guiGridListAddRow ( Tag_GridList )  
            guiGridListSetItemText ( Tag_GridList, Row, Tag_Column, getPlayerName ( Value ), false, false ) 
            guiGridListSetItemColor(Tag_GridList,Row,1,math.random(0,255),math.random(0,255),math.random(0,255)) 
            SetWindowVisible ( Tag_Window , not guiGetVisible(Tag_Window) , not guiGetVisible(Tag_Window) ) 
    end 
end ) 
  
addEventHandler('onClientGUIClick',Tag_Buuton_G, 
function ( ) 
    local Selected , Tag_Name = guiGridListGetSelectedItemText ( Tag_GridList, Tag_Column ) , guiGetText(Tag_Edit) 
        if ( Tag_Name ~= ' ' ) or ( Tag_Name ~= '' ) and ( guiGridListGetSelectedItem (Tag_GridList) ~= -1 ) then 
            local Plr = getPlayerFromName(Selected) 
                setElementData(Plr,'Data_Tag',Tag_Name) 
                outputChatBox("#FFFFFF[Tag System] #53CE41 ", root , 255 , 255 ,255 ,true) 
    end 
end , false ) 

Server

addEventHandler('onPlayerChat',root, 
function ( msg ) 
cancelEvent ( ) 
    local Player_Name , Data = getPlayerName ( source ) , getElementData(source,'Data_Tag') or 'Player' 
        outputChatBox("#FF0000 * #FFFFFF["..Data.."] #A5A5A5"..Player_Name.."#33CCCC "..msg.."", root , 255 , 255 ,255 ,true) 
end ) 
  
executeSQLQuery( ' CREATE TABLE IF NOT EXISTS `Data_S` (Serial, Data) ' ) 
  
function onSave( )  
local checkData = executeSQLQuery( ' SELECT * FROM `Data_S` WHERE Serial = ? ', getPlayerSerial(source) ) 
local Data = getElementData(source,'Data_Tag') 
    if ( type ( checkData ) == 'table' and #checkData == 0 or not checkData ) then 
        executeSQLQuery( ' INSERT INTO `Data_S` (Serial, Data) VALUES(?, ?) ', getPlayerSerial(source), Data) 
else  
local Data = getElementData(source,'Data_Tag') 
        executeSQLQuery( ' UPDATE`Data_S` SET Serial = ?, Data = ? ', getPlayerSerial(source), Data) 
    end 
end 
addEventHandler('onPlayerQuit',getRootElement(),onSave) 
addEventHandler('onPlayerLogout',getRootElement(),onSave) 
  
addEventHandler( 'onPlayerJoin', root, 
function(   ) 
local Save = executeSQLQuery( ' SELECT * FROM `Data_S` WHERE Serial = ? ', getPlayerSerial(source) ) 
    if ( type ( Save ) == 'table' and #Save == 0 or not Save ) then return end 
            setElementData(source,'Data_Tag',Save[1]['Data']) 
end ) 

المود كامل ض1

Link to comment
سوي حدث يوم يكتب اللاعب

واجلب داتا احد التاجات الي عندك ( الرنت او المود هذا ) ء

واذا كانت الداتا ترو ومعاه التاج سوي

cancelEvent

i Not understand

^ I didn't understand .

وبخصوص طلبك سو حدث اون بلاير شات وتحقق من إذا الداتا حق المود اللي بتسويه فوق ترو أو فولس ، إذا ترو أظهر التاج حقه وإذا فولس سو كانسل إفنت وأظهر تاج الرتبة

Link to comment

ده كود سيرفر حق مود الكونسول يعطي التاج

addEventHandler('onPlayerChat',root, 
function ( msg ) 
cancelEvent ( ) 
    local Player_Name , Data = getPlayerName ( source ) , getElementData(source,'Data_Tag') 
        outputChatBox("#FF0000 * #FFFFFF[ #CD0000"..Data.."#FFFFFF ]x #A5A5A5"..Player_Name..":#CD0000 "..msg.."", root , 255 , 255 ,255 ,true) 
end ) 
  
executeSQLQuery( ' CREATE TABLE IF NOT EXISTS `Data_S` (Serial, Data) ' ) 
  
function onSave( ) 
local checkData = executeSQLQuery( ' SELECT * FROM `Data_S` WHERE Serial = ? ', getPlayerSerial(source) ) 
local Data = getElementData(source,'Data_Tag') 
    if ( type ( checkData ) == 'table' and #checkData == 0 or not checkData ) then 
        executeSQLQuery( ' INSERT INTO `Data_S` (Serial, Data) VALUES(?, ?) ', getPlayerSerial(source), Data) 
else 
local Data = getElementData(source,'Data_Tag') 
        executeSQLQuery( ' UPDATE`Data_S` SET Serial = ?, Data = ? ', getPlayerSerial(source), Data) 
    end 
end 
addEventHandler('onPlayerQuit',getRootElement(),onSave) 
addEventHandler('onPlayerLogout',getRootElement(),onSave) 
  
addEventHandler( 'onPlayerJoin', root, 
function(   ) 
local Save = executeSQLQuery( ' SELECT * FROM `Data_S` WHERE Serial = ? ', getPlayerSerial(source) ) 
    if ( type ( Save ) == 'table' and #Save == 0 or not Save ) then return end 
            setElementData(source,'Data_Tag',Save[1]['Data']) 
end ) 

ده كود سيرفر حق العب يعطي نفسه تاج في الرنت

addEventHandler("onPlayerChat",root,function (msg,Colour) 
local tag = getElementData(source,"tag") or '#FF0000[#005588Player#FF0000]'   
local colour = getElementData(source,"colour") or '#FFFFFF'   
outputChatBox(tag ..' '.. getPlayerName(source) .. ''..colour..' : '.. msg,root, r, g, b, true) 
return cancelEvent() 
end) 

ده مود التاجات

addEventHandler("onPlayerChat", root, playerChat) 
      
addEvent("onPlayeropenChat",true) 
addEventHandler("onPlayeropenChat",root,function () 
removeElementData(resourceRoot,"chat") 
end) 
  
addEvent("onPlayerCloseChat",true) 
addEventHandler("onPlayerCloseChat",root,function () 
setElementData (resourceRoot, "chat",true) 
end) 
    ------ 
    addEventHandler("onPlayerChat",root, 
    function( text, type) 
    if type == 1 or type == 2 then return end 
    if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Console")) then 
    cancelEvent() 
    local r, g, b = getPlayerNametagColor(source) 
    return outputChatBox("#FF0000* [ Console ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) 
    else 
    end 
    if getElementData ( resourceRoot, "chat" ) == true then cancelEvent() return outputChatBox ("[C.Console]: Chat has been locked by Console ",source,255,0,0,true) end 
    if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Level 1")) then 
    cancelEvent() 
                local r, g, b = getPlayerNametagColor(source) 
                outputChatBox("#0099DC* [ Lv.1 ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) 
           elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Level 2")) then 
         cancelEvent() 
                local r, g, b = getPlayerNametagColor(source) 
                outputChatBox("#2554C7* [ Lv.2 ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) 
          
          
           elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Level 3")) then 
         cancelEvent() 
                local r, g, b = getPlayerNametagColor(source) 
                outputChatBox("#00cc11* [ Lv.3 ] " .. getPlayerName ( source ) ..": #ffFFff" .. text, getRootElement(), r, g, b, true ) 
          
          
           elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Level 4")) then 
         cancelEvent() 
                local r, g, b = getPlayerNametagColor(source) 
                outputChatBox("#007700* [ Lv.4 ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) 
          
          
           elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Level 5")) then 
         cancelEvent() 
                local r, g, b = getPlayerNametagColor(source) 
                outputChatBox("#cc0000* [ Lv.5 ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) 
          
          
           elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Level 6")) then 
         cancelEvent() 
                local r, g, b = getPlayerNametagColor(source) 
                outputChatBox("#FF0000* [ Lv.6 ] " .. getPlayerName ( source ) ..": #ffFFff" .. text, getRootElement(), r, g, b, true ) 
          
          
           elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Head.Admin")) then 
         cancelEvent() 
                local r, g, b = getPlayerNametagColor(source) 
                outputChatBox("#C11B17* [ Head.Admin ] " .. getPlayerName ( source ) ..": #ffFFff" .. text, getRootElement(), r, g, b, true ) 
          
          
         elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("V.I.P")) then 
         cancelEvent() 
                local r, g, b = getPlayerNametagColor(source) 
                outputChatBox("#DCD800* [ VIP ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) 
                
                
         elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("SaedAmer")) then 
         cancelEvent() 
                local r, g, b = getPlayerNametagColor(source) 
                outputChatBox("#cd0000* [ VIP ]#ffff00 سعيد : #ffFFff" .. text, getRootElement(), r, g, b, true ) 
                
                
        elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("mosp")) then 
         cancelEvent() 
                local r, g, b = getPlayerNametagColor(source) 
                outputChatBox("#02AB2F* [ AL-MLOok Event's] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) 
          
          
           elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Manager")) then 
         cancelEvent() 
                local r, g, b = getPlayerNametagColor(source) 
                outputChatBox("#347235* [ T-Developer ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) 
          
          
           elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin - Ex")) then 
         cancelEvent() 
                local r, g, b = getPlayerNametagColor(source) 
                outputChatBox("#777777* [ Admin - EX ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) 
          
          
           elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Police")) then 
         cancelEvent() 
                local r, g, b = getPlayerNametagColor(source) 
                outputChatBox("#007F7F* [ Soldier ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) 
          
          
           elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Everyone")) then 
         cancelEvent() 
                local r, g, b = getPlayerNametagColor(source) 
                outputChatBox("#5494A7* [ AL-MLOoK ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) 
                
          
        end 
        end 
         ) 

Link to comment
اذا مانت عارف تجلب الداتا وتتحقق منها

!!! شلون سويت المودات

Copy / Paste

1466806717851.jpg

انا ما قلت ما اعرف اجيب الداتا

بس ما اعرف اسوي تحقق منها و يكنسل الافنت :/

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...