Jump to content

[HELP]Create Pickup


Recommended Posts

i insert This Codes but it does'nt worked:

function weaponTake ()
	createPickup (3334.8000488281, -7807.5, 673.79998779297, 2, 9, 1, 200)
	createPickup (3332.8000488281, -7805.5, 673.79998779297, 2, 24, 1, 200)
	createPickup (3330.8000488281, -7803.5, 673.79998779297, 2, 27, 1, 200)
	createPickup (3328.8000488281, -7801.5, 673.79998779297, 2, 29, 1, 200)
	createPickup (3326.8000488281, -7799.5, 673.79998779297, 2, 31, 1, 200)
	createPickup (3324.8000488281, -7797.5, 673.79998779297, 2, 34, 1, 200)
	createPickup (3322.8000488281, -7895.5, 673.79998779297, 2, 16, 1, 200)
end
addEventHandler("onResourceStart", root, weaponTake)

what can i do??

oh and when i create a pickup on MTA map editor it have'nt alpha :(

help me plz

Edited by DANFOR
Link to comment

that's on server side :| and i replaced root to resourceRoot. it does'nt worked again. can you tell me why pickups have'nt alpha on MTA map editor??before trying to make pickups with script i tryed to make pickups with MTA map editor. that was worked but it have'nt alpha. pls hlp me, thanks

allright allrigh allright ! i maked a pickup with script and it works ! my problem was position :) but still it have'nt alpha :( can you help me?

Link to comment

use /debugscript 3 and watch errors after starting script

and look at Required Arguments here:

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

or just use:

https://wiki.multitheftauto.com/wiki/SetElementAlpha

 

untested, but I think that will works 

local pickups = {
    {3334.8000488281, -7807.5, 673.79998779297, 2, 9, 1, 200},
    {3332.8000488281, -7805.5, 673.79998779297, 2, 24, 1, 200},
    {3330.8000488281, -7803.5, 673.79998779297, 2, 27, 1, 200},
    {3328.8000488281, -7801.5, 673.79998779297, 2, 29, 1, 200},
    {3326.8000488281, -7799.5, 673.79998779297, 2, 31, 1, 200},
    {3324.8000488281, -7797.5, 673.79998779297, 2, 34, 1, 200},
    {3322.8000488281, -7895.5, 673.79998779297, 2, 16, 1, 200}
}

for k,v in ipairs(pickups) do
    createPickup(v[1], v[2], v[3], v[4], v[5], v[5], v[6], v[7])
    setElementAlpha(v, 255)
end

 

Edited by NoviceWithManyProblems
Link to comment

Hey, check if it works :)

local weapSpawn = {
    {3334.8000488281, -7807.5, 673.79998779297, 2, 9, 1, 200},
    {3332.8000488281, -7805.5, 673.79998779297, 2, 24, 1, 200},
    {3330.8000488281, -7803.5, 673.79998779297, 2, 27, 1, 200},
    {3328.8000488281, -7801.5, 673.79998779297, 2, 29, 1, 200},
    {3326.8000488281, -7799.5, 673.79998779297, 2, 31, 1, 200},
    {3324.8000488281, -7797.5, 673.79998779297, 2, 34, 1, 200},
    {3322.8000488281, -7895.5, 673.79998779297, 2, 16, 1, 200},
}

local data = false

for i = 1, #weapSpawn do
    data = weapSpawn[i]
    createPickup(data[1], data[2], data[3], data[4], data[5], data[6], data[7])
end

 

Edited by !#NssoR_)
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...