Jump to content

طلب كود | Code


Recommended Posts

  • Replies 59
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

سحب السياره --

addEventHandler("onClientGUIClick",root,function() 
    if source == GUIEditor.button[1] then 
    if isPedInVehicle ( localPlayer ) then 
    destroyElement (  getPedOccupiedVehicle(localPlayer) ) 
        end 
    end 
end     ) 

التعطيه سياره .

مثال اخ عبد الكريم عمله

Cars = { 
  
{'Monster',9000,580}, 
{'Frary',10000,570}, 
-- Text , Money , IDcar -- 
} 
  
for i , v in ipairs ( Cars ) do 
  
Row = guiGridListAddRow ( grid ) 
  
guiGridListSetItemText( grid,Row ,1,v[1],false,false); 
  
guiGridListSetItemText( grid,Row ,2,v[2],false,false); 
  
guiGridListSetItemData ( grid , Row , 1 , v[3] ) 
end 
  
addEventHandler("onClientGUIClick",resourceRoot, 
function (  ) 
  
    if source == btn then 
  
    local Se = guiGridListGetSelectedItem( grid ) 
        
    if Se and Se ~= -1 then  
  
    local Money = guiGridListGetItemText ( grid, Se, 2 ) 
  
    local iD = guiGridListGetItemData ( grid , Se  , 1 ) 
                
    triggerServerEvent ( "GiveVehicle",localPlayer , Money , iD ) 
  
        end 
    end 
end 
    ) ; 

local table = { } 
  
addEvent("GiveVehicle" ,true) 
addEventHandler("GiveVehicle" ,root, 
function (  Money , id  ) 
  
if isElement( table[ source ] ) then  destroyElement ( table[ source]  ) end 
  
local Money_ = getPlayerMoney ( source ) 
  
if Money_ >= tonumber ( Money ) then 
  
PosX , PosY , PosZ =  getElementPosition ( source ) 
  
takePlayerMoney( source , tonumber ( Money ) ) 
  
table[ source ] = createVehicle( id , PosX , PosY , PosZ  ) 
  
  
outputChatBox("* تم شراء الشخصيه",source ,0,255,0,false) 
  
else 
  
outputChatBox("* ليس لديك المال الكافي للشراء",source ,255,0,0,false) 
  
    end 
end 
    ) ; 
Link to comment

سحب السياره --

addEventHandler("onClientGUIClick",root,function() 
    if source == GUIEditor.button[1] then 
    if isPedInVehicle ( localPlayer ) then 
    destroyElement (  getPedOccupiedVehicle(localPlayer) ) 
        end 
    end 
end     ) 

التعطيه سياره .

مثال اخ عبد الكريم عمله

Cars = { 
  
{'Monster',9000,580}, 
{'Frary',10000,570}, 
-- Text , Money , IDcar -- 
} 
  
for i , v in ipairs ( Cars ) do 
  
Row = guiGridListAddRow ( grid ) 
  
guiGridListSetItemText( grid,Row ,1,v[1],false,false); 
  
guiGridListSetItemText( grid,Row ,2,v[2],false,false); 
  
guiGridListSetItemData ( grid , Row , 1 , v[3] ) 
end 
  
addEventHandler("onClientGUIClick",resourceRoot, 
function (  ) 
  
    if source == btn then 
  
    local Se = guiGridListGetSelectedItem( grid ) 
        
    if Se and Se ~= -1 then  
  
    local Money = guiGridListGetItemText ( grid, Se, 2 ) 
  
    local iD = guiGridListGetItemData ( grid , Se  , 1 ) 
                
    triggerServerEvent ( "GiveVehicle",localPlayer , Money , iD ) 
  
        end 
    end 
end 
    ) ; 

local table = { } 
  
