Client
GUIEditor = {
edit = {},
button = {},
window = {},
label = {},
gridlist = {}
}
GUIEditor.window[1] = guiCreateWindow(222, 161, 403, 414, "[ تحدي الاعبين By DmAr ]", false)
guiSetVisible(GUIEditor.window[1],false)
guiWindowSetSizable(GUIEditor.window[1], false)
GUIEditor.gridlist[1]= guiCreateGridList ( 9, 21, 384, 299, false, GUIEditor.window[1] )
local rp = guiGridListAddColumn(GUIEditor.gridlist[1], "الاعب", 0.9)
local rp1 = guiGridListAddColumn(GUIEditor.gridlist[1], "بنق", 0.9)
GUIEditor.edit[1] = guiCreateEdit(9, 324, 295, 29, "20", false, GUIEditor.window[1])
guiEditSetReadOnly(GUIEditor.edit[1], true)
GUIEditor.label[1] = guiCreateLabel(305, 327, 92, 26, "العالم الرجاء", false, GUIEditor.window[1])
guiLabelSetColor(GUIEditor.label[1], 254, 1, 1)
GUIEditor.button[55] = guiCreateButton(9, 356, 174, 48, "ارسال", false, GUIEditor.window[1])
GUIEditor.button[2] = guiCreateButton(206, 356, 174, 48, "اغلاق", false, GUIEditor.window[1])
------------------------------
--By DmAr [Spar System]
------------------------------
function update ()
guiGridListClear(GUIEditor.gridlist[1])
for i,v in ipairs (getElementsByType("player")) do
local rp = guiGridListAddRow (GUIEditor.gridlist[1])
guiGridListSetItemText (GUIEditor.gridlist[1],rp,1,getPlayerName(v):gsub("#%x%x%x%x%x%x", ""),false,false)
end
end
addEventHandler ("onClientResourceStart",resourceRoot,update)
addEventHandler ("onClientPlayerJoin",root,update)
addEventHandler ("onClientPlayerChangeNick",root,update)
addEventHandler ("onClientPlayerQuit",root,update)
-----------
addEventHandler('onClientGUIClick',root,
function()
if source == GUIEditor.button[2] then
guiSetVisible(GUIEditor.window[1],false) showCursor(false)
end
end
)
----------
addEventHandler('onClientGUIClick',root,
function()
if source == GUIEditor.button[2] then
guiSetVisible(GUIEditor.window[10],false) showCursor(false)
end
end
)
-------------
markers = createMarker (1419,-1623.8000488281,14.5, "arrow", 1.5, 255, 255, 0, 170 )
addEventHandler("onClientMarkerHit",markers, --عند لمس الماركر المحدد
function()--وظيفة
guiSetVisible(GUIEditor.window[1],true)--تفتح اللوحة
showCursor(true) --نظهر الماوس
end --نهاية الوظيفة
)--نهاية قوس الحدث
---------------
addEventHandler("onClientGUIClick",root,
function ()
if source == GUIEditor.button[55] then
local sel = guiGridListGetSelectedItem( GUIEditor.gridlist[1] )
local Player = guiGridListGetItemText(GUIEditor.gridlist[1],sel,1)
if ( Player ~= -1 ) then
triggerServerEvent("Trigger", localPlayer,Player)
end
end
end
)
Server
addEvent ("Trigger",true)
addEventHandler ("Trigger",root,
function ( p )
local player = getPlayerFromName(p)
if ( player ) then
outputChatBox ( "#[Spar System]The Player Has Spar Join F8 gjoin", player, 0, 255, 0 )
end
end
)