Jump to content

iPrestege

Members
  • Posts

    10,056
  • Joined

  • Last visited

  • Days Won

    27

Everything posted by iPrestege

  1. بقى آحد مأطرح كودهـ؟
  2. local marker = createMarker ( 2473.8999023438, -1682.9000244141, 13.39999961853, "cylinder", 2, 255, 0, 0, 255 ) function PlayerGo(player) if getElementType(player) == "player" then setElementPosition(player, 1541.3000488281, -2475.1999511719, 4091.5); giveWeapon(player,46,1,true); outputChatBox("(لا تخف انت في نطة فيليكس حيث لا مجال للعودة)",player,255,255,0,true); end; end; addEventHandler("onMarkerHit", marker, PlayerGo)
  3. Note: This function is protected by default and must be explicitly allowed in the servers acl before it can be used.
  4. أكيد تقدر بس لازم تدمج اللوحة بالادمنية + تسوية SQL or XML يحفظ حاله الزر و لازم تجيب كل القروبات ( : * شغلة مآهي بسيطة لـ مبتدئين وتأخذ شوية وقت
  5. سوي لوحة مربوطة بالادمنية نفسها واستخدم هـ الوظيفة وجيب كل القروبات اللي بالروم وافتح وقفل على كيفك أفضل لك الاسل من القروشة ذذذ
  6. تقدر تسوية بـ استخدامم guiSetEnabled
  7. -- Server side -- addEventHandler ( 'onPlayerJoin', root, function ( ) setCameraMatrix (source,-2521.88671875, 339.87979125977, 35.094898223877, -2520.9926757813, 340.20202636719, 35.406051635742, 70, 0 ); end ); setCameraTarget سوية كلنت سايد يوم يشتغل ريسورس روت وبس # -- Client -- addEventHandler ( 'onClientResourceStart',resourceRoot, function ( ) setCameraTarget(localPlayer); end );
  8. Never gets this error!
  9. اطرح التعديل اللي سويتة كلة ورني اياهـ ذذ بالكلنت و السيرفر بـ حيث آختبرهم
  10. الكود يتوجب اشياء من ملفات الفري روم مثل النوافذ لها اكواد و وظائف خاصة + الترايقر والخ فـ اذا انت فاضي طلعه < # > أهم ملفين UTIL.lua GUI.lua fr_client.lua map.png #
  11. if isObjectInACLGroup( 'user.'..getAccountName( acc ), aclGetGroup( "Console" ) ) or isObjectInACLGroup( 'user.'..getAccountName( acc ), aclGetGroup( "Scripter" ) ) then
  12. ok full script client : GUIEditor = { gridlist = {}, button = {}, label = {}, edit = {}, } Main = {} Add = {} Main.Wnd = guiCreateWindow(393, 195, 594, 325, "Protection System Accounts ", false); guiSetVisible(Main.Wnd,false); guiWindowSetSizable(Main.Wnd, false); guiSetAlpha(Main.Wnd, 1.00); guiSetProperty(Main.Wnd, "CaptionColour", "FF00EFFF"); GUIEditor.gridlist[1] = guiCreateGridList(9, 23, 577, 233, false, Main.Wnd); guiGridListAddColumn(GUIEditor.gridlist[1], "#", 0.3); guiGridListAddColumn(GUIEditor.gridlist[1], "Account", 0.3); guiGridListAddColumn(GUIEditor.gridlist[1], "Serial", 0.3); GUIEditor.button[1] = guiCreateButton(25, 274, 124, 25, "Manage Account's", false, Main.Wnd); guiSetFont(GUIEditor.button[1], "default-bold-small"); guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF03ACFB"); GUIEditor.button[2] = guiCreateButton(226, 274, 150, 27, "Delete Selected Account", false, Main.Wnd); guiSetFont(GUIEditor.button[2], "default-bold-small"); guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFEFFE00"); GUIEditor.button[3] = guiCreateButton(493, 293, 91, 22, "Close Window", false, Main.Wnd); guiSetFont(GUIEditor.button[3], "default-bold-small"); guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFFE0000"); GUIEditor.label[1] = guiCreateLabel(421, 268, 159, 21, "Created By : Mr.Pres[T]ege", false, Main.Wnd); guiSetFont(GUIEditor.label[1], "default-bold-small"); guiLabelSetColor(GUIEditor.label[1], 41, 254, 0); Add.Wnd = guiCreateWindow(512, 327, 303, 219, "Protection System Accounts ( Add Account )", false); guiSetVisible(Add.Wnd,false); guiWindowSetSizable(Add.Wnd, false); guiSetAlpha(Add.Wnd, 1.00); guiSetProperty(Add.Wnd, "CaptionColour", "FF00B3FE"); GUIEditor.label[2] = guiCreateLabel(9, 22, 327, 25, "To Add account please full all the spaces :", false, Add.Wnd); guiSetFont(GUIEditor.label[2], "default-bold-small"); guiLabelSetColor(GUIEditor.label[2], 254, 0, 0); GUIEditor.label[3] = guiCreateLabel(7, 52, 267, 20, "The name of the account to be protected :", false, Add.Wnd); guiSetFont(GUIEditor.label[3], "default-bold-small"); guiLabelSetColor(GUIEditor.label[3], 233, 254, 0); Account = guiCreateEdit(9, 74, 266, 24, "", false, Add.Wnd); GUIEditor.label[4] = guiCreateLabel(10, 108, 267, 20, "The serial of the account to be protected :", false, Add.Wnd); guiSetFont(GUIEditor.label[4], "default-bold-small"); guiLabelSetColor(GUIEditor.label[4], 233, 254, 0); Serial = guiCreateEdit(10, 138, 266, 24, "", false, Add.Wnd); GUIEditor.button[4] = guiCreateButton(9, 173, 284, 28, "Protect the account!", false, Add.Wnd); guiSetFont(GUIEditor.button[4], "default-bold-small"); guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FF66F805"); addEventHandler("onClientGUIClick",root, function ( ) local Serial = guiGetText(Serial) local Account = guiGetText(Account); local row = guiGridListGetSelectedItem(GUIEditor.gridlist[1]) if ( source == GUIEditor.button[1] ) then guiBringToFront(Add.Wnd); guiSetVisible(Add.Wnd,true); showCursor(true); elseif ( source == GUIEditor.button[2] ) then if ( guiGridListGetSelectedItem(GUIEditor.gridlist[1]) == -1 ) then return outputChatBox("* Please Choose Account To Remove it!",255,0,0,true) end; triggerServerEvent("RemoveAccount",localPlayer,Serial,Account,row); elseif ( source == GUIEditor.button[3] ) then guiSetVisible(Main.Wnd,false); showCursor(false); elseif ( source == GUIEditor.button[4] ) then if ( Serial == "" or Serial == " " or Serial == " " or Account == "" or Account == " " or Account == " ") then return outputChatBox("* Check All Spaces !",255,0,0,true); end; triggerServerEvent("AddNewAccount",localPlayer,Serial,Account); guiSetVisible(Add.Wnd,false); end; end ); addEvent ( "AddDataSerialAccount", true ) addEventHandler ( "AddDataSerialAccount", root, function ( Serial,Account ) local row = guiGridListAddRow ( GUIEditor.gridlist[1] ) local count = guiGridListGetRowCount ( GUIEditor.gridlist[1] ) + 1 guiGridListSetItemText( GUIEditor.gridlist[1], row, 1,''..count..'-',false,false ); guiGridListSetItemText ( GUIEditor.gridlist[1], row, 3, tostring ( Serial ), false, false ); guiGridListSetItemText ( GUIEditor.gridlist[1], row, 2, tostring ( Account ), false, false ); guiGridListSetItemColor ( GUIEditor.gridlist[1], row, 1, 255, 255, 0 ); guiGridListSetItemColor ( GUIEditor.gridlist[1], row, 2, 255, 0, 0 ); guiGridListSetItemColor ( GUIEditor.gridlist[1], row, 3, 0, 255, 0 ); end ); addEvent ( "AddSerialName", true ) addEventHandler ( "AddSerialName", root, function ( onClientSqlList ) guiGridListClear ( GUIEditor.gridlist[1] ) for k, v in ipairs ( onClientSqlList ) do row = guiGridListAddRow ( GUIEditor.gridlist[1] ) guiGridListSetItemText ( GUIEditor.gridlist[1], row, 1, tostring ( ''..k..'-' ), false, false ) guiGridListSetItemText ( GUIEditor.gridlist[1], row, 3, tostring ( v.Serial ), false, false ) guiGridListSetItemText ( GUIEditor.gridlist[1], row, 2, tostring ( v.Account ), false, false ) guiGridListSetItemColor ( GUIEditor.gridlist[1], row, 1, 255, 255, 0 ) guiGridListSetItemColor ( GUIEditor.gridlist[1], row, 2, 255, 0, 0 ) guiGridListSetItemColor ( GUIEditor.gridlist[1], row, 3, 0, 255, 0 ) end end ) addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) triggerServerEvent ( "Rferesh", localPlayer ); end ); addEvent( 'LogOutSetVisible', true ) addEventHandler( 'LogOutSetVisible', root, function() if guiGetVisible(Main.Wnd) then guiSetVisible( Main.Wnd, false ); showCursor( false ); end; end ); addEvent ( "RemoveAccountFromClient" , true) addEventHandler ( "RemoveAccountFromClient:" ,root, function ( row ) guiGridListRemoveRow ( GUIEditor.gridlist[1], tonumber( row ) ) end ) bindKey("F10","down", function ( ) if getElementData(localPlayer,"isAdmin") == true then guiSetVisible(Main.Wnd,not guiGetVisible(Main.Wnd)); showCursor(not isCursorShowing()); else outputChatBox("* Access Denied!",255,0,0,true); end; end ); server : addEventHandler ( "onResourceStart", resourceRoot, function ( ) executeSQLQuery ( "CREATE TABLE IF NOT EXISTS Protection_System (Serial,Account)" ); outputDebugString("SQL Protection_System Loaded!!",0,0,255,0,0); for i, player in ipairs( getElementsByType( 'player' ) ) do if isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( "Console" ) ) then setElementData( player, 'isAdmin', true); else setElementData( player, 'isAdmin', nil); end end end ); function setProtection_System ( Serial,Account ) return executeSQLQuery ( "INSERT INTO `Protection_System` ( `Serial`, `Account` ) VALUES ( ?,? )", tostring(Account),tostring(Serial) ); end; function SelectFromSql ( ) local data = executeSQLQuery ( "SELECT * FROM Protection_System" ) if ( type ( data ) == "table" and #data == 0) or not data then return { }; else return data; end; end; function UpDateListInSql ( element ) if ( not isElement ( element ) ) then return; end; local Upsql = SelectFromSql ( ); triggerClientEvent ( element, "AddSerialName", element, Upsql ); end; addEvent ( "Rferesh", true ) addEventHandler ( "Rferesh", root, function ( ) UpDateListInSql ( source ); end ) addEvent ( "AddNewAccount", true ) addEventHandler ( "AddNewAccount", root, function ( Serial,Account ) setProtection_System ( Serial,Account ); triggerClientEvent ( root, "AddDataSerialAccount", root,Serial,Account ); end ); addEvent("RemoveAccount", true) addEventHandler("RemoveAccount", root, function(Serial,Account,row) if executeSQLQuery("DELETE FROM `Protection_System` WHERE `Serial` = '" .. tostring(Serial) .. "' AND Account = '" .. tostring(Account) .. "'") then triggerClientEvent("RemoveAccountFromClient",root,tonumber(row)) end; end ) addEventHandler( 'onPlayerLogin', root, function( _, acc ) if isObjectInACLGroup( 'user.'..getAccountName( acc ), aclGetGroup( "Console" ) ) then setElementData( source, 'isAdmin', true); else setElementData( source, 'isAdmin', nil); end; end ); addEventHandler( 'onPlayerLogout', root, function( _, acc ) triggerClientEvent( source,'LogOutSetVisible',root); setElementData( source, 'isAdmin', nil); end ); Can you tell me what's the problem?
  13. I do not think this is because I've try it this way and did not succeed, but what's the problem in my script it works SolidSnake has fix it , but I do not know what's the problem now this really boring me and stop my work -_-"!
  14. addEventHandler("onClientGUIClick",root, function ( ) local Serial = guiGetText(Serial) local Account = guiGetText(Account); local row = guiGridListGetSelectedItem(GUIEditor.gridlist[1]) if ( source == GUIEditor.button[1] ) then guiBringToFront(Add.Wnd); guiSetVisible(Add.Wnd,true); showCursor(true); elseif ( source == GUIEditor.button[2] ) then if ( guiGridListGetSelectedItem(GUIEditor.gridlist[1]) == -1 ) then return outputChatBox("* Please Choose Account To Remove it!",255,0,0,true) end; triggerServerEvent("RemoveAccount",localPlayer,Serial,Account,row); elseif ( source == GUIEditor.button[3] ) then guiSetVisible(Main.Wnd,false); showCursor(false); elseif ( source == GUIEditor.button[4] ) then if ( Serial == "" or Serial == " " or Serial == " " or Account == "" or Account == " " or Account == " ") then return outputChatBox("* Check All Spaces !",255,0,0,true); end; triggerServerEvent("AddNewAccount",localPlayer,Serial,Account); guiSetVisible(Add.Wnd,false); end; end );
×
×
  • Create New...