addEvent("GiveVehicle" ,true) 
addEventHandler("GiveVehicle" ,root, 
function (  Money , id  ) 
  
if isElement( table[ source ] ) then  destroyElement ( table[ source]  ) end 
  
local Money_ = getPlayerMoney ( source ) 
  
if Money_ >= tonumber ( Money ) then 
  
PosX , PosY , PosZ =  getElementPosition ( source ) 
  
takePlayerMoney( source , tonumber ( Money ) ) 
  
table[ source ] = createVehicle( id , PosX , PosY , PosZ  ) 
  
  
outputChatBox("* تم شراء الشخصيه",source ,0,255,0,false) 
  
else 
  
outputChatBox("* ليس لديك المال الكافي للشراء",source ,255,0,0,false) 
  
    end 
end 
    ) ; 
Link to comment
  
  
        GUIEditor.window[1] = guiCreateWindow(420, 190, 361, 182, "Test", 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",root, 
function localplayer() 
if source == health then 
setElementHealth(localplayer,100) 
outputChatBox("Done 100 Health",localplayer,255,24,21,true) 
end 
end 
) 
  
  
addEventHandler("onClientGUIClick",root, 
function localplayer() 
if source == armor then 
setPedArmor(localplayer,100) 
outputChatBox("Done give armor Happy",localplayer,255,254,24,true) 
end 
end 
) 
  
  
addEventHandler("onClientGUIClick",root, 
function localplayer() 
if source == kill then 
setElementHealth(localplayer,100) 
outputChatBox("Done Kill",localplayer,255,24,21,true) 
end 
end 
) 
  
  
addEventHandler ("onClientGUIClick", getRootElement(), 
function localplayer() 
if source == fly then 
setWorldSpecialPropertyEnabled (localplayer,"aircars", true ) 
outputChatBox("You Can Fly know !!",localplayer,253,35,32) 
end 
end 
) 
  
  
addEventHandler("onClientGUIClick",root,function() 
    if source == take then 
    if isPedInVehicle ( localPlayer ) then 
    destroyElement (  getPedOccupiedVehicle(localPlayer) ) 
        end 
    end 
end     ) 
  
  
  

Link to comment
  
  
        GUIEditor.window[1] = guiCreateWindow(420, 190, 361, 182, "Test", 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",root, 
function localplayer() 
if source == health then 
setElementHealth(localplayer,100) 
outputChatBox("Done 100 Health",localplayer,255,24,21,true) 
end 
end 
) 
  
  
addEventHandler("onClientGUIClick",root, 
function localplayer() 
if source == armor then 
setPedArmor(localplayer,100) 
outputChatBox("Done give armor Happy",localplayer,255,254,24,true) 
end 
end 
) 
  
  
addEventHandler("onClientGUIClick",root, 
function localplayer() 
if source == kill then 
setElementHealth(localplayer,100) 
outputChatBox("Done Kill",localplayer,255,24,21,true) 
end 
end 
) 
  
  
addEventHandler ("onClientGUIClick", getRootElement(), 
function localplayer() 
if source == fly then 
setWorldSpecialPropertyEnabled (localplayer,"aircars", true ) 
outputChatBox("You Can Fly know !!",localplayer,253,35,32) 
end 
end 
) 
  
  
addEventHandler("onClientGUIClick",root,function() 
    if source == take then 
    if isPedInVehicle ( localPlayer ) then 
    destroyElement (  getPedOccupiedVehicle(localPlayer) ) 
        end 
    end 
end     ) 
  
  
  

Link to comment

اعذرني لو في خطاء

عملتو عسريع

addEventHandler("onClientGUIClick",resourceRoot, 
function (  ) 
if source == GUIEditor.button[1] then 
triggerServerEvent ( "GiveVehicle",localPlayer , ID ) 
end 
end) 

local table = { } 
  
addEvent("GiveVehicle" ,true) 
addEventHandler("GiveVehicle" ,root, 
table[ source ] = createVehicle( id , PosX , PosY , PosZ  ) 
outputChatBox("* اخدث سياره تم",source ,0,255,0,false) 
 end 
end 
    ) ; 
