SA-MP Forums Archive
array help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: array help (/showthread.php?tid=94315)



array help - sggassasin - 29.08.2009

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)


Re: array help - ded - 29.08.2009

Which is line 623?


Re: array help - sggassasin - 29.08.2009

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



Re: array help - Zeex - 29.08.2009

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



Re: array help - sggassasin - 29.08.2009

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}
};



Re: array help - M4S7ERMIND - 29.08.2009

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


Re: array help - ded - 29.08.2009

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