Jump to content

#Edit My Script | تعديل على مودي فية كم اخطاء


Recommended Posts

آلسسلآم عليكم

اليوم سويت لوحة بسيطة فيها طيران للسيارة وسلآب إلخ إلخ ..

بس لما سويته مع مساعدة بعض المبرمجين المحترفين

بس تفتح ماتقفل .. مادري شنو المشكلة

هذا الكود كآمـل

-- Client side 
GUIEditor = { 
  
window = {  } 
  
} 
    
        GUIEditor.window[1] = guiCreateWindow(420, 190, 361, 182, "::Panel x6lbat::", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        give = guiCreateButton(21, 47, 93, 33, "Give Car", false, GUIEditor.window[1]) 
        take = guiCreateButton(134, 47, 93, 33, "Destroy Car", false, GUIEditor.window[1]) 
        kill = guiCreateButton(247, 47, 93, 33, "Slap", false, GUIEditor.window[1]) 
        health = guiCreateButton(21, 123, 93, 33, "100 Health", false, GUIEditor.window[1]) 
        armor = guiCreateButton(134, 123, 93, 33, "100 Armor", false, GUIEditor.window[1]) 
        fly = guiCreateButton(247, 123, 93, 33, "Fly Car", false, GUIEditor.window[1])     
  
  
  
addEventHandler("onClientGUIClick",resourceRoot, 
function (  ) 
  
if ( source == health ) then 
  
setElementHealth( localPlayer , 100 ) 
  
outputChatBox("Done 100 Health",255,24,21,true) 
  
elseif ( source == armor ) then 
  
triggerServerEvent ("Give_Ar", localPlayer ) 
  
elseif ( source == kill ) then 
  
setElementHealth ( localPlayer ,0 ) 
  
outputChatBox("Done Kill",255,24,21,true) 
  
elseif ( source == fly ) then 
  
setWorldSpecialPropertyEnabled("aircars", true) 
  
outputChatBox("You Can Fly know !!",253,35,32) 
  
elseif ( source == take ) then 
  
triggerServerEvent( "DestroyMyCar",localPlayer ) 
  
elseif ( source == give ) then 
        
triggerServerEvent ( "GiveVehicle", localPlayer ) 
  
    end 
end 
    ) ; 
     
    -- Open Panel  
     
function Open() 
guiSetVisible (GUIEditor.window[1],not guiGetVisible(GUIEditor.window[1])) 
(guiGetVisible(GUIEditor.window[1])) 
showCursor (guiGetVisible(GUIEditor.window[1])) 
end 
bindKey("x", "down", Open) 
  

-- server side  
addEvent("Give_Ar",true) 
addEventHandler("Give_Ar",root, 
  
function(   ) 
  
    if getPedArmor ( source ) == 100 then return end 
  
    setPedArmor ( source , 100 ) 
  
    end  
    ) ; 
    
local table = { } 
  
local TheCarID = 411 
  
addEvent("GiveVehicle",true) 
  
addEventHandler("GiveVehicle",root, 
  
function(   ) 
  
    if isElement ( table[ source ] ) then destroyElement ( table[ source ] ) end 
  
    PosX , PosY , PosZ = getElementPosition ( source ) 
        
    table[ source ] = createVehicle( TheCarID , PosX , PosY , PosZ ) 
        
    warpPedIntoVehicle( source , table[ source ] ) 
        
    end  
    ) ; 
  
    
addEvent("DestroyMyCar",true) 
  
addEventHandler("DestroyMyCar",root, 
  
function(   ) 
  
    if isElement ( table[ source ] ) then destroyElement ( table[ source ] ) end    
  
    end  
    ) ; 
  
  
addEventHandler('onPlayerQuit',root, function ( ) 
  
if isElement ( table[ source ] ) then destroyElement ( table[ source ] ) end 
  
  
    end 
    ) ; 
  

ومشكورين ع المساعدة مسبقاً

Link to comment
-- Client side 
GUIEditor = { 
  
window = {  } 
  
} 
    
        GUIEditor.window[1] = guiCreateWindow(420, 190, 361, 182, "::Panel x6lbat::", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        give = guiCreateButton(21, 47, 93, 33, "Give Car", false, GUIEditor.window[1]) 
        take = guiCreateButton(134, 47, 93, 33, "Destroy Car", false, GUIEditor.window[1]) 
        kill = guiCreateButton(247, 47, 93, 33, "Slap", false, GUIEditor.window[1]) 
        health = guiCreateButton(21, 123, 93, 33, "100 Health", false, GUIEditor.window[1]) 
        armor = guiCreateButton(134, 123, 93, 33, "100 Armor", false, GUIEditor.window[1]) 
        fly = guiCreateButton(247, 123, 93, 33, "Fly Car", false, GUIEditor.window[1])     
  
  
  
addEventHandler("onClientGUIClick",resourceRoot, 
function (  ) 
  
if ( source == health ) then 
  
setElementHealth( localPlayer , 100 ) 
  
outputChatBox("Done 100 Health",255,24,21,true) 
  
elseif ( source == armor ) then 
  
triggerServerEvent ("Give_Ar", localPlayer ) 
  
elseif ( source == kill ) then 
  
setElementHealth ( localPlayer ,0 ) 
  
outputChatBox("Done Kill",255,24,21,true) 
  
elseif ( source == fly ) then 
  
setWorldSpecialPropertyEnabled("aircars", true) 
  
outputChatBox("You Can Fly know !!",253,35,32) 
  
elseif ( source == take ) then 
  
triggerServerEvent( "DestroyMyCar",localPlayer ) 
  
elseif ( source == give ) then 
        
triggerServerEvent ( "GiveVehicle", localPlayer ) 
  
    end 
end 
    ) ; 
    
    -- Open Panel 
    
function Open() 
guiSetVisible (GUIEditor.window[1],not guiGetVisible(GUIEditor.window[1])) 
showCursor (guiGetVisible(GUIEditor.window[1])) 
end 
bindKey("x", "down", Open) 
  

بدل ملف الكلنت بذا

Link to comment

تفضل شغال 100% تمت التجربه

-- Client Side

GUIEditor = { window = {  } } 
    
addEventHandler ( "onClientResourceStart", resourceRoot, function (    ) 
        GUIEditor.window[1] = guiCreateWindow(420, 190, 361, 182, "::Panel x6lbat::", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetVisible ( GUIEditor.window[1], false ) 
        give = guiCreateButton(21, 47, 93, 33, "Give Car", false, GUIEditor.window[1]) 
        take = guiCreateButton(134, 47, 93, 33, "Destroy Car", false, GUIEditor.window[1]) 
        kill = guiCreateButton(247, 47, 93, 33, "Slap", false, GUIEditor.window[1]) 
        health = guiCreateButton(21, 123, 93, 33, "100 Health", false, GUIEditor.window[1]) 
        armor = guiCreateButton(134, 123, 93, 33, "100 Armor", false, GUIEditor.window[1]) 
        fly = guiCreateButton(247, 123, 93, 33, "Fly Car", false, GUIEditor.window[1])     
end ) 
  
bindKey ( "x", "down", function (   ) 
      guiSetVisible ( GUIEditor.window[1], not guiGetVisible ( GUIEditor.window[1] ) ) 
      showCursor ( guiGetVisible ( GUIEditor.window[1] ) ) 
end ) 
  
addEventHandler ( "onClientGUIClick", resourceRoot, 
function (    ) 
    if ( source == health ) then 
        triggerServerEvent ( "Give_He", localPlayer ) 
    elseif ( source == armor ) then 
        triggerServerEvent ( "Give_Ar", localPlayer ) 
    elseif ( source == kill ) then 
        triggerServerEvent ( "playerkill", localPlayer ) 
    elseif ( source == fly ) then 
        setWorldSpecialPropertyEnabled ( "aircars", true ) 
        outputChatBox ( "You Can Fly know !!", 255, 255, 255, true ) 
    elseif ( source == take ) then 
        triggerServerEvent( "DestroyMyCar",localPlayer ) 
    elseif ( source == give ) then 
        triggerServerEvent ( "GiveVehicle", localPlayer ) 
    end 
end ) 

-- Server Side

local table = {    }; 
  
addEvent ( "Give_Ar", true ) 
addEventHandler ( "Give_Ar", root, 
function (    ) 
    if ( getPedArmor ( source ) == 100 ) then return end 
        setPedArmor ( source, 100 ) 
        outputChatBox ( "Done Armor", source, 255, 255, 255, true ) 
    end 
); 
  
addEvent ( "Give_He", true ) 
addEventHandler ( "Give_He", root, 
function (    ) 
    if ( getElementHealth ( source ) == 100 ) then return end 
        setElementHealth ( source, 100 ) 
        outputChatBox ( "Done Health", source, 255, 255, 255, true ) 
    end 
); 
  
addEvent ( "playerkill", true ) 
addEventHandler ( "playerkill", root, 
function (    ) 
        killPed ( source, source ) 
        outputChatBox ( "Done Kill", source, 255, 255, 255, true ) 
    end 
); 
  
addEvent ( "GiveVehicle", true )  
addEventHandler ( "GiveVehicle", root, 
function (    ) 
    if isElement ( table[source] ) then destroyElement ( table[source] ) end 
        local PosX, PosY, PosZ = getElementPosition ( source ) 
        table[source] = createVehicle ( 411, PosX, PosY, PosZ ) 
        warpPedIntoVehicle ( source , table[source] )   
    end 
); 
  
addEvent ( "DestroyMyCar", true ) 
addEventHandler ( "DestroyMyCar", root, 
function (    ) 
    if ( table[source] ) and isElement ( table[source] ) then  
            destroyElement ( table[source] )  
        end   
    end 
); 
  
addEventHandler ( "onPlayerQuit", root, 
function (    ) 
    if ( table[source] ) and isElement ( table[source] ) then 
                destroyElement ( table[source] ) 
            table[source] = nil      
        end 
    end 
); 

@Me[Z]oO

بالله وش غيرت بكودهـ ض1

Edited by Guest
Link to comment

= (

كل شوي تزيد المشاكل

حق راجو .. = مايطلع سهم + مافية " " عند bindKey

+ ماتقفل لما عدلتها

+

__________

ميزو

ماتغير شئ بلوحة القديمة

ممكن احد يساعدني

ويكون مجربها

او يعطيني واجرب انا وارد له خبر

Link to comment

تمت التجربة ! :roll:

#Client

GUIEditor = { 
  
window = {  } 
  
} 
    
        GUIEditor.window[1] = guiCreateWindow(420, 190, 361, 182, "::Panel x6lbat::", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetVisible(GUIEditor.window[1],false) 
        give = guiCreateButton(21, 47, 93, 33, "Give Car", false, GUIEditor.window[1]) 
        take = guiCreateButton(134, 47, 93, 33, "Destroy Car", false, GUIEditor.window[1]) 
        kill = guiCreateButton(247, 47, 93, 33, "Slap", false, GUIEditor.window[1]) 
        health = guiCreateButton(21, 123, 93, 33, "100 Health", false, GUIEditor.window[1]) 
        armor = guiCreateButton(134, 123, 93, 33, "100 Armor", false, GUIEditor.window[1]) 
        fly = guiCreateButton(247, 123, 93, 33, "Fly Car", false, GUIEditor.window[1])     
  
  
  
addEventHandler("onClientGUIClick",resourceRoot, 
function (  ) 
  
if ( source == health ) then 
  
setElementHealth( localPlayer , 100 ) 
  
outputChatBox("Done 100 Health",255,24,21,true) 
  
elseif ( source == armor ) then 
  
triggerServerEvent ("Give_Ar", localPlayer ) 
  
elseif ( source == kill ) then 
  
setElementHealth ( localPlayer ,0 ) 
  
outputChatBox("Done Kill",255,24,21,true) 
  
elseif ( source == fly ) then 
  
setWorldSpecialPropertyEnabled("aircars", true) 
  
outputChatBox("You Can Fly know !!",253,35,32) 
  
elseif ( source == take ) then 
  
triggerServerEvent( "DestroyMyCar",localPlayer ) 
  
elseif ( source == give ) then 
        
triggerServerEvent ( "GiveVehicle", localPlayer ) 
  
    end 
end 
    ) ; 
    
    -- Open Panel 
    
function Open() 
guiSetVisible (GUIEditor.window[1],not guiGetVisible(GUIEditor.window[1])) 
showCursor (guiGetVisible(GUIEditor.window[1])) 
end 
bindKey("x", "down", Open) 
  

#Server

-- server side 
addEvent("Give_Ar",true) 
addEventHandler("Give_Ar",root, 
  
function(   ) 
  
    if getPedArmor ( source ) == 100 then return end 
  
    setPedArmor ( source , 100 ) 
  
    end 
    ) ; 
    
local table = { } 
  
local TheCarID = 411 
  
addEvent("GiveVehicle",true) 
  
addEventHandler("GiveVehicle",root, 
  
function(   ) 
  
    if isElement ( table[ source ] ) then destroyElement ( table[ source ] ) end 
  
    PosX , PosY , PosZ = getElementPosition ( source ) 
        
    table[ source ] = createVehicle( TheCarID , PosX , PosY , PosZ ) 
        
    warpPedIntoVehicle( source , table[ source ] ) 
        
    end 
    ) ; 
  
    
addEvent("DestroyMyCar",true) 
  
addEventHandler("DestroyMyCar",root, 
  
function(   ) 
  
    if isElement ( table[ source ] ) then destroyElement ( table[ source ] ) end   
  
    end 
    ) ; 
  
  
addEventHandler('onPlayerQuit',root, function ( ) 
  
if isElement ( table[ source ] ) then destroyElement ( table[ source ] ) end 
  
  
    end 
    ) ; 
  

Link to comment
= (

كل شوي تزيد المشاكل

حق راجو .. = مايطلع سهم + مافية " " عند bindKey

+ ماتقفل لما عدلتها

+

__________

ميزو

ماتغير شئ بلوحة القديمة

ممكن احد يساعدني

ويكون مجربها

او يعطيني واجرب انا وارد له خبر

جرب الحين , الكود شغال تمام وزي ماتبي جربته

@Me[Z]oO

المفروض تعطيه دم من جانب سيرفر لانه حاليا من جانب كلنت في كودك وهذا غلط

لان الدم يكون وهمي

Link to comment
= (

كل شوي تزيد المشاكل

حق راجو .. = مايطلع سهم + مافية " " عند bindKey

+ ماتقفل لما عدلتها

+

__________

ميزو

ماتغير شئ بلوحة القديمة

ممكن احد يساعدني

ويكون مجربها

او يعطيني واجرب انا وارد له خبر

جرب الحين , الكود شغال تمام وزي ماتبي جربته

@Me[Z]oO

المفروض تعطيه دم من جانب سيرفر لانه حاليا من جانب كلنت في كودك وهذا غلط

لان الدم يكون وهمي

ممكن دليل انه وهمي ؟

+ ليش تتحقق ان دمه 100 وتسوي ريتيورن

يمكن الرجال معطي الاعب دم 200 ولو ضغط الزر يجيه 100 وكذا

><

Link to comment
= (

كل شوي تزيد المشاكل

حق راجو .. = مايطلع سهم + مافية " " عند bindKey

+ ماتقفل لما عدلتها

+

__________

ميزو

ماتغير شئ بلوحة القديمة

ممكن احد يساعدني

ويكون مجربها

او يعطيني واجرب انا وارد له خبر

جرب الحين , الكود شغال تمام وزي ماتبي جربته

@Me[Z]oO

المفروض تعطيه دم من جانب سيرفر لانه حاليا من جانب كلنت في كودك وهذا غلط

لان الدم يكون وهمي

ممكن دليل انه وهمي ؟

+ ليش تتحقق ان دمه 100 وتسوي ريتيورن

يمكن الرجال معطي الاعب دم 200 ولو ضغط الزر يجيه 100 وكذا

><

ممكن دليل انه وهمي ؟

:lol: الدليل جرب تعطيه دم من جانب كلنت , مايقبل اصلا لازم سيرفر

+ معروف ان الكلنت وهمي

+ ليش تتحقق ان دمه 100 وتسوي ريتيورن

يمكن الرجال معطي الاعب دم 200 ولو ضغط الزر يجيه 100 وكذا

><

لا تسألني انا اسأله هو لانه هو الي حاطها , انا صححت له الكود لا اقل ولا اكثر

اذا حاط الدم 200 بسيطه يشيل التحقق وخلاص مع اني متأكد غالبا انه حاطه 100

واذا الدم 100 يكون احسن يخلي التحقق عشان اذا جاء الاعب ياخذ دم مره ثانيه ودمه 100 مايعطيه الا اذا نقص

عشان م يكرر كلام في الشات + ماله داعي اصلا ياخذ دم 100 ودمه اصلا 100

Link to comment
كيف مايعطيه ؟

رح جرب

انا جربتها من زمان ماضبطت وسألت كذا مبرمج كبير

وجربتها قبل شوي بعد م ضبطت

  
GUIEditor = { 
    button = {}, 
    window = {} 
} 
  
        GUIEditor.window[1] = guiCreateWindow(281, 197, 228, 177, "", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetVisible ( GUIEditor.window[1], false ) 
        GUIEditor.button[1] = guiCreateButton(70, 70, 74, 30, "Give Health", false, GUIEditor.window[1]) 
        guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA")     
  
  
bindKey("F5","down",function() guiSetVisible ( GUIEditor.window[1] , not guiGetVisible ( GUIEditor.window[1] ) ) showCursor ( not isCursorShowing ( ) ) end ) 
  
addEventHandler("onClientGUIClick",resourceRoot, 
  
function (  ) 
  
if source == GUIEditor.button[1] then 
  
setElementHealth ( getLocalPlayer ( ) , 100 ) 
  
    end 
end 
    ) 
  

توني مجربه وعطاه ؟

تأكد من الميتا حقك

Link to comment

كنت حاط بدل لوكال بلاير سورس ناسي ض1

لاكن يبقى وهمي الدم لانه من كلنت هذا الي اعرفه , والي قالوه لي هل الخبره

ادخل سيرفر مجاني من جهازك هذا واذا عندك جهاز ثاني ادخل فيه بعد يعني خلكم في خادم واحد

وعط لاعبك دم وشف الاعب الثاني يشوفه ولالا

Link to comment
كنت حاط بدل لوكال بلاير سورس ناسي ض1

لاكن يبقى وهمي الدم لانه من كلنت هذا الي اعرفه , والي قالوه لي هل الخبره

ادخل سيرفر مجاني من جهازك هذا واذا عندك جهاز ثاني ادخل فيه بعد يعني خلكم في خادم واحد

وعط لاعبك دم وشف الاعب الثاني يشوفه ولالا

يعني مثلاً أنا عطيت نفسي دم من جانب كلنت واللاعب الي قدامي يشوف دمي القديم؟

ماهيب أي وظيفة تحطها بجانب كلنت تصير وهمية

Link to comment
كنت حاط بدل لوكال بلاير سورس ناسي ض1

لاكن يبقى وهمي الدم لانه من كلنت هذا الي اعرفه , والي قالوه لي هل الخبره

ادخل سيرفر مجاني من جهازك هذا واذا عندك جهاز ثاني ادخل فيه بعد يعني خلكم في خادم واحد

وعط لاعبك دم وشف الاعب الثاني يشوفه ولالا

يعني مثلاً أنا عطيت نفسي دم من جانب كلنت واللاعب الي قدامي يشوف دمي القديم؟

ماهيب أي وظيفة تحطها بجانب كلنت تصير وهمية

انا قلت اغلبها

+ هذا الي تعلمته من الكلام الي جاني والله اعلم :)

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...