Link to comment

اعذرني لو في خطاء

عملتو عسريع

addEventHandler("onClientGUIClick",resourceRoot, 
function (  ) 
if source == GUIEditor.button[1] then 
triggerServerEvent ( "GiveVehicle",localPlayer , ID ) 
end 
end) 

local table = { } 
  
addEvent("GiveVehicle" ,true) 
addEventHandler("GiveVehicle" ,root, 
table[ source ] = createVehicle( id , PosX , PosY , PosZ  ) 
outputChatBox("* اخدث سياره تم",source ,0,255,0,false) 
 end 
end 
    ) ; 
Link to comment

تفضل اخي

  
--client 
  
        GUIEditor.window[1] = guiCreateWindow(420, 190, 361, 182, "Test", 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",root, 
function localplayer() 
if source == health then 
setElementHealth(localplayer,100) 
outputChatBox("Done 100 Health",localplayer,255,24,21,true) 
end 
end 
) 
  
  
addEventHandler("onClientGUIClick",root, 
function localplayer() 
if source == armor then 
setPedArmor(localplayer,100) 
outputChatBox("Done give armor Happy",localplayer,255,254,24,true) 
end 
end 
) 
  
  
addEventHandler("onClientGUIClick",root, 
function localplayer() 
if source == kill then 
setElementHealth(localplayer,100) 
outputChatBox("Done Kill",localplayer,255,24,21,true) 
end 
end 
) 
  
  
addEventHandler ("onClientGUIClick", getRootElement(), 
function localplayer() 
if source == fly then 
setWorldSpecialPropertyEnabled (localplayer,"aircars", true ) 
outputChatBox("You Can Fly know !!",localplayer,253,35,32) 
end 
end 
) 
  
  
addEventHandler("onClientGUIClick",root,function() 
    if source == take then 
    if isPedInVehicle ( localPlayer ) then 
    destroyElement (  getPedOccupiedVehicle(localPlayer) ) 
        end 
    end 
end     ) 
  
  
addEventHandler("onClientGUIClick",root,function() 
    if (source == give) then 
        triggerServerEvent ( "GiveVehicle",localPlayer) 
    end 
end) 
  

 

  
--server 
addEvent("GiveVehicle",true) 
addEventHandler("GiveVehicle",root,function() 
    local x,y,z = getElementPosition(localPlayer) 
    local vehicle = createVehicle(ID,x,y,z) 
        warpPedIntoVehicle(localPlayer,vehicle) 
end) 

Link to comment

تفضل اخي

  
--client 
  
        GUIEditor.window[1] = guiCreateWindow(420, 190, 361, 182, "Test", 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",root, 
function localplayer() 
if source == health then 
setElementHealth(localplayer,100) 
outputChatBox("Done 100 Health",localplayer,255,24,21,true) 
end 
end 
) 
  
  
addEventHandler("onClientGUIClick",root, 
function localplayer() 
if source == armor then 
setPedArmor(localplayer,100) 
outputChatBox("Done give armor Happy",localplayer,255,254,24,true) 
end 
end 
) 
  
  
addEventHandler("onClientGUIClick",root, 
function localplayer() 
if source == kill then 
setElementHealth(localplayer,100) 
outputChatBox("Done Kill",localplayer,255,24,21,true) 
end 
end 
) 
  
  
addEventHandler ("onClientGUIClick", getRootElement(), 
function localplayer() 
if source == fly then 
setWorldSpecialPropertyEnabled (localplayer,"aircars", true ) 
outputChatBox("You Can Fly know !!",localplayer,253,35,32) 
end 
end 
) 
  
  
addEventHandler("onClientGUIClick",root,function() 
    if source == take then 
    if isPedInVehicle ( localPlayer ) then 
    destroyElement (  getPedOccupiedVehicle(localPlayer) ) 
        end 
    end 
end     ) 
  
  
addEventHandler("onClientGUIClick",root,function() 
    if (source == give) then 
        triggerServerEvent ( "GiveVehicle",localPlayer) 
    end 
end) 
  

 

  
--server 
addEvent("GiveVehicle",true) 
addEventHandler("GiveVehicle",root,function() 
    local x,y,z = getElementPosition(localPlayer) 
    local vehicle = createVehicle(ID,x,y,z) 
        warpPedIntoVehicle(localPlayer,vehicle) 
end) 

