Jump to content

WelCome

Members
  • Posts

    33
  • Joined

  • Last visited

Everything posted by WelCome

  1. WelCome

    Tables

    Why this code didnt work? tablee = {} col_table = {} local function take(thePlayer) if isElementWithinColShape(thePlayer,col) then local ammo = getPickupAmmo(pickup) local bron = getPickupWeapon(pickup) giveWeapon(thePlayer,bron,ammo) outputChatBox("test") table.remove(col_table) table.remove(tablee) end end local function weapon_drop (thePlayer) local bron = getPlayerWeapon(thePlayer) local ammo = getPedTotalAmmo(thePlayer) local slot = getPedWeaponSlot(thePlayer) local x,y,z = getElementPosition(thePlayer) local pickup_bron = getPedWeapon(thePlayer) local p = getPedWeapon(thePlayer) if slot >= 0 then if ammo >= 0 then pickup = createPickup(x,y,z,2,p,0,ammo) col = createColSphere(x,y,z,1.0) table.insert(col_table,col) takeWeapon(thePlayer,p,ammo) table.insert(tablee,pickup) addEventHandler("onPickupHit",pickup,take) end end end addCommandHandler("bind_q",function(thePlayer) bindKey(thePlayer,"U","down",weapon_drop,thePlayer) bindKey(thePlayer,"I","down",take,thePlayer) end)
  2. WelCome

    Error

    I want drop weapon and pick weapon but if u drop two weapon first weapon will didnt cant pick
  3. WelCome

    Error

    Why this code didn't work tablee = {} col_table = {} local function take(thePlayer) if isElementWithinColShape(thePlayer,col) then local ammo = getPickupAmmo(pickup) local bron = getPickupWeapon(pickup) giveWeapon(thePlayer,bron,ammo) outputChatBox("test") table.remove(col_table) table.remove(tablee) end end local function weapon_drop (thePlayer) local bron = getPlayerWeapon(thePlayer) local ammo = getPedTotalAmmo(thePlayer) local slot = getPedWeaponSlot(thePlayer) local x,y,z = getElementPosition(thePlayer) local pickup_bron = getPedWeapon(thePlayer) local p = getPedWeapon(thePlayer) if slot >= 0 then if ammo >= 0 then pickup = createPickup(x,y,z,2,p,0,ammo) col = createColSphere(x,y,z,1.0) table.insert(col_table,col) takeWeapon(thePlayer,p,ammo) table.insert(tablee,pickup) addEventHandler("onPickupHit",pickup,take) end end end addCommandHandler("bind_q",function(thePlayer) bindKey(thePlayer,"U","down",weapon_drop,thePlayer) bindKey(thePlayer,"I","down",take,thePlayer) end)
  4. WelCome

    Error

    function take(thePlayer) if isElementWithinColShape(thePlayer,col) then local ammo = getPickupAmmo(pickup) local bron = getPickupWeapon(pickup) giveWeapon(thePlayer,bron,ammo) outputChatBox("test") destroyElement(col) destroyElement(pickup) end end function weapon_drop (thePlayer) local bron = getPlayerWeapon(thePlayer) local ammo = getPedTotalAmmo(thePlayer) local slot = getPedWeaponSlot(thePlayer) local x,y,z = getElementPosition(thePlayer) local pickup_bron = getPedWeapon(thePlayer) local p = getPedWeapon(thePlayer) if slot > 1 then if ammo > 1 then pickup = createPickup(x,y,z,2,p,0,ammo) col = createColSphere(x,y,z,1.0) addEventHandler("onPickupHit",pickup,take) takeWeapon(thePlayer,p,ammo) end end end addCommandHandler("bind_q",function(thePlayer) bindKey(thePlayer,"U","down",weapon_drop,thePlayer) bindKey(thePlayer,"I","down",take,thePlayer) end) I want to drop weapon,this code work but if is 2 pickup and if u hit 1 pickup, 2 will not work Pls help me
  5. WelCome

    Timer

    You can't help me here ?
  6. WelCome

    Timer

    I changed it, but it does not work sry for bad english i use google translator
  7. WelCome

    Timer

    function timer(player) if getPlayerTeam(player)==team then print("Work") local losuj = math.random(1,3) if losuj==1 then givePlayerMoney(player,2000) elseif losuj==2 then setPedArmor(player,100) setElementHealth(player,100) elseif losuj==3 then giveWeapon(player,36,3) end end end setTimer(timer,2000,0,source) DebugScript 3 : Bad argument 'getPlayerTeam' [Expected player at argument 1,got nil]
×
×
  • Create New...