values in new float doesn't get the info
#1

Hi, Finally i am here to ask help lmao.
Ok so my problem is as follows. You may first see the codes :
Код:
new Float:Spawns[][] =
{
	{PosX[playerid],PosY[playerid],PosZ[playerid],Angle[playerid]},
    {PosX1[playerid],PosY1[playerid],PosZ1[playerid],Angle1[playerid]},
    {PosX2[playerid],PosY2[playerid],PosZ2[playerid],Angle2[playerid]},
    {PosX3[playerid],PosY3[playerid],PosZ3[playerid],Angle3[playerid]},
    {PosX4[playerid],PosY4[playerid],PosZ4[playerid],Angle4[playerid]},
    {PosX5[playerid],PosY5[playerid],PosZ5[playerid],Angle5[playerid]}
};
Ok, so i am using the positions as random by 1 command. I am working on an include which i will release soon. But, i got these errors, When i run the include file from another script( new ).
Код:
\pawno\include\randompos.inc(158) : error 020: invalid symbol name ""
\pawno\include\randompos.inc(163) : error 010: invalid function or declaration
Help me for this. Thank you.
John_Blaze ( WSRPG )
Reply
#2

Arrays can only be declared with constant values
But why don't you use 2d arrays for PosX, PosY, ... instead of PosX, PosX1, PosX2?

With 2d arrays you could do
PHP код:
GetRandomPos(playeridFloatXFloatYFloatZFloatA) {
    new
        
rand random(sizeof PosX)
    ;
    
PosX[rand][playerid];
    
PosY[rand][playerid];
    
PosZ[rand][playerid];
    
Angle[rand][playerid];

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)