-
Posts
1,304 -
Joined
-
Last visited
-
Days Won
5
Everything posted by Ahmed Ly
-
"onClientGUIClick" triggerServerEvent setElementModel
-
جرب marker = createMarker (223.19098, 1889.78125, 16.64063, "cylinder", 1.5, 255, 255, 0, 170 ) addEventHandler("onClientMarkerHit",marker, function(hitplayer) if hitplayer == localPlayer and getElementData(hitplayer, 'Group' ) == 'You Team' then guiSetVisible(W1,true) showCursor(true) end end )
-
marker = createMarker (223.19098, 1889.78125, 16.64063, "cylinder", 1.5, 255, 255, 0, 170 ) addEventHandler("onClientMarkerHit",marker, function(hitplayer) if ( hitplayer == localPlayer ) and getElementData(hitPlayer, 'Group' ) == 'You Team' then guiSetVisible(W1,true) showCursor(true) end end )
-
good job
- 28 replies
-
- mtasa
- legacy build
- (and 6 more)
-
+ getPlayerAccount isGuestAccount
-
guiCreateCheckBox "onClientGUIClick" guiCheckBoxGetSelected guiSetVisible
-
function login() if hasObjectPermissionTo(source,"command.mute") then exports.topbarchat:sendClientMessage("[AdminSystem]: * The administration has logged in. " .. getPlayerName(source) .. "| لقد قام الأدمن بستجيل دخوله.",root, 255,255,0) playSoundFrontEnd (root, 45 ) end -- The End of " if " end -- The End of " function login " addEventHandler("onPlayerLogin",root, login)
-
function login() if hasObjectPermissionTo(source,"command.mute") then outputChatBox("[AdminSystem]: * The administration has logged in. " .. getPlayerName(source) .. "| لقد قام الأدمن بستجيل دخوله.",root, 255,255,0, true) playSoundFrontEnd (root, 45 ) end -- The End of " if " end -- The End of " function login " addEventHandler("onPlayerLogin",root, login)
-
addEventHandler("onClientGUIClick",root, function() if source == GUIEditor.button[1] then triggerServerEvent("red",localPlayer) showCursor(false) end end )
-
Ok so I want to recreate the notification system from Rust: The problem is, I don't know how to make the DX Drawn rectangle move up and create a new one under, and after 2 new notifications, fade the top ones.. Like in the picture basically... So this is how I started it: dxDrawRectangle(s[1]*48/60, s[2]*28/35, s[1]*304/1700, s[2]*24/600 ,tocolor(114,140,69,150)) dxDrawText("Stone +5", s[1]*48/59.5, s[2]*28/17.35, s[1]*50/1440, s[2]*24/900, tocolor(192,192,192,210),1.2,"default-bold","left","center", false, true, false, false, false) Thanks.
-
addCommandHandler("kkk", function(playersource) if not isGuestAccount(getPlayerAccount(playersource)) then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(playersource)), aclGetGroup("Console")) then outputChatBox("*********************",playersource, 223, 202, 8, true ) else outputChatBox("xxxxxxxxxxxxxxxxxxxxx",playersource, 223, 202, 8, true ) end else outputChatBox("xxxxxxxxxxxxxxxxxxxxx",playersource, 223, 202, 8, true ) end end )
-
---Client key = "F6" --panelmoney = guiCreateWindow(817,135,392,412,"",false) local screenW, screenH = guiGetScreenSize() panelmoney = guiCreateWindow((screenW - 530) / 2, (screenH - 416) / 2, 530, 416, "", false) guiWindowSetSizable(panelmoney, false) guiSetVisible(panelmoney,false) zzz = guiCreateStaticImage(10, 11, 510, 395,"images/LK.png",false,panelmoney) gridlist = guiCreateGridList(3,49,145,342,false,zzz) players = guiGridListAddColumn(gridlist,"Player",9,0) sendmoney = guiCreateButton(369, 117, 119, 43,"ارسال",false,zzz) Closed = guiCreateButton(307, 335, 167, 46, "اغلاق", false, zzz) edit = guiCreateEdit(261, 203, 192, 37,"",false,zzz) labelmoney = guiCreateLabel(150,298,222,92,"BY LIBYA_FREE",false,zzz) guiLabelSetColor(labelmoney,255,0,0) imagemoneey = guiCreateStaticImage(215,2,93,70,"images/logo.png",false,zzz) function refresh () guiGridListClear ( gridlist ) for i,v in ipairs ( getElementsByType("player") ) do local aRow = guiGridListAddRow ( gridlist ) guiGridListSetItemText ( gridlist , aRow , players , getPlayerName ( v ) , false , false ) end end bindKey(key,"down", function ( ) guiSetVisible ( panelmoney , not guiGetVisible ( panelmoney ) ) showCursor ( guiGetVisible ( panelmoney ) ) guiSetInputEnabled ( guiGetVisible ( panelmoney ) ) refresh() end ); addEventHandler("onClientGUIClick",resourceRoot, function ( ) if (source == Closed) then guiSetVisible (panelmoney,false) showCursor ( false ) elseif ( source == sendmoney ) then local InfoSelected = { guiGridListGetSelectedItem ( gridlist ) }; if ( InfoSelected [ 1 ] ~= -1 and guiGetText ( edit ) ~= "" ) then triggerServerEvent("SendMoney",getLocalPlayer(),guiGridListGetItemText(gridlist,InfoSelected[1],players),guiGetText(edit)) else outputChatBox("اختر لاعب او قم بكتابة رقم",255,0,0,true) end end end ) ---server addEvent("SendMoney",true) addEventHandler("SendMoney",root, function ( aPlayer , aPrice ) if ( getPlayerFromName ( aPlayer ) and tonumber ( aPrice ) ) then if ( getPlayerFromName ( aPlayer ) == source ) then return outputChatBox("* لايمكنك ارسال الفلوس لنفسك !",source,255,0,0,true) end if ( getPlayerMoney ( source ) >= tonumber ( aPrice ) ) then givePlayerMoney ( getPlayerFromName ( aPlayer ) , tonumber ( aPrice ) ) takePlayerMoney ( source , tonumber ( aPrice ) ) else outputChatBox("* ليس لديك مبلغ كافي "..aPrice.."",source,255,0,0,true) end end end ) ---لوحة اف 5 addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor_Image = {} GUIEditor = { button = {} } local screenW, screenH = guiGetScreenSize() Control = guiCreateWindow((screenW - 767) / 2, (screenH - 507) / 2, 767, 507, "لوحة زوائد زروط ليبيا", false) Controll = guiCreateStaticImage(9,0,749,498,"images/rules.png",false,Control) GUIEditor_Image[1] = guiCreateStaticImage(224,4,325,275,"images/tarkep.png",false,Controll) button2 = guiCreateButton(3,212,233,63,"لوحة فتح ابواب السيارة",false,Controll) guiSetProperty(button2, "NormalTextColour", "FFE9F807") button8 = guiCreateButton(2,387,233,63,"لوحة حفط الملابس",false,Controll) guiSetProperty(button8, "NormalTextColour", "FFFF0000") button10 = guiCreateButton(4,295,233,63,"لوحة توب الدرفت",false,Controll) guiSetProperty(button10, "NormalTextColour", "FF01FAB7") button3 = guiCreateButton(536,295,233,63,"لوحة ارسال فلوس",false,Controll) guiSetProperty(button3, "NormalTextColour", "FFEA5B0D") button4 = guiCreateButton(534,385,233,63,"لوحة اختيار ليزر",false,Controll) guiSetProperty(button4, "NormalTextColour", "FF5AF505") button13 = guiCreateButton(533,218,233,63,"اغاني",false,Controll) guiSetProperty(button13, "NormalTextColour", "FFD7259A") guiSetVisible(Control,false) end ) bindKey("F5","down", function () guiSetVisible(Control,not guiGetVisible(Control)) showCursor(guiGetVisible(Control)) end) addEventHandler ("onClientGUIClick", root, function() if (source == button2) then guiSetVisible(Car, true) guiSetVisible(Control, false) elseif (source == button8) then guiSetVisible(Cj, true) guiSetVisible(Control, false) elseif (source == button10) then guiSetVisible(HD.wnd, true) guiSetVisible(Control, false) elseif (source == button3) then guiSetVisible(panelmoney, true) guiSetVisible(Control, false) elseif (source == button4) then guiSetVisible(laser, true) guiSetVisible(Control, false) elseif (source == button13) then guiSetVisible(window, true) guiSetVisible(Control, false) end end )
-
"onPlayerWasted" getPlayerAccount isGuestAccount getElementData getAccountName aclGroupAddObject aclGetGroup
-
-- server addEvent("Slap",true) addEventHandler("Slap",root, function(GetNameD,AAget) plr = getPlayerFromName(GetNameD) killPed(plr) outputChatBox(''..getPlayerName(plr).. 'Has Been Kicked From Game By' ..getPlayerName(source).. '(' ..AAget.. ')',root,255,255,0,true) end ) -- Client addEventHandler("onClientGUIClick",root, --- حدث عند الضغط علي الزر function() if source == GUIEditor.button[2] then -- غير اسم الزرار local GetNameD = guiGridListGetItemText ( GUIEditor.gridlist[1], guiGridListGetSelectedItem(GUIEditor.gridlist[1]), 1 ) --- غير اسم القريد لست if GetNameD ~= "" then local AAget = guiGetText(GUIEditor.edit[3]) --- هذي لو انت مسوي ايدت فيها السبب # if AAget ~= "" then triggerServerEvent ("Slap", localPlayer, GetNameD, AAget) end end end end )
-
استخدام cursorPosition -- dxDrawBorderedText -- function dxDrawBorderedText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, color2 ) local wh = 1 local msg_gsub = text if type(text) == 'string' then msg_gsub = text:gsub ( '#%x%x%x%x%x%x', '' ) end dxDrawText ( msg_gsub, x - wh, y - wh, w - wh, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) -- black dxDrawText ( msg_gsub, x + wh, y - wh, w + wh, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x - wh, y + wh, w - wh, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x + wh, y + wh, w + wh, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x - wh, y, w - wh, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x + wh, y, w + wh, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x, y - wh, w, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x, y + wh, w, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, color2 ) end function cursorPosition(x, y, w, h) if (not isCursorShowing()) then return false end local mx, my = getCursorPosition() local fullx, fully = guiGetScreenSize() cursorx, cursory = mx*fullx, my*fully if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then return true else return false end end --Event "onClientRender" -- مثال sx_, sy_ = guiGetScreenSize ( ) sx, sy = sx_ / 1280, sy_ / 720 function dxDrawBorderedText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, color2 ) local wh = 1 local msg_gsub = text if type(text) == 'string' then msg_gsub = text:gsub ( '#%x%x%x%x%x%x', '' ) end dxDrawText ( msg_gsub, x - wh, y - wh, w - wh, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) -- black dxDrawText ( msg_gsub, x + wh, y - wh, w + wh, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x - wh, y + wh, w - wh, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x + wh, y + wh, w + wh, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x - wh, y, w - wh, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x + wh, y, w + wh, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x, y - wh, w, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x, y + wh, w, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, color2 ) end font2 = dxCreateFont("Dragon.ttf",10) lol = { } function Dx () lol[1] = tocolor(0, 0, 0, 0) lol[2] = tocolor(0, 0, 0, 0) if ( cursorPosition(sx*343,sy*489,sx*94,sy*46) ) then lol[1] = tocolor(82,137,153) end if ( cursorPosition(sx*561,sy*489,sx*94,sy*46) ) then lol[2] = tocolor(82,137,153) end dxDrawLine(sx*282 - 1,sy*249 - 1,sx*282 - 1,sy*553, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*769,sy*249 - 1,sx*282 - 1,sy*249 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*282 - 1,sy*553,sx*769,sy*553, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*769,sy*553,sx*769,sy*249 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(sx*282,sy*249,sx*487,sy*304, tocolor(80, 173, 163, 87), false) dxDrawLine(sx*281 - 1,sy*248 - 1,sx*281 - 1,sy*282, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*769,sy*248 - 1,sx*281 - 1,sy*248 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*281 - 1,sy*282,sx*769,sy*282, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*769,sy*282,sx*769,sy*248 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(sx*281,sy*248,sx*488,sy*34, tocolor(58, 133, 196,255), false) dxDrawBorderedText("",sx*288,sy*329,sx*365,sy*376, tocolor(68, 34, 218, 254), 1.00,font2, "center", "center", false, false, false, true, false) dxDrawBorderedText("",sx*288,sy*390,sx*365,sy*437, tocolor(118, 43, 210, 255), 1.00,font2, "center", "center", false, false, false, true, false) dxDrawLine(sx*343 - 1,sy*489 - 1,sx*343 - 1,sy*535, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*437,sy*489 - 1,sx*343 - 1,sy*489 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*343 - 1,sy*535,sx*437,sy*535, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*437,sy*535,sx*437,sy*489 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(sx*343,sy*489,sx*94,sy*46,lol[1], false) dxDrawLine(sx*561 - 1,sy*489 - 1,sx*561 - 1,sy*535, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*655,sy*489 - 1,sx*561 - 1,sy*489 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*561 - 1,sy*535,sx*655,sy*535, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*655,sy*535,sx*655,sy*489 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(sx*561,sy*489,sx*94,sy*46,lol[2], false) dxDrawBorderedText("",sx*345,sy*492,sx*437,sy*535, tocolor(112, 217, 75, 247), 1.00,font2, "center", "center", false, false, false, true, false) dxDrawBorderedText("",sx*563,sy*492,sx*655,sy*535, tocolor(112, 217, 75, 247), 1.00,font2, "center", "center", false, false, false, true, false) dxDrawBorderedText("",sx*332,sy*252,sx*692,sy*277, tocolor(121, 216, 28, 255), 1.00,font2, "center", "center", false, false, false, true, false) dxDrawBorderedText(" ",sx*377,sy*377,sx*542,sy*390, tocolor(255, 255, 255, 255), 1.00,font2, "left", "top",false, false, false, true, true) end addEventHandler("onClientRender", root,Dx)
-
MMHHMM = dxCreateFont( "هنا اسم ملف الخط.ttf",9) local sX, sY = guiGetScreenSize () addEventHandler("onClientRender", root, function () if ( getElementData ( resourceRoot, "Have_" ) == true ) then local Lines = getChatboxLayout ()["chat_lines"] if ( Lines <= 10 ) then Lines = Lines + 1 elseif ( Lines >= 20 ) then Lines = Lines - 1 else Lines = Lines end if ( getElementData ( resourceRoot, "Msg_" ) == "1" ) then setElementData ( resourceRoot, "Have_", false ) else dxDrawText( "#FFBC00{ #FFBC00".. getElementData ( resourceRoot, "By_" ) .." #FFBC00} #FFFFFF : " .. getElementData ( resourceRoot, "Msg_" ), 17, 289, 251, 310, tocolor(255, 255, 255, 255), 1.4,MMHHMM, "left", "top", false, false, false, true, false ) end end end) bindKey("N", "down", "chatbox","BlackArabsMsg")
-
local Marker = createMarker ( 1570.43958, -1337.37134, 17.48438, "arrow" , 2 , 255 , 255 , 0 , 255 ) addEventHandler ("onMarkerHit",root, function ( player ) if getElementType ( player ) == "player" and not isPedInVehicle ( player ) then if source == Marker then setElementInterior (player, 40,389.48236, 174.05199, 1008.38281) end end end )
-
MMHHMM = dxCreateFont( "هنا اسم ملف الخط.ttf", ) local sX, sY = guiGetScreenSize () addEventHandler("onClientRender", root, function () if ( getElementData ( resourceRoot, "Have_" ) == true ) then local Lines = getChatboxLayout ()["chat_lines"] if ( Lines <= 10 ) then Lines = Lines + 1 elseif ( Lines >= 20 ) then Lines = Lines - 1 else Lines = Lines end if ( getElementData ( resourceRoot, "Msg_" ) == "1" ) then setElementData ( resourceRoot, "Have_", false ) else dxDrawText( "#FFBC00{ #FFBC00".. getElementData ( resourceRoot, "By_" ) .." #FFBC00} #FFFFFF : " .. getElementData ( resourceRoot, "Msg_" ), 17, 289, 251, 310, tocolor(255, 255, 255, 255), 1.4,MMHHMM, "left", "top", false, false, false, true, false ) end end end) bindKey("N", "down", "chatbox","BlackArabsMsg")
-
getElementPosition createObject attachElements
-
+ isGuestAccount getPlayerAccount getAccountName aclGetGroup
-
riggerServerEvent ( "Save", localPlayer ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == Button ) then local Text = guiGetText ( edit1 ) local Tezt2 = guiGetText ( edit2 ) local Text3 = guiGetText ( edit3 ) if Text == "" or Tezt2 == "" or Text3 == "" then return end triggerServerEvent ( "onSend", localPlayer,Text,Tezt2,Text3 ) end end ) addEvent ( "Accept", true ) addEventHandler ( "Accept", root, function (text1,text2,text3) row = guiGridListAddRow(GUIEditor.gridlist[4]) guiGridListSetItemText(GUIEditor.gridlist[4], row, 1,text1, false, false) guiGridListSetItemText(GUIEditor.gridlist[4], row, 2,text2, false, false) guiGridListSetItemText(GUIEditor.gridlist[4], row, 3,text3, false, false) end ) -- Server executeSQLQuery ("CREATE TABLE IF NOT EXISTS `ModsSystem` (Text,Tezt2,Text3)") addEvent ( "Save", true ) addEventHandler ( "Save", root, function ( ) local result = executeSQLQuery ( "SELECT * FROM `ModsSystem` " ) if ( type ( result ) == "table" and #result == 0 ) or not result then local text1 = result[1]["Text"] local text2 = result[1]["Tezt2"] local text3 = result[1]["Text3"] triggerClientEvent (source, "Accept", source, text1,text2,text3 ) end end ) addEvent ( "onSend", true ) addEventHandler ( "onSend", root, function ( Text,Tezt2,Text3 ) executeSQLQuery("INSERT INTO `ModsSystem` ( Text,Tezt2,Text3 ) VALUES ( ?, ?, ? )",Text,Tezt2,Text3) end )
