Jump to content

مطلوب كود برمجة و مساعدة #


Recommended Posts

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

وضع جسم تكتب

createObject(Id, x, y, z, rx, ry, rz) 
  

والمسح بدي اعرف

لاني بدي اصنع مود حق السوات تعمل حواجز في الطريق اعرف اضيهم للجروب ات

انشاء الله تسعدوني

مثلا يحط جسم يكتبولو ايدي 1 ...الى اخره ID ويكون المسح باليدي

Del 1 في اف 8 اوDEl 2 ... و هو يكتب

وشكرا

Link to comment
السلام عليكم انا جديد في تعمل البرمجة بدي كون و مثال لمسح جسم

وضع جسم تكتب

createObject(Id, x, y, z, rx, ry, rz) 
  

والمسح بدي اعرف

لاني بدي اصنع مود حق السوات تعمل حواجز في الطريق اعرف اضيهم للجروب ات

انشاء الله تسعدوني

مثلا يحط جسم يكتبولو ايدي 1 ...الى اخره ID ويكون المسح باليدي

Del 1 في اف 8 اوDEl 2 ... و هو يكتب

وشكرا

ObjectName = createObject(Id, x, y, z, rx, ry, rz) -- لإنشاء اوبجكت 
destroyElement ( ObjectName ) -- لحذف اي شئ 
moveObject ( ObjectName , 3000, x, y, z ) -- -- لنقل الاوبجكت الى اي مكان " 3000 هي سرعة الحركة 

Link to comment
السلام عليكم انا جديد في تعمل البرمجة بدي كون و مثال لمسح جسم

وضع جسم تكتب

createObject(Id, x, y, z, rx, ry, rz) 
  

والمسح بدي اعرف

لاني بدي اصنع مود حق السوات تعمل حواجز في الطريق اعرف اضيهم للجروب ات

انشاء الله تسعدوني

مثلا يحط جسم يكتبولو ايدي 1 ...الى اخره ID ويكون المسح باليدي

Del 1 في اف 8 اوDEl 2 ... و هو يكتب

وشكرا

ObjectName = createObject(Id, x, y, z, rx, ry, rz) -- لإنشاء اوبجكت 
destroyElement ( ObjectName ) -- لحذف اي شئ 
moveObject ( ObjectName , 3000, x, y, z ) -- -- لنقل الاوبجكت الى اي مكان " 3000 هي سرعة الحركة 

الطريقة منجحة معي شوف وين الخطأ

شوف ملف سيرفر

function onCreateStinger(x, y, z, rx, ry, rz) 
    stinger = createObject(1225, x, y, z+0.1, rx, ry, rz) 
    setElementData(stinger, "isStinger", true) 
    triggerClientEvent( "onCreateStinger", getRootElement(), x, y, z) 
    stingerPlant(source) 
end 
addEvent( "onCreateStinger", true ) 
addEventHandler( "onCreateStinger", getRootElement(), onCreateStinger) 
  
function stingerPlant(player) 
    setPedAnimation(player, "BOMBER", "BOM_plant", 3000, false, false, false) 
    setTimer(setPedAnimation, 2000, 1, player) 
end 
function addPlayerCustomTag ( thePlayer, command, newTag ) 
    --Let's make sure the newTag param has been entered... 
    if ( newTag ) then 
        --Grab their current playername for saving. 
        local sPlayerNickname = getPlayerName ( thePlayer ) 
        --Create their new nickname with their tag 
        local sNewPlayerNickname = newTag .. " " .. sPlayerNickname 
  
        --Let's first load the element data, see if it's there already 
        --The reason for this is that if a player were to do /addtag twice, 
        --the tag would be prepended a second time 
        local sOldNick = getElementData( thePlayer, "tempdata.originalnick" ) 
        if ( sOldNick == false ) then 
            --Save their orignal nickname in their element data 
            setElementData ( thePlayer, "tempdata.originalnick", sPlayerNickname ) 
        end 
  
        --Set their new nickname globally 
        setPlayerName ( thePlayer, sNewPlayerNickname ) 
  
        --Tell them it's done 
        outputChatBox ( "Your new nickname has been set, to put it back to its original state you can use /deltag", thePlayer ) 
    else 
        --The newTag param was not entered, give an error message 
        outputChatBox ( "/addtag - Incorrect syntax, Correct: /addtag ", thePlayer ) 
    end 
end 
addCommandHandler ( "addtag", addPlayerCustomTag ) 
  
function removePlayerCustomTag ( thePlayer, command ) 
    --We first need to check that they have already used /addtag, let's do that now 
    local sOldNick = getElementData( thePlayer, "tempdata.originalnick" ) 
    if ( sOldNick ) then 
        --Great, they have a tag added, let's reset them 
  
        --First we will want to reset the element data back to its default (that being false) 
        setElementData ( thePlayer, "tempdata.originalnick", false ) 
  
        --Now set the client name back 
        setPlayerName( thePlayer, sOldNick ) 
  
        --Notify them 
        outputChatBox ( "Your old nickname has been set", thePlayer ) 
    end 
end 
addCommandHandler ( "deltag", removePlayerCustomTag ) 
  

ملف كلانت

function onCreateStinger(x, y, z, rx, ry, rz) 
    stinger = createObject(3578, x, y, z+0.1, rx, ry, rz) 
    setElementData(stinger, "isStinger", true) 
    triggerClientEvent( "onCreateStinger", getRootElement(), x, y, z) 
    stingerPlant(source) 
end 
addEvent( "onCreateStinger", true ) 
addEventHandler( "onCreateStinger", getRootElement(), onCreateStinger) 
  
function stingerPlant(player) 
    setPedAnimation(player, "BOMBER", "BOM_plant", 3000, false, false, false) 
    setTimer(setPedAnimation, 2000, 1, player) 
end 
function destroyElement ( 3578 ) -- لحذف اي شئ 
moveObject ( 3578 , 3000, x+0.1, y, z ) -- -- لنقل الاوبجكت الى اي مكان " 3000 هي سرعة الحركة 

Link to comment

مدري ليه تتجاهلون اللي يعطيكم وظائف وتردون على اللي يعطيكم كود ؟

ع العموم فيه طريقه ثانيه غير اللي قلتها واسهل تقريباً :

local t = {} 
local obj = createObject ( 980, x, y, z ) 
local obj2 = createObject ( 1337, x, y, z ) 
t [ obj ] = 980; 
t [ obj2 ] = 1337; 
  
addCommandHandler ( 'del', function ( _, _, id ) 
    if id then 
        for k,v in pairs ( t ) do  
            if v == tonumber ( id ) then 
                destroyElement ( k ) 
                    t [ k ] = nil; 
                break 
            end 
        end 
    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...