Jump to content

توضيح في كود البوابه تخصيصه لتيم معين


aL.Kfo

Recommended Posts

مرحبا شباب حصلت لي كود في موقع مودات MTA

بوابه بس هـل اقدراخصصها لقروب

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

ليني جربت كذا كلمه م ضبط

checkGateMarker = createMarker ( 216.22926330566, 1875.0806884766, 7.4616560935974, "corona", 10.0, 0, 0, 255, 0 ) 
function onPoliceShapeHit ( thePlayer, matchingDimension ) 
    if ( getElementType ( thePlayer ) == "player" ) then 
        outputChatBox ( "You have entered Police Base zone!", thePlayer, 0, 0, 255 ) 
    end 
end 
addEventHandler ( "onColShapeHit", policeColShape, onPoliceShapeHit ) 
  
function createGate () 
    gatePolice = createObject ( 976, 209.8828125, 1875.8419189453, 12.372331619263 ) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate ) 
  
  
function gateCheckingTeam ( thePlayer, matchingDimension ) 
    moveObject ( gatePolice, 976, 218.11740112305, 1875.3406982422, 12.372331619263 ) 
end 
addEventHandler ( "onMarkerHit", checkGateMarker, gateCheckingTeam ) 
  
function onLeave ( thePlayer, matchingDimension ) 
    setTimer ( movingBackPolice, 3000, 1, thePlayer ) 
end 
addEventHandler ( "onMarkerLeave", checkGateMarker, onLeave ) 
  
function movingBackPolice () 
    moveObject ( gatePolice, 3000, 209.8828125, 1875.8419189453, 12.372331619263 ) 
end 
  

Link to comment

`ذا الكوود ؟

function joinTime ( ) 
    setElementData ( source, "joinTime", getTickCount() ) -- Store the current tick count in the player's data with the key 'joinTime' 
end 
-- Make our 'joinTime' function be called when a player joins 
addEventHandler ( "onPlayerJoin", getRootElement(), joinTime ) 
  
function showJoinTime ( source, commandName, playerName ) 
    if ( playerName ) then -- see if a player was specified 
        thePlayer = getPlayerFromName ( playerName ) -- get the player element for the specified player 
        if ( thePlayer ) then -- if one was found... 
            local timeOnline = (getTickCount() - getElementData ( thePlayer, "joinTime" )) / 1000 -- calculates the time since join 
            outputChatBox ( getPlayerName ( thePlayer ).." joined "..timeOnline.." seconds ago", source ) -- output the player's join time 
        else 
            outputChatBox ( "Couldn't find '" .. playerName .. "'", source ) -- display an error 
        end 
    else 
        -- display when the player who used the function joined and inform how to see other people's join time 
        local timeOnline = (getTickCount() - getElementData ( source, "joinTime" )) / 1000 -- calculate the time since join 
        outputChatBox ( "You joined " ..timeOnline.." seconds ago", source ) 
        outputChatBox ( "Use 'join_time ' to see other people's join time", source ) 
    end 
end 
-- Add a console command joinTime, that takes an optional parameter of a player's name 
addCommandHandler ( "joinTime", showJoinTime ) 

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

Edited by Guest
Link to comment
`ذا الكوود ؟
function joinTime ( ) 
    setElementData ( source, "joinTime", getTickCount() ) -- Store the current tick count in the player's data with the key 'joinTime' 
end 
-- Make our 'joinTime' function be called when a player joins 
addEventHandler ( "onPlayerJoin", getRootElement(), joinTime ) 
  
function showJoinTime ( source, commandName, playerName ) 
    if ( playerName ) then -- see if a player was specified 
        thePlayer = getPlayerFromName ( playerName ) -- get the player element for the specified player 
        if ( thePlayer ) then -- if one was found... 
            local timeOnline = (getTickCount() - getElementData ( thePlayer, "joinTime" )) / 1000 -- calculates the time since join 
            outputChatBox ( getPlayerName ( thePlayer ).." joined "..timeOnline.." seconds ago", source ) -- output the player's join time 
        else 
            outputChatBox ( "Couldn't find '" .. playerName .. "'", source ) -- display an error 
        end 
    else 
        -- display when the player who used the function joined and inform how to see other people's join time 
        local timeOnline = (getTickCount() - getElementData ( source, "joinTime" )) / 1000 -- calculate the time since join 
        outputChatBox ( "You joined " ..timeOnline.." seconds ago", source ) 
        outputChatBox ( "Use 'join_time ' to see other people's join time", source ) 
    end 
end 
-- Add a console command joinTime, that takes an optional parameter of a player's name 
addCommandHandler ( "joinTime", showJoinTime ) 

انت طلبك كذا ؟؟ ما اتوقع ,,

+

حبيت انبهك انك لازم تسوي كول شيب ,, لانك مسوي حدث عليها !!

بأستخدام الكود هذا

createColRectangle 
createRadarArea 

على العموم ,, دام انك حاولت ,, جرب ذا الكود

checkGateMarker = createMarker ( 216.22926330566, 1875.0806884766, 7.4616560935974, "corona", 10.0, 0, 0, 255, 0 ) 
function onPoliceShapeHit ( thePlayer, matchingDimension ) 
if ( getElementType ( thePlayer ) == "player" ) then 
if ( getElementData(thePlayer, "Group") == "اسم القروب الي في التاب" ) then 
outputChatBox ( "You have entered Police Base zone!", thePlayer, 0, 0, 255 ) 
end 
end 
end 
addEventHandler ( "onColShapeHit", policeColShape, onPoliceShapeHit ) 
  
