Jump to content

كود سحب السيارة


Recommended Posts

# Server :

addEvent("destroy",true) 
addEventHandler("destroy",root, 
function (plr) 
outputChatBox(plr.." Destroyed His Car By "..getPlayerName (source).."",source, 255, 0, 0, false) 
end 
) 

# Client :

addEventHandler("onClientGUIClick",root, 
function ( ) 
if ( source == SlapButton ) then 
if ( guiGridListGetSelectedItem(pList ) ~= -1 ) then 
local plr = guiGridListGetItemText(pList ,guiGridListGetSelectedItem(pList),1) 
local player = getPlayerFromName ( plr ) 
triggerServerEvent("destroy", localPlayer, plr) 
destroyElement (  getPedOccupiedVehicle(player) ) 
end 
end 
end 
) 

Link to comment

ما ظبط

addEventHandler("onClientGUIClick",root, 
function ( ) 
if ( source == desBtn ) then 
if ( guiGridListGetSelectedItem(pList ) ~= -1 ) then 
local plr = guiGridListGetItemText(pList ,guiGridListGetSelectedItem(pList),1) 
local player = getPlayerFromName ( plr ) 
triggerServerEvent("destroy", localPlayer, plr) 
destroyElement (  getPedOccupiedVehicle(player) ) 
end 
end 
end 
) 

Link to comment
ما ظبط
addEventHandler("onClientGUIClick",root, 
function ( ) 
if ( source == desBtn ) then 
if ( guiGridListGetSelectedItem(pList ) ~= -1 ) then 
local plr = guiGridListGetItemText(pList ,guiGridListGetSelectedItem(pList),1) 
local player = getPlayerFromName ( plr ) 
triggerServerEvent("destroy", localPlayer, plr) 
destroyElement (  getPedOccupiedVehicle(player) ) 
end 
end 
end 
) 

addEventHandler("onClientGUIClick",root, 
function ( ) 
local sel = guiGridListGetSelectedItem(pList ) 
local plr = guiGridListGetItemText(pList ,guiGridListGetSelectedItem(pList),1) 
local player = getPlayerFromName ( plr ) 
if source == desBtn and sel ~= -1 and isPedInVehicle(plr) then 
triggerServerEvent("destroy", localPlayer, plr) 
destroyElement (  getPedOccupiedVehicle(player) ) 
  
end 
end 
end 
) 

جرب

Link to comment

# Client

addEventHandler("onClientGUIClick",root, 
function ( ) 
  
    if ( source == desBtn ) then 
  
    local Sel = guiGridListGetSelectedItem ( pList ) 
      
    if  Sel and  Sel ~= -1 then 
  
    local aPlayer = guiGridListGetItemText( pList , Sel ,1 ) 
  
    triggerServerEvent ( "Destroy_Veh", localPlayer , aPlayer ) 
  
        end 
    end 
end 
    ) ; 

# Server

addEvent( "Destroy_Veh" , true ) 
addEventHandler( "Destroy_Veh" ,root, 
  
function ( player ) 
  
    isPlayer = getPlayerFromName ( player ) 
  
    if not ( isPedInVehicle ( isPlayer )  ) then return outputChatBox("يجب ان يكون الاعب بالسيارة",source,255,255,255,true) end 
  
    aVeh = getPedOccupiedVehicle ( isPlayer ) 
  
    if aVeh then 
  
    destroyElement ( aVeh ) 
  
    end 
end 
    ) ; 

ملاحظة : ماجرب الكود , اعتذر عن الاخطاء لو كان فيه

Edited by Guest
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...