It's one of the many important functions included in here: https://sampforum.blast.hk/showthread.php?tid=348044.
|
GetWeaponID(weaponName[], bool: ignoreCase = true, bool: useFind = false)
GivePlayerWeapon(playerid, GetWeaponID(params));
pawn Код:
|
stock GetWeaponID(weaponName[], bool: ignoreCase = true, bool: useFind = false)
{
new weaponID = -1;
if(useFind == false)
{
for(new i = 0, sof = sizeof(svAddons_WeaponNames); i < sof; i++)
{
if(!strcmp(svAddons_WeaponNames[i], weaponName, ignoreCase))
{
weaponID = i;
break;
}
}
}
else if(useFind == true)
{
for(new i = 0, sof = sizeof(svAddons_WeaponNames); i < sof; i++)
{
if(strfind(svAddons_WeaponNames[i], weaponName, ignorecase) > -1)
{
weaponID = i;
break;
}
}
}
return weaponID;
}
\pawno\include\svAddons.inc(120) : warning 219: local variable "interior" shadows a variable at a preceding level
\pawno\include\svAddons.inc(742) : warning 219: local variable "interior" shadows a variable at a preceding level
\pawno\include\svAddons.inc(752) : warning 219: local variable "interior" shadows a variable at a preceding level
\pawno\include\svAddons.inc(768) : warning 219: local variable "time" shadows a variable at a preceding level
\pawno\include\svAddons.inc(768) : warning 219: local variable "interior" shadows a variable at a preceding level
\pawno\include\svAddons.inc(784) : warning 219: local variable "interior" shadows a variable at a preceding level
\pawno\include\svAddons.inc(842) : warning 219: local variable "interior" shadows a variable at a preceding level
(3725) : error 035: argument type mismatch (argument 3)