Jump to content

ساعدوني مقرات


Alix2015

Recommended Posts

كود الماركر حق السيارات للقروب

--Client 
onClientMarkerHit 
guiSetVisible 
guiSetInputEnabled 
showCursor 
---------------------------------- 
onClientGUIClick 
guiGridListGetSelectedItem 
guiGridListGetItemText 
getElementData 
triggerServerEvent 
  
--Server 
getVehicleModelFromName 
table ~ isElement ~ destroyElement 
getElementPosition 
createVehicle 
warpPedIntoVehicle 

كود دم 150 او 200 وشكرا

setElementHealth 
Edited by Guest
Link to comment

براحتك

-- client 
guiSetVisible ( theWindow, false) 
marker = createMarker (1,1,1,"cylinder",1.0,255,255,255) 
function showWindow() 
if ( getElementData (localPlayer,"GroupData") == theGroup ) then 
            guiSetVisible ( theWindow, true) 
            showCursor(true) 
            guiSetInputEnabled(true) 
end 
end 
addEventHandler ( "onClientMarkerHit", marker , showWindow) -- اظهار النافذة لما الماركر يتملس 
  
function test() 
local vehicle = guiGridListGetItemText (Grid, guiGridListGetSelectedItem (Grid), 1) 
if ( getElementData (localPlayer,"GroupData") == theGroup ) then 
  triggerServerEvent ("trigger", getLocalPlayer(), vehicle ) 
end 
end 
addEventHandler ("onClientGUIClick", Button,test) 

-- server 
car = { } 
addEvent ( "GiveMeCar", true ) 
    function testo( modelVehicle ) 
 if isElement( car[source] ) then destroyElement( car[source] ) end 
        local x, y, z = getElementPosition ( source ) 
        car[source] = createVehicle ( getVehicleModelFromName ( modelVehicle ) , x, y, z ) 
        warpPlayerIntoVehicle ( source, car[source] ) 
    end 
addEventHandler ( "GiveMeCar", root,testo) 
  
function teste() 
    if car[source] and isElement( car[source] ) then destroyElement( car[source] ) 
    end 
    end 
addEventHandler ( "onPlayerQuit",  
getRootElement(), teste ) 
-- server 
function markerhit(player) 
 if ( getElementData ( player,"GroupData") == theGroup ) then 
setElementHealth (player,200) 
end 
end 
addEventHandler("onMarkerHit",marker,markerhit)  

Link to comment
-- #Client 
  
function toggleWindow( Element ) 
    if ( Element == localPlayer ) then 
        local Boolean = eventName == "onClientMarkerHit"; local Boolean = Boolean and getElementData( localPlayer, "Group" ) == "The Group" 
        guiSetVisible( TheWindow, Boolean ) 
        showCursor( Boolean ) 
    end 
end 
addEventHandler( "onClientMarkerHit", Marker, toggleWindow ) 
addEventHandler( "onClientMarkerLeave", Marker, toggleWindow ) 
  
  
function Vehicles() 
    if ( source == Button or source == GridList ) then 
        if ( getElementData( localPlayer,"Group" ) == "The Group" ) then 
            local SelectedItem = guiGridListGetSelectedItem( GridList ) 
            if ( SelectedItem ~= -1 ) then 
                local VehicleID = guiGridListGetItemData( GridList, SelectedItem, 1 ) 
                triggerServerEvent( "Base:GiveVehicle", localPlayer, VehicleID ) 
            end 
        else 
            guiSetVisible( TheWindow, false ) 
            showCursor( false ) 
        end 
    end 
end 
addEventHandler( "onClientGUIClick", guiRoot, Vehicles ) 

-- #Server 
  
local PlayersVehicles = {} 
  
addEvent( "Base:GiveVehicle", true ) 
addEventHandler( "Base:GiveVehicle", root, 
function( VehicleID ) 
    if ( isElement( PlayersVehicles[source] ) ) then 
        destroyElement( PlayersVehicles[source] ) 
        PlayersVehicles[source] = nil 
    end 
    PlayersVehicles[source] = createVehicle( VehicleID, getElementPosition( localPlayer ) ) 
    warpPedIntoVehicle( source, PlayersVehicles[source] ) 
end ) 
  
addEventHandler( "onVehicleExplode", resourceRoot, 
function() 
    for Player, Vehicle in pairs( PlayersVehicles ) do 
        if ( Vehicle == source ) then 
            setTimer( function() if ( isElement( Vehicle ) ) then destroyElement( Vehicle ) end end, 5000, 1 ) 
            PlayersVehicles[Player] = nil 
            break 
        end 
    end 
end ) 
  
addEventHandler( "onPlayerQuit", root,  
function() 
    if ( isElement( PlayersVehicles[source] ) ) then 
        destroyElement( PlayersVehicles[source] ) 
        PlayersVehicles[source] = nil 
    end 
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...