Link to comment
اعذرني لو في خطاء

عملتو عسريع

addEventHandler("onClientGUIClick",resourceRoot, 
function (  ) 
if source == GUIEditor.button[1] then 
triggerServerEvent ( "GiveVehicle",localPlayer , ID ) 
end 
end) 

local table = { } 
  
addEvent("GiveVehicle" ,true) 
addEventHandler("GiveVehicle" ,root, 
table[ source ] = createVehicle( id , PosX , PosY , PosZ  ) 
outputChatBox("* اخدث سياره تم",source ,0,255,0,false) 
 end 
end 
    ) ; 

اسف لكن كودك هريسة

ID بالترايقر ما هي معرفة

table[source] ما تحتاجه

createVehicle( id , PosX , PosY , PosZ  ) الي فهمته بانك وضعت له مكان يضع الايدي + الاحداثيات

لكن هو يبي تيجي بمكانه ويبي ايضاً يكون راكبها

لذلك تحتاج

warpPedIntoVehicle 
getElementPosition 

Link to comment
اعذرني لو في خطاء

عملتو عسريع

addEventHandler("onClientGUIClick",resourceRoot, 
function (  ) 
if source == GUIEditor.button[1] then 
triggerServerEvent ( "GiveVehicle",localPlayer , ID ) 
end 
end) 

local table = { } 
  
addEvent("GiveVehicle" ,true) 
addEventHandler("GiveVehicle" ,root, 
table[ source ] = createVehicle( id , PosX , PosY , PosZ  ) 
outputChatBox("* اخدث سياره تم",source ,0,255,0,false) 
 end 
end 
    ) ; 

اسف لكن كودك هريسة

ID بالترايقر ما هي معرفة

table[source] ما تحتاجه

createVehicle( id , PosX , PosY , PosZ  ) الي فهمته بانك وضعت له مكان يضع الايدي + الاحداثيات

لكن هو يبي تيجي بمكانه ويبي ايضاً يكون راكبها

لذلك تحتاج

warpPedIntoVehicle 
getElementPosition 

Link to comment

الاكواد كاملة

        GUIEditor.window[1] = guiCreateWindow(420, 190, 361, 182, "Test", 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",root, 
function localplayer() 
if source == health then 
setElementHealth(localplayer,100) 
outputChatBox("Done 100 Health",localplayer,255,24,21,true) 
end 
end 
) 
  
  
addEventHandler("onClientGUIClick",root, 
function localplayer() 
if source == armor then 
triggerServerEvent("armorgive",localPlayer) --ترايقر لملف سيرفر 
end 
end 
) 
  
  
addEventHandler("onClientGUIClick",root, 
function localplayer() 
if source == kill then 
setElementHealth(localplayer,100) 
outputChatBox("Done Kill",localplayer,255,24,21,true) 
end 
end 
) 
  
  
addEventHandler ("onClientGUIClick", getRootElement(), 
function localplayer() 
if source == fly then 
setWorldSpecialPropertyEnabled (localplayer,"aircars", true ) 
outputChatBox("You Can Fly know !!",localplayer,253,35,32) 
end 
end 
) 
  
  
addEventHandler("onClientGUIClick",root,function() --عند الضغط على زر 
    if source == take then --يتحقق  من اسم الزر 
    if isPedInVehicle ( localPlayer ) then --يتحقق ان كان الاعب داخل السيارة 
    destroyElement (  getPedOccupiedVehicle(localPlayer) ) -- يدمر السيارة التي بداخلها  
        end 
    end 
end     ) 
  
  
addEventHandler("onClientGUIClick",root,function() --عند الضغط على زر 
    if (source == give) then -- يتحقق من اسم الزر 
        triggerServerEvent ( "GiveVehicle",localPlayer) --يرسل ترايقر لملف سيرفر 
    end 
end) 
  

