24.12.2011, 23:38
Hello guys,i wrote this code to check if player is reloading and send a message on chat:
But i get this errors:
error 001: expected token: ";", but found "public"
error 017: undefined symbol "i"
error 017: undefined symbol "i"
error 029: invalid expression, assumed zero
What's wrong?Also,i wanna know if the code is written right.Thanks.
pawn Код:
forward CheckReloadingWeapon()
public CheckReloadingWeapon()
{
if(GetPlayerWeaponState(i) == WEAPONSTATE_RELOADING && laststate[i] != WEAPONSTATE_RELOADING)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerWeaponData(i, 7, weap, ammo);
new string [128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(i, pName, sizeof(pName));
format(string, sizeof(string), "%s is reloading.Weapon: %s - Ammo %d", pName,weap,ammo);
SendClientMessageToAll(0xFF0000FF, string);
}
}
}
}
error 001: expected token: ";", but found "public"
error 017: undefined symbol "i"
error 017: undefined symbol "i"
error 029: invalid expression, assumed zero
What's wrong?Also,i wanna know if the code is written right.Thanks.