06.03.2011, 17:25
Hi!
I have a little question about parameters. You have for example the "format" thing.
There you can do:
format(*, *, *, PARAM, PARAM, PARAM)
Well, alot of parameters. The native is "{Float,_}:..."
I'd like to make something like this too, with the "RemovePlayerWeapon" function. Examples:
RemovePlayerWeapon(playerid, 29);
OR
RemovePlayerWeapon(playerid, 29, 39, 1
;
etc...
How do I have to do this? I tried something, but it didn't work, and I don't really know it no more. I tried {Float,_}:weaponid and {Text3D,_}:weaponid. This is the function I have right now:
Thanks in advance.
- Kevin
I have a little question about parameters. You have for example the "format" thing.
There you can do:
format(*, *, *, PARAM, PARAM, PARAM)
Well, alot of parameters. The native is "{Float,_}:..."
I'd like to make something like this too, with the "RemovePlayerWeapon" function. Examples:
RemovePlayerWeapon(playerid, 29);
OR
RemovePlayerWeapon(playerid, 29, 39, 1

etc...
How do I have to do this? I tried something, but it didn't work, and I don't really know it no more. I tried {Float,_}:weaponid and {Text3D,_}:weaponid. This is the function I have right now:
pawn Код:
stock RemovePlayerWeapon(playerid, {Float,_}:weaponid)
{
new WepInfo[13][2], CurWeap = GetPlayerWeapon(playerid);
for(new i = 0; i < 13; i++)
GetPlayerWeaponData(playerid, i, WepInfo[i][0], WepInfo[i][1]);
ResetPlayerWeapons(playerid);
for(new i = 0; i < 13; i++)
{
if(WepInfo[i][0] != weaponid)
GivePlayerWeapon(playerid, WepInfo[i][0], WepInfo[i][1]);
}
return 1;
}
- Kevin