Fire Fighter problem

Started by Kewun, Aug 12, 2016, 10:23 AM

Previous topic - Next topic

Kewun

function onFireStart()
{
CreateExplosion(1,1,random(firefighter_pos), -1, true)  // ERRROR * Wrong number of parameters *
Message("[#00ff00]A fire has started somewhere in map, go find it")
}

im getting error wrong numbers of parameters in the CreateExplosion function, what is wrong?

my table of fighter_pos :
local firefighter_pos = [
[[941.928, -1022.5, 10.6707, 0.0138358],
[1195.75, -48.8512, 9.47806, 359.985],
[1128.21, -950.044, 14.472, 0.00264536],
[1370.7, -298.81, 49.52, 359.995],
[913.7, -41.75, 7, 359.985],
[1280.65, -283.827, 34.5798, 0.31984],
[1050.76, -933.853, 14.4798, 359.985],
[1125.76, -388.848, 19.5033, 359.985],
[900.749, -722.203, 14.4648, 359.985],
[1195.74, -167.367, 19.2187, 0.0408136],
[1343.53, -742.229, 14.5921, 359.993],
[1370.76, -388.828, 49.5362, 359.985],
[1125.75, -303.855, 19.4859, 359.985],
[870.7, -273.82, 4.5, 359.985],
[835.75, -368.429, 11.9451, 0.136518],
[1050.75, -768.853, 14.4842, 359.985]],

[[224.31, -1571.4, 25.67, 359.937],
[41.82, -1441.4, 25.7, 359.985],
[426.79, -736.438, 25.6633, 0.00343407],
[106.81, -90.42, 15.67, 0.000608801],
[-63.2039, -886.441, 25.6804, 359.985],
[426.8, -1051.4, 25.68, 359.985],
[106.81, -206.42, 15.7, 359.985],
[146.75, -1143.1, 25.68, 359.985],
[-83.2273, -964.033, 25.6845, 0.0253804],
[406.809, -956.445, 25.6526, 359.985],
[146.88, -1231.4, 25.69, 359.985],
[330.2, -401.4, 22.76, 0.0180807],
[124.07, -606.9, 25.69, 359.985],
[186.883, -1314.75, 25.6379, 359.985],
[251.83, -321.32, 25.02, 359.967],
[306.83, -1041.4, 25.69, 9.52728e-05]],

[[-894.463, 296.869, 33.3691, 359.985],
[-689.9, 122.44, 20.86, 359.994],
[-943.1, -289.19, 33.38, 8.4],
[-1277.83, -23.1354, 60.7767, 359.907],
[-735.6, -576.5, 8.39, 359.985],
[-831.146, -280.638, 28.2178, 359.683],
[-1084.46, 256.369, 3.38379, 359.938],
[-702, -569.6, 13.78, 356.856],
[-996.582, -218.325, 33.9707, 359.93],
[-1165.03, 12.4422, 58.3662, 359.985],
[-800.833, 177.216, 15.8602, 0.794422],
[-739.047, -13.9073, 3.37248, 359.938],
[-810.011, -142.569, 33.3721, 359.986],
[-490.005, 87.4437, 3.37987, 359.985]]
];

Kewun

full error:
AN ERROR HAS OCCURED [wrong number of parameters]

CALLSTACK
*FUNCTION [onFireStart()] server.nut line [955]

LOCALS
[firefighter_pos] ARRAY
[this] TABLE


KAKAN

Seems like you can't read English. Check the wiki, the error simply means that there are not enough parameters.
oh no

Kewun

but i even tried Vector(random(firefighter_pos)) .-.
and the parameters are right, idk what is wrong. 5 params, and me 5 params too

jayant

Check the firefighter random pos you have.

Kewun

#5
now i see the problem, thx. should be 3 params, not 4 lol, 4th one is angle. damn lu ;c


edit: fak, same error.

Kewun

local firefighter_pos = [
[[941.928, -1022.5, 10.6707],
[1195.75, -48.8512, 9.47806],
[1128.21, -950.044, 14.472],
[1370.7, -298.81, 49.52],
[913.7, -41.75, 7],
[1280.65, -283.827, 34.5798]]
];

Diego^

Try:

function onFireStart()
{
local firefighter_pos = [
Vector( 941.928, -1022.5, 10.6707 ),
Vector( 1195.75, -48.8512, 9.47806 ),
Vector( 1128.21, -950.044, 14.472 ),
Vector( 1370.7, -298.81, 49.52 ),
Vector( 913.7, -41.75, 7 ),
Vector( 1280.65, -283.827, 34.5798 )
];

CreateExplosion( 1, 1, firefighter_pos[ random( 0, firefighter_pos.len() ) ], -1, true );
Message( "[#00ff00]A fire has started somewhere in map, go find it" );
}

BRL's Developer.

Kewun