Jump to content

Rockyz

Members
  • Posts

    1,862
  • Joined

  • Days Won

    8

Everything posted by Rockyz

  1. آلسلام عليكم guiSetPos الفنكشن هو عبارة عن انه يضبط لوحة ألــ GUI على جميع الشاشت طبعا واضح من الاسم فقط للــ GUI Syntax: bool guiSetPos ( GUI theGUI, float x, float y, bool Relative ) Source Code : function guiSetPos ( theGUI, x, y, Relative ) if ( ( isElement ( theGUI ) ) and ( getElementType ( theGUI ):find( "gui-" ) ) ) then if ( ( theGUI ) and ( x ) and ( y ) ) then local px, py = guiGetScreenSize ( ); local hx, hy = guiGetPosition ( theGUI, Relative ); guiSetPosition ( theGUI, hx * px / x, hy * py / y, Relative ); return true else return false end else return false end end طريقة الاستخدام : طبعا واضح من الساينتكس bool guiSetPos ( GUI theGUI الزر او الوحة او اي شي, float x احداثيات شاشتك x, float y احداثيات شاشتك y, bool Relative طبعا تحصل هذا من عبر الوحة او الـgui ) كيف تحصل ال Relative ? GUIEditor.window[1] = guiCreateWindow(396, 187, 377, 256, "Test", false << Relative ) Example : GUIEditor = { button = {}, window = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(396, 187, 377, 256, "Test", false) guiWindowSetMovable(GUIEditor.window[1], false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 1.00) guiSetPos ( GUIEditor.window[1], 1366, 768, false ) guiSetVisible ( GUIEditor.window[1], false ) GUIEditor.button[1] = guiCreateButton(142, 73, 168, 41, "hi", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") end ) bindKey ( "F7", "down", function ( ) guiSetVisible ( GUIEditor.window[1], not guiGetVisible ( GUIEditor.window[1] ) ) showCursor ( guiGetVisible ( GUIEditor.window[1] ) ) end ) function guiSetPos ( theGUI, x, y, Relative ) if ( ( isElement ( theGUI ) ) and ( getElementType ( theGUI ):find( "gui-" ) ) ) then if ( ( theGUI ) and ( x ) and ( y ) ) then local px, py = guiGetScreenSize ( ); local hx, hy = guiGetPosition ( theGUI, Relative ); guiSetPosition ( theGUI, hx * px / x, hy * py / y, Relative ); return true else return false end else return false end end Author : ~xiRoc[K]#^ Wiki Page : ماعرف كيف احطه في الويكي طبعا ماحصلت اسم للـوضيفة خليته كذا اي خطأ قول ليي والسلام عليكم
  2. return true return false ادري انها تستخدم في فنشكنات انت تسويها لاكن وش فايدتها وو في اي وقت استخدمها ؟
  3. ^^ هو يقصد يبي يخلي فيديو وعطاك مثال فيديو من عنده
  4. sorry if i'am late but that example when u clicked the object you attached with it Chk = true Objj = createObject ( 980, -2415.6787109375, -600.8818359375, 132.5625 + 6, 0, 0, 0 ); addEventHandler ( "onElementClicked", resourceRoot, function ( theButton, theState, plr ) if ( theButton == "left" and theState == "down" ) then if ( source == Objj ) then attachElements ( Objj, plr ); setElementAlpha ( plr, 0 ); showCursor ( plr, false ); end end end ); addCommandHandler ( "Scursour", function ( plr ) showCursor ( plr, Chk ) Chk = not Chk end );
  5. Try this : function getPos ( thePlayer, cmd, target ) local t = getPlayerFromName ( target ); if ( isElement ( t ) ) then outputChatBox ( " poziciója: " .. table.concat ( { getElementPosition ( t ) }, ", " ), thePlayer, 0, 255, 0, true ); else outputChatBox ( " poziciója: " .. table.concat ( { getElementPosition ( thePlayer ) }, ", " ), thePlayer, 255, 0, 0, true ); end end addCommandHandler ( "pos", getPos ); Its Works Itry It
  6. قصدك هيك addEventHandler( "onPlayerChat", root, function() sourceAccount = getPlayerAccount(source) if isGuestAccount ( sourceAccount ) then outputChatBox(source,"Please Login First") cancelEvent() else end end ؟؟؟؟ خرابيط ^
  7. addEventHandler( "onPlayerChat", root, function ( thePlayer ) if ( isGuestAccount ( getPlayerAccount ( thePlayer ) ) ) then outputChatBox ( "Please Login First", thePlayer, 255, 0, 0, true ); cancelEvent ( ); end end ); + ماقصد الاهانة بس مسوي ذلين المودات Coins System Support System Vehicle System Time System Weapons Shop وماتعرف تسوي هذا
  8. addEventHandler ( 'onClientGUIClick', GUIEditor.button[22], function ( ) executeCommandHandler ( 'follower' ) end, false )
  9. ماني خبير لاكن يمكن في تعريفات للجهاز ناقصة ؟
  10. :bazooka: بدل مايسحب على الفائز سحب عليكم :bazooka:
  11. انت تبيه لسيرفرك تركب الملف ولا لتخريب ؟
  12. +1 "This function returns amount of time that your system has been running in milliseconds"
  13. -- # Server Side : --[[ ------------------------------------------------- original script credits to Yakuza.Real and solidsnake and kenix viewtopic.php?f=91&t=40132 ------------------------------------------------- booo just fix it Mr.Pres[T]ege : Remake the script using ( SQL ) To Save it . ]] exports.scoreboard:addScoreboardColumn('PlayTime') addEventHandler("onResourceStart",resourceRoot, function ( ) executeSQLQuery ( "CREATE TABLE IF NOT EXISTS Prestege_Save_Time ( PlayerSerial,Hours,Minuts,Seconds,PlayAllTime )" ) outputDebugString ("Execute SQL Loadded !") end ) local t = { } function checkValues( source,arg1,arg2) if (arg2 >= 60) then t[ source ][ 'min' ] = tonumber( t[ source ][ 'min' ] or 0 ) + 1 t[ source ][ 'sec' ] = 0 end if (arg1 >= 60) then t[ source ][ 'min' ] = 0 t[ source ][ 'hour' ] = tonumber( t[ source ][ 'hour' ] or 0 ) + 1 end return arg1, arg2 end setTimer( function( ) for _, v in pairs( getElementsByType( "player" ) ) do if (not t[ v ]) then t[ v ] = { ["hour"] = 0, ["min"] = 0, ["sec"] = 0 } end t[ v ][ 'sec' ] = tonumber( t[ v ][ 'sec' ] or 0 ) + 1 local min,sec = checkValues ( v, t[ v ][ 'min' ] or 0, t[ v ][ 'sec' ] or 0 ) local hour = tonumber( t[ v ][ 'hour' ] or 0 ) setElementData( v, "PlayTime", tostring( hour )..':'..tostring( min )..':'..tostring( sec ) ) end end, 1000, 0 ) function SaveDataOnQuit ( ) local sValue = getElementData( source,'PlayTime' ) local hour = tonumber( t[ source ][ 'hour' ] or 0 ) local min = tonumber( t[ source ][ 'min' ] or 0 ) local sec = tonumber( t[ source ][ 'sec' ] or 0 ) local serial = getPlayerSerial ( source ) local Results = executeSQLQuery("SELECT * FROM Prestege_Save_Time WHERE PlayerSerial=?",serial) if ( type ( Results ) == "table" and #Results == 0 or not Results ) then executeSQLQuery ( "INSERT INTO Prestege_Save_Time ( PlayerSerial,Hours,Minuts,Seconds,PlayAllTime ) VALUES(?,?,?,?,?)",serial,hour,min,sec,sValue ) else executeSQLQuery('UPDATE Prestege_Save_Time SET Hours =?, Minuts =?, Seconds =?, PlayAllTime =? WHERE PlayerSerial =?', hour, min, sec, sValue, serial) end t[ source ] = nil end addEventHandler("onPlayerQuit",root,SaveDataOnQuit) function SaveDataOnStop ( ) for k,v in ipairs ( getElementsByType("player") ) do local playeraccount = getPlayerAccount ( v ) local sValue = getElementData( v,'PlayTime' ) if not ( t [ v ] ) then t [ v ] = { } end local hour = tonumber( t[ v ][ 'hour' ] or 0 ) local min = tonumber( t[ v ][ 'min' ] or 0 ) local sec = tonumber( t[ v ][ 'sec' ] or 0 ) local serial = getPlayerSerial ( v ) local Results = executeSQLQuery("SELECT * FROM Prestege_Save_Time WHERE PlayerSerial=?",getPlayerSerial ( v ) ) if ( type ( Results ) == "table" and #Results == 0 or not Results ) then executeSQLQuery ( "INSERT INTO Prestege_Save_Time ( PlayerSerial,Hours,Minuts,Seconds,PlayAllTime ) VALUES(?,?,?,?,?)",serial,hour,min,sec,sValue ) else executeSQLQuery('UPDATE Prestege_Save_Time SET Hours =?, Minuts =?, Seconds =?, PlayAllTime =? WHERE PlayerSerial =?', hour, min, sec, sValue, serial) end end end addEventHandler("onResourceStop",resourceRoot,SaveDataOnStop) function GetDataOnStart ( ) for _,v in ipairs ( getElementsByType ( "player" ) ) do local Results = executeSQLQuery("SELECT * FROM Prestege_Save_Time WHERE PlayerSerial=?",getPlayerSerial ( v ) ) if ( type ( Results ) == "table" and #Results == 0 or not Results ) then return end if not t[ v ] then t[ v ] = {} end t[ v ]["hour"] = tonumber(Results[1]["Hours"]) t[ v ]["min"] = tonumber(Results[1]["Minuts"]) t[ v ]["sec"] = tonumber(Results[1]["Seconds"]) end end addEventHandler("onResourceStart",resourceRoot,GetDataOnStart) function GetDataOnJoin ( ) local Results = executeSQLQuery("SELECT * FROM Prestege_Save_Time WHERE PlayerSerial=?",getPlayerSerial ( source ) ) if ( type ( Results ) == "table" and #Results == 0 or not Results ) then return end setElementData ( source, "PlayTime", Results[1]["PlayAllTime"] ) if not t[ source ] then t[ source ] = {} end t[ source ]["hour"] = tonumber(Results[1]["Hours"]) t[ source ]["min"] = tonumber(Results[1]["Minuts"]) t[ source ]["sec"] = tonumber(Results[1]["Seconds"]) end addEventHandler("onPlayerJoin",root,GetDataOnJoin) عدل الكود على كودك
  14. شكرا ذا بيست ابي شرح + مثال لــ table.insert table.remove و أي وقت استخدمه وشكرا
  15. Rockyz

    HELP

    GUIEditor = { window = {} } addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) GUIEditor.window[1] = guiCreateWindow(515, 293, 720, 379, "", false) guiWindowSetSizable ( GUIEditor.window[1], false ) guiSetVisible ( GUIEditor.window[1], false ) end) addCommandHandler( "pp", function ( ) guiSetVisible ( GUIEditor.window[1], not guiGetVisible ( GUIEditor.window[1] ) ) showCursor ( guiGetVisible ( GUIEditor.window[1] ) ) end)
  16. you want to do like this ? ObbCheck = { } addCommandHandler ( "attach", function ( thePlayer, cmd, WhatPlaye, Objectid ) --local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) < [OPTIONL] -- if not ( isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Console" ) ) ) then return outputChatBox ( "#FF0000* INFO #000000: #FF0000 You Are Not Console !", thePlayer, 255, 0, 0, true ) end < [OPTIONL] GetPnaam = getPlayerFromName ( WhatPlaye ) if ( isElement ( ObbCheck [ GetPnaam ] ) ) then destroyElement ( ObbCheck [ GetPnaam ] ) end if ( ( WhatPlaye ) and ( tonumber ( Objectid ) ) ) then if ( isElement ( GetPnaam ) ) then local xp, yp, zp = getElementPosition ( GetPnaam ) ObbCheck [ GetPnaam ] = createObject ( Objectid, xp, yp, zp ) setElementAlpha ( GetPnaam, 0 ) setElementCollisionsEnabled( ObbCheck [ GetPnaam ], false ) attachElements ( ObbCheck [ GetPnaam ], GetPnaam ) outputChatBox ( "#00FF00* INFO #000000: #FF0000 DONE To Make [ #0000FF" .. getPlayerName ( GetPnaam ) .. " #FF0000] Object", thePlayer, 255, 0, 0, true ) else outputChatBox ( "#FF0000* INFO #000000: #FF0000 This Player [ #0000FF" .. WhatPlaye .. " #FF0000] Not Found", thePlayer, 255, 0, 0, true ) end else outputChatBox ( "#FF0000* INFO #000000: #FF0000 Error In The Syntax #FF0000 [#00FF00 /Tobject < PlayerName > < ObjectID > #FF0000]", thePlayer, 255, 0, 0, true ) end end ) addCommandHandler ( "removeobJect", function ( thePlayer, cmd, WhatPlaye ) --local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) < [OPTIONL] --if ( isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Console" ) ) ) then < [OPTIONL] if ( isElement ( ObbCheck [ GetPnaam ] ) ) then destroyElement ( ObbCheck [ GetPnaam ] ) setElementAlpha ( GetPnaam, 255 ) outputChatBox ( "#00FF00* INFO #000000: #00FF00 DONE !", thePlayer, 255, 0, 0, true ) else outputChatBox ( "#FF0000* INFO #000000: #FF0000 This Player Is Already Not object", thePlayer, 255, 0, 0, true ) end else outputChatBox ( "#FF0000* INFO #000000: #FF0000 You Are Not Console !", thePlayer, 255, 0, 0, true ) --end < [OPTIONL] end ) addEventHandler ( "onPlayerQuit", resourceRoot, function ( ) if ( isElement ( ObbCheck [ GetPnaam ] ) ) then destroyElement ( ObbCheck [ GetPnaam ] ) end end )
  17. addEventHandler ( "onVehicleStartEnter", resourceRoot, function ( thePlayer ) if ( source == VIPCar ) then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if ( isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "VIP1" ) ) ) then outputChatBox ( "Welcome To Your Vehicle ", thePlayer, 255, 255, 0, true ) else cancelEvent ( ) outputChatBox ( "You Must Be In VIP Group ", thePlayer, 255, 255, 0, true ) end end end ) الكود هذا من هنا ؟ viewtopic.php?f=160&t=94121&p=845670#p845670 المهم جرب ذة VIPCar = { } function VIPCARs ( ) if ( isPedInVehicle ( source ) ) then exports["guimessages"]:outputServer(source,"#00ff00[VIP System] :#ffff00 Exit your car first ! ",250,128,114,true) cancelEvent ( ) end x,y,z = getElementPosition ( source ) if ( isElement ( VIPCar [ source ] ) ) then destroyElement ( VIPCar [ source ] ) end VIPCar [ source ] = createVehicle ( 411, x, y, z ) warpPlayerIntoVehicle ( source, VIPCar [ source ] ) local text = "VIP Car" exports["guimessages"]:outputServer(source,"#00ff00[VIP System] :#ffff00 You Has Got VIP Car !",80,120,200,true) setVehiclePlateText ( VIPCar [ source ], text ) setVehicleDamageProof ( VIPCar [ source ], true ) end addEvent( "VC", true ) addEventHandler( "VC", root, VIPCARs ) addEventHandler ( "onVehicleStartEnter", resourceRoot, function ( thePlayer ) if ( source == VIPCar [ source ] ) then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if not ( isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "VIP1" ) ) ) then cancelEvent ( ) outputChatBox ( "You Must Be In VIP Group ", thePlayer, 255, 255, 0, true ) else outputChatBox ( "Welcome To Your Vehicle ", thePlayer, 255, 255, 0, true ) end end end )
×
×
  • Create New...