Jump to content

Need Help


Recommended Posts

Posted

I made this script to show marker and pickups...only for test..but i got Error: You may help me guys

ERROR:

:13: Bad argument @ 'createPickup' 

local pbags = { 
    {2293.154296875, 561.470703125, 7.78125} 
    {2422.3,-2261.6,16}, 
    {1758.9,-2767.9,1.7}, 
    {2493.3,-951.8,82.25}, 
    {815.7,-1108.2,25.8}, 
    {390.9,-2054.3,13.8}, 
    {-719.05,-1938.8,8.35}, 
    {-625.7,-2249.5,23.05}, 
    {-1812.3,-168.5,18.2}, 
    {-2659.5,1528.05,54.79}, 
    {-1733.76,194.75,3.6}, 
    {-2535.5,40.15,8.5}, 
    {-1804.85,558.45,35.15}, 
    {-752.6,-131.6,65.8}, 
} 
  
  
local marker = createMarker (2291.1999511719,537,0.80000001192093,"cylinder", 1.5, 255, 0, 0) 
  
  
function createBags ( thePlayer ) 
  
local x, y, z = pbags 
local bag = createPickup ( x, y, z, 3, 1550 ) 
  
end 
addEventHandler ("onResourceStart", getRootElement(), createBags) 
function onPickupHit ( thePlayer ) 
    if ( source ~= bag ) then 
        return 
        end 
    if ( isPedInVehicle ( thePlayer ) ) then 
        return 
    end 
        setElementCollisionsEnabled ( bag, false ) 
        attachElements ( bag, thePlayer, 0, -0.3, 0.3 ) 
        setElementData ( thePlayer, "bag", true ) 
        destroyElement ( bag ) 
end 
  
addEventHandler ("onPickupHit", getRootElement(), onPickupHit) 

Posted
local x, y, z = pbags 

Change it to:

local x, y, z = unpack ( pbags [ math.random ( #pbags ) ] ) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Ah, then you have to loop the table and create them.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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...