addEvent("GiveVehicle",true) --استقبال الترايقر 
addEventHandler("GiveVehicle",root,function() -- استقبال الترايقر 
    local x,y,z = getElementPosition(localPlayer) --يجيك احداثيات الاعب  
    local vehicle = createVehicle(ID,x,y,z) --يصنع سيارة باحداثيات الاعب ملاحظة عند ID ضع الايدي من عندك 
        warpPedIntoVehicle(localPlayer,vehicle)--يضع الاعب داخل السيارة 
end) 
  
  
  
addEvent("armorgive",true)--استقبال 
addEventHandler("armorgive",root,function() --استقبال 
    setPedArmor(localplayer,100)--عطاء درع 100 
    outputChatBox("Done give armor Happy",localplayer,255,254,24,true) --كلام بالشات 
end) 

شرحت لك بعض الاكواد اتمنى اكون افدتك

Link to comment

الاكواد كاملة

        GUIEditor.window[1] = guiCreateWindow(420, 190, 361, 182, "Test", 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",root, 
function localplayer() 
if source == health then 
setElementHealth(localplayer,100) 
outputChatBox("Done 100 Health",localplayer,255,24,21,true) 
end 
end 
) 
  
  
addEventHandler("onClientGUIClick",root, 
function localplayer() 
if source == armor then 
triggerServerEvent("armorgive",localPlayer) --ترايقر لملف سيرفر 
end 
end 
) 
  
  
addEventHandler("onClientGUIClick",root, 
function localplayer() 
if source == kill then 
setElementHealth(localplayer,100) 
outputChatBox("Done Kill",localplayer,255,24,21,true) 
end 
end 
) 
  
  
addEventHandler ("onClientGUIClick", getRootElement(), 
function localplayer() 
if source == fly then 
setWorldSpecialPropertyEnabled (localplayer,"aircars", true ) 
outputChatBox("You Can Fly know !!",localplayer,253,35,32) 
end 
end 
) 
  
  
addEventHandler("onClientGUIClick",root,function() --عند الضغط على زر 
    if source == take then --يتحقق  من اسم الزر 
    if isPedInVehicle ( localPlayer ) then --يتحقق ان كان الاعب داخل السيارة 
    destroyElement (  getPedOccupiedVehicle(localPlayer) ) -- يدمر السيارة التي بداخلها  
        end 
    end 
end     ) 
  
  
addEventHandler("onClientGUIClick",root,function() --عند الضغط على زر 
    if (source == give) then -- يتحقق من اسم الزر 
        triggerServerEvent ( "GiveVehicle",localPlayer) --يرسل ترايقر لملف سيرفر 
    end 
end) 
  

addEvent("GiveVehicle",true) --استقبال الترايقر 
addEventHandler("GiveVehicle",root,function() -- استقبال الترايقر 
    local x,y,z = getElementPosition(localPlayer) --يجيك احداثيات الاعب  
    local vehicle = createVehicle(ID,x,y,z) --يصنع سيارة باحداثيات الاعب ملاحظة عند ID ضع الايدي من عندك 
        warpPedIntoVehicle(localPlayer,vehicle)--يضع الاعب داخل السيارة 
end) 
  
  
  
addEvent("armorgive",true)--استقبال 
addEventHandler("armorgive",root,function() --استقبال 
    setPedArmor(localplayer,100)--عطاء درع 100 
    outputChatBox("Done give armor Happy",localplayer,255,254,24,true) --كلام بالشات 
end) 

شرحت لك بعض الاكواد اتمنى اكون افدتك

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