function createGate () 
gatePolice = createObject ( 976, 209.8828125, 1875.8419189453, 12.372331619263 ) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate ) 
  
  
function gateCheckingTeam ( thePlayer, matchingDimension ) 
if ( getElementData(thePlayer, "Group") == "اسم القروب الي في التاب" ) then 
moveObject ( gatePolice, 976, 218.11740112305, 1875.3406982422, 12.372331619263 ) 
end 
end 
addEventHandler ( "onMarkerHit", checkGateMarker, gateCheckingTeam ) 
  
function onLeave ( thePlayer, matchingDimension ) 
setTimer ( movingBackPolice, 3000, 1, thePlayer ) 
end 
addEventHandler ( "onMarkerLeave", checkGateMarker, onLeave ) 
  
function movingBackPolice () 
moveObject ( gatePolice, 3000, 209.8828125, 1875.8419189453, 12.372331619263 ) 
end 
  

Link to comment
`ذا الكوود ؟
function joinTime ( ) 
    setElementData ( source, "joinTime", getTickCount() ) -- Store the current tick count in the player's data with the key 'joinTime' 
end 
-- Make our 'joinTime' function be called when a player joins 
addEventHandler ( "onPlayerJoin", getRootElement(), joinTime ) 
  
function showJoinTime ( source, commandName, playerName ) 
    if ( playerName ) then -- see if a player was specified 
        thePlayer = getPlayerFromName ( playerName ) -- get the player element for the specified player 
        if ( thePlayer ) then -- if one was found... 
            local timeOnline = (getTickCount() - getElementData ( thePlayer, "joinTime" )) / 1000 -- calculates the time since join 
            outputChatBox ( getPlayerName ( thePlayer ).." joined "..timeOnline.." seconds ago", source ) -- output the player's join time 
        else 
            outputChatBox ( "Couldn't find '" .. playerName .. "'", source ) -- display an error 
        end 
    else 
        -- display when the player who used the function joined and inform how to see other people's join time 
        local timeOnline = (getTickCount() - getElementData ( source, "joinTime" )) / 1000 -- calculate the time since join 
        outputChatBox ( "You joined " ..timeOnline.." seconds ago", source ) 
        outputChatBox ( "Use 'join_time ' to see other people's join time", source ) 
    end 
end 
-- Add a console command joinTime, that takes an optional parameter of a player's name 
addCommandHandler ( "joinTime", showJoinTime ) 

انت طلبك كذا ؟؟ ما اتوقع ,,

+

حبيت انبهك انك لازم تسوي كول شيب ,, لانك مسوي حدث عليها !!

بأستخدام الكود هذا

createColRectangle 
createRadarArea 

على العموم ,, دام انك حاولت ,, جرب ذا الكود

checkGateMarker = createMarker ( 216.22926330566, 1875.0806884766, 7.4616560935974, "corona", 10.0, 0, 0, 255, 0 ) 
function onPoliceShapeHit ( thePlayer, matchingDimension ) 
if ( getElementType ( thePlayer ) == "player" ) then 
if ( getElementData(thePlayer, "Group") == "اسم القروب الي في التاب" ) then 
outputChatBox ( "You have entered Police Base zone!", thePlayer, 0, 0, 255 ) 
end 
end 
end 
addEventHandler ( "onColShapeHit", policeColShape, onPoliceShapeHit ) 
  
function createGate () 
gatePolice = createObject ( 976, 209.8828125, 1875.8419189453, 12.372331619263 ) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate ) 
  
  
function gateCheckingTeam ( thePlayer, matchingDimension ) 
if ( getElementData(thePlayer, "Group") == "اسم القروب الي في التاب" ) then 
moveObject ( gatePolice, 976, 218.11740112305, 1875.3406982422, 12.372331619263 ) 
end 
end 
addEventHandler ( "onMarkerHit", checkGateMarker, gateCheckingTeam ) 
  
function onLeave ( thePlayer, matchingDimension ) 
setTimer ( movingBackPolice, 3000, 1, thePlayer ) 
end 
addEventHandler ( "onMarkerLeave", checkGateMarker, onLeave ) 
  
function movingBackPolice () 
moveObject ( gatePolice, 3000, 209.8828125, 1875.8419189453, 12.372331619263 ) 
end 
  

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

ي رجال منكم نتعلم ^_^

Link to comment

انا مدري عن كودك ذا وش وضعه ,, ولا من وين جايبه المهم ,, لو تبي بوابه لقروب معين ,,

تفضل

local Object = createObject ( 980,x,y,z ) 
local Marker = createMarker ( x,y,z, "cylinder", 2, 255, 0, 0, 0 ) 
  
function OpenObject ( player ) 
    if isElementWithinMarker ( player, Marker ) then 
       if ( getElementData(player, "Group") == "اسم القروب الي في التاب" ) then 
            if not Open then 
                moveObject ( Object, 1500, x,y,z ) 
            else 
                moveObject ( Object, 1500, x, y, z ) 
            end 
            Open = not Open 
        else 
            outputChatBox ( "* You Must Be In 'اسم القروب هنا' ", player, 200, 0, 0, true ) 
        end 
    end 
end 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "tab", "down", OpenObject ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "tab", "down", OpenObject ) 
    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...