Posts: 3,324
Threads: 96
Joined: Sep 2013
Quote:
Originally Posted by vannesenn
I can't find any tutorial how to include/add/put vehicle ids into iterate.
|
pawn Code:
new Iterator:vehicles<MAX_VEHICLES>;
Iter_Add(vehicles, a_vehicle_id_here);
and to see if 'a_vehicle_id_here' is in 'vehicles'
pawn Code:
if(Iter_Contains(vehicles, a_vehicle_id_here))
It's really simple, and just as simple in ArrayList
Posts: 58
Threads: 0
Joined: May 2017
can help?
PHP Code:
D:\games\NFS 2017 Next Build\gamemodes\NFS_Buss6Updates.pwn(16596) : error 017: undefined symbol "Iter_Func@ValidComponents"
D:\games\NFS 2017 Next Build\gamemodes\NFS_Buss6Updates.pwn(35098) : error 017: undefined symbol "Iter_Func@ValidComponents"
D:\games\NFS 2017 Next Build\gamemodes\NFS_Buss6Updates.pwn(35094) : warning 204: symbol is assigned a value that is never used: "v"
CMD:vtune(playerid)
{
if((vID = GetPlayerVehicleID(playerid)) == 0)
{
Error(playerid, "You must be in a vehicle to apply mods!");
return true;
}
/*if(pPremium[playerid] == 0)
{
Error(playerid, "You must be a premium member to use this command, check /premium for more info.");
return true;
}*/
if(InDM[playerid] != 0)
{
Error(playerid, "You can't tune your vehicle while in a DM!");
return true;
}
if(InEvent[playerid] != 0 && pAdmin[playerid] != 5)
{
Error(playerid, "This command cannot be used while in a derby!");
return true;
}
if(doingStunt[playerid] == 19 && pAdmin[playerid] != 5)
{
Error(playerid, "This command cannot be used while in a derby!");
return true;
}
new v = GetVehicleModel(vID);
iTemp = 0;
str = "";
line = "";
foreach(new xx : ValidComponents(v)) //THIS LINE
{
// Exclude NOS, wheels and stereo
if(GetVehicleComponentInSlot(vID, GetVehicleComponentType(xx)) != xx)
{
format(str, sizeof(str), ""RED_E"%d: %s\n", xx, componentName[xx - 1000]);
}
else
{
format(str, sizeof(str), ""GREEN_E"%d: %s\n", xx, componentName[xx - 1000]);
}
// TO-DO: optimize concatenation?
strcat(line, str);
iTemp ++;
}
if(iTemp == 0)
{
SendClientMessage(playerid, COLOR_GREY, "No components suit this vehicle!");
return true;
}
ShowPlayerDialog(playerid, 37, DIALOG_STYLE_LIST, "Available components", line, "Apply", "Close"); // TO-DO: memory optimization
return true;
}
Posts: 203
Threads: 4
Joined: Feb 2017
Reputation:
0
@NewFreeroamStunt
ValidComponents(v) > ValidComponents[v]
Also, did you created Iter?
Posts: 266
Threads: 22
Joined: Jan 2017
Reputation:
0
is there an up-to-date list of current y_iterate functions with explanations + returns?