array help
#1

i have this code


Код:
new vid[9][1] = {
{472},
{473},
{493},
{595},
{484},
{430},
{453},
{446},
{454}
};



if(IsPlayerInVehicle(playerid,vid))
{
//function
}

and then i get this..

C:\Program Files\Rockstar Games\GTA San Andreas\samp sever\filterscripts\admin.pwn(623) : error 035: argument type mismatch (argument 2)
Reply
#2

Which is line 623?
Reply
#3

if(IsPlayerInVehicle(playerid,vid))
{
//function
}
Reply
#4

second argument of that function should be an integer, not an array
try this:
pawn Код:
for (new vehicle, size = sizeof(vid); vehicle < size; vehicle++)
{
    if (IsPlayerInVehicle(playerid, vid[vehicle]))
    {
        // some code       
    }  
}
Reply
#5

im still haveing the same problem


C:\Program Files\Rockstar Games\GTA San Andreas\samp sever\filterscripts\admin.pwn(154 : error 035: argument type mismatch (argument 2)


this is the hole code im useing


Код:
if (IsPlayerInVehicle(playerid, vid[vehicle]))
{
	if(gTeam[playerid] == TEAM_POLICE || ispassenger)
		{
		return 1;
		}
	else
  	{
		SendClientMessage(playerid, c_r, "[ ! ] This vehicle is for cops only !");
		GetPlayerPos(playerid,Float:LocX,Float:LocY,Float:LocZ);
		SetPlayerPos(playerid,Float:LocX,Float:LocY,Float:LocZ);
		return 1;
		}
	}
	}


new vid[9][1] = {
{472},
{473},
{493},
{595},
{484},
{430},
{453},
{446},
{454}
};
Reply
#6

Quote:
Originally Posted by sggassasin
im still haveing the same problem
it says the problem is on line 1548, when it was earlier on line 623
Reply
#7

Probably a separate error, that's how PAWNO works.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)