Quote:
Originally Posted by Speed++
EDIT:
Don't work...
PHP код:
GivePlayerWeapons(playerid, ...)
{
new
start = 1,
num = numargs();
for(new i = start; i < num; i++)
{
GivePlayerWeapon(playerid, getarg(i), getarg(i + 1));
}
return 1;
}
use...
PHP код:
GivePlayerWeapons(playerid, 9, 1, 26, 400, 46, 450); // Chainsaw, Sawnoff Shotgun & Tec-9
give me a parachute, Brass Knuckles, Chainsaw, Sawnoff Shotgun, Tec-9
the syntax is:
PHP код:
GivePlayerWeapons(playerid, weapon_1, ammo_1, weapon_2, ammo_2, weapon_3, ammo_3);
etc
|
pawn Код:
GivePlayerWeapons(playerid, ...)
{
new
start = 1,
num = numargs();
for(new i = start; i < num; i+= 2)
{
GivePlayerWeapon(playerid, getarg(i), getarg(i + 1));
}
return 1;
}
Problem was you would need to increment the index by 2 every time the loop iterates, as you need to jump an extra argument ahead to get to the next weapon.
Hope that helps.