Jump to content

طلب كود صعب شوي للمبرمجن المحترفين


Recommended Posts

اذا واحد انقتل وكان معه اي نوع من الأسلحة يضهرن مكان موته والي يلمس السلاح ياخذه

يضهرن الأسلحة مكان موتهAK-47 و m4 إذا كان معه

+ اي واحد ينقتل يخسر منه 200 وال200 يضهرن عشكل فلوس والي يلمسهن ياخذ ال 200

Link to comment

خخخ مثال جاهز بالويكي

function createDeathPickup ( totalammo, killer, killerweapon, bodypart ) --when a player dies 
    x, y, z = getElementPosition ( source ) --get the position of the person who died and define it as x, y and z 
    currentweapon = getPlayerWeapon ( source ) --get the current weapon of the dead person 
    createPickup ( x, y, z, 2, currentweapon, 10000, totalammo ) 
end 
addEventHandler ( "onPlayerWasted", getRootElement(), createDeathPickup ) --add an event handler for onPlayerWasted 

+

  
getPedAmmoInClip -- على شان نجيب عدد الطلقات الي بالمخزن 
getPedTotalAmmo -- على شان نجيب عدد طلقات السلاح  
takePlayerMoney 
givePlayerMoney 
createPickup -- for Money icon  
  

https://wiki.multitheftauto.com/wiki/CreatePickup

Edited by Guest
Link to comment

اتمنى عدم السخرية

كلنت

function showAmmo(thePlayer, command, who ) 
    local targetPlayer = getPlayerFromName ( who ) 
    if ( thePlayer ) then 
        local ammo = getPedAmmoInClip ( targetPlayer ) 
        outputChatBox ( who .. " has " .. ammo .. " ammo in his active clip" ) 
    else 
        outputChatBox ( "Player '" .. who .. "' not found." ) 
    end 
end 
addCommandHandler( "ammo", showAmmo ) 
myPlayer = getPlayerFromName ( "Someguy" ) 
-- If a player called 'Someguy' was found then 
if ( myPlayer ) then 
    -- Retrieve the total amount of ammo for that player, and store it in a variable called 'ammo' 
    ammo = getPedTotalAmmo ( myPlayer ) 
    -- Tell all the players how much ammo 'Someguy' has 
    outputChatBox ( "Someguy's current total ammo: " .. ammo .. "." ) 
end 
  
  
  

سيرفر

addEventHandler ( "onPickupUse", money, pickupUse ) 
function createDeathPickup ( totalammo, killer, killerweapon, bodypart ) --when a player dies 
    x, y, z = getElementPosition ( source ) --get the position of the person who died and define it as x, y and z 
    currentweapon = getPlayerWeapon ( source ) --get the current weapon of the dead person 
    createPickup ( x, y, z, 2, currentweapon, 10000, totalammo ) 
end 
addEventHandler ( "onPlayerWasted", getRootElement(), createDeathPickup ) --add an event handler for onPlayerWasted 

Link to comment
local moneyAmmount = 200 
  
function createDeathPickup ( totalammo, killer, killerweapon, bodypart ) 
    x, y, z = getElementPosition ( source )  
    currentweapon = getPedWeapon ( source ) 
    if currentweapon == 30 or currentweapon == 31 then 
        wep = createPickup ( x, y, z, 2, currentweapon, _, totalammo ) 
    end 
    if getPlayerMoney ( source ) >= moneyAmmount then 
        money = createPickup ( x, y, z, 3, moneyAmmount) 
        takePlayerMoney ( source, moneyAmmount ) 
    end 
end 
addEventHandler ( "onPlayerWasted", getRootElement(), createDeathPickup ) 
  
addEventHandler ( 'onPickupUse', resourceRoot, 
function ( player ) 
    if source == wep then 
        destroyElement ( wep ) 
        wep = nil 
    elseif source == money then 
        destroyElement ( money ) 
        money = nil 
    end 
end 
) 
  

مو مجرب

Link to comment

جربه و شوف، انا ماجربته !

سيرفر -

function createItems( x, y, z, dmns, inter, wp, wAmmo ) 
      if type( x ) == "number" then 
            createPickup( x, y, z + 0.88, 2, wp, 10000, wAmmo ) 
            return true 
      end 
      return false 
end 
  
addEventHandler("onPedWasted", root, 
      function( ammo, killer, weapon ) 
             local x, y, z = getElementPosition( source ) 
             local dmns, inter = getElementDimension( source ), getElementInterior( source ) 
             if getPlayerMoney( source ) >= 200 then 
                     takePlayerMoney( source, 200 ) 
                     local items=createItems( x+0.79, y, z, 3, 1274, 10000, 200 ) 
             end 
             if getPlayerWeapon(source) == 30 or getPlayerWeapon(source) == 32 then 
                      local items=createItems( x, y, z, dmns, inter, getPlayerWeapon(source), getPedTotalAmmo(source, getPedWeaponSlot(source))) 
             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...