error 033: array must be indexed (variable "GetWeaponDamage")
format(AddStr, sizeof(AddStr), "\n%d hits from %s("COL_RED"-%d"COL_WHITE") to HEAD", ShotAt[playerid][i][Bodypart][z], WeaponName(i), GetWeaponDamage(i)*2), strcat(dmgstring, AddStr);
GetWeaponDamage(WeaponID)
{
new wepdamage[20];
switch(WeaponID)
{
case 0,1..8: format(wepdamage,sizeof(wepdamage), "%d", floatround(WEAPON_DMG_BRASS));
case 22: format(wepdamage,sizeof(wepdamage), "%d", floatround(WEAPON_DMG_COLT));
case 23: format(wepdamage,sizeof(wepdamage), "%d", floatround(WEAPON_DMG_SILENCED));
case 24: format(wepdamage,sizeof(wepdamage), "%d", floatround(WEAPON_DMG_DEAGLE));
case 25: format(wepdamage,sizeof(wepdamage), "%d", floatround(WEAPON_DMG_SHOTGUN));
case 27: format(wepdamage,sizeof(wepdamage), "%d", floatround(WEAPON_DMG_COMBAT));
case 28: format(wepdamage,sizeof(wepdamage), "%d", floatround(WEAPON_DMG_UZI));
case 29: format(wepdamage,sizeof(wepdamage), "%d", floatround(WEAPON_DMG_MP5));
case 30: format(wepdamage,sizeof(wepdamage), "%d", floatround(WEAPON_DMG_AK47));
case 31: format(wepdamage,sizeof(wepdamage), "%d", floatround(WEAPON_DMG_M4));
case 32: format(wepdamage,sizeof(wepdamage), "%d", floatround(WEAPON_DMG_TEC9));
case 33: format(wepdamage,sizeof(wepdamage), "%d", floatround(WEAPON_DMG_RIFLE));
case 34: format(wepdamage,sizeof(wepdamage), "%d", floatround(WEAPON_DMG_SNIPER));
}
return wepdamage;
}
format(AddStr, sizeof(AddStr), "\n%d hits from %s("COL_RED"-%d"COL_WHITE") to HEAD", ShotAt[playerid][i][Bodypart][z], WeaponName(i), GetWeaponDamage(i)*2), strcat(dmgstring, AddStr);
Код:
format(AddStr, sizeof(AddStr), "\n%d hits from %s("COL_RED"-%d"COL_WHITE") to HEAD", ShotAt[playerid][i][Bodypart][z], WeaponName(i), GetWeaponDamage(i)*2), strcat(dmgstring, AddStr); |
GetWeaponDamage(WeaponID) { switch(WeaponID) { case 0,1..8: return floatround(WEAPON_DMG_BRASS); case 22: return floatround(WEAPON_DMG_COLT); case 23: return floatround(WEAPON_DMG_SILENCED); case 24: return floatround(WEAPON_DMG_DEAGLE); case 25: return floatround(WEAPON_DMG_SHOTGUN); case 27: return floatround(WEAPON_DMG_COMBAT); case 28: return floatround(WEAPON_DMG_UZI); case 29: return floatround(WEAPON_DMG_MP5); case 30: return floatround(WEAPON_DMG_AK47); case 31: return floatround(WEAPON_DMG_M4); case 32: return floatround(WEAPON_DMG_TEC9); case 33: return floatround(WEAPON_DMG_RIFLE); case 34: return floatround(WEAPON_DMG_SNIPER); } return -1; }