Problem
#1

Hello guys,i wrote this code to check if player is reloading and send a message on chat:

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);
   }
  }
 }
}
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.
Reply


Messages In This Thread
Problem - by Face9000 - 24.12.2011, 23:38
Re: Problem - by Mini` - 24.12.2011, 23:48
Re: Problem - by spedico - 24.12.2011, 23:49
Re: Problem - by Gh05t_ - 24.12.2011, 23:49
Re: Problem - by spedico - 24.12.2011, 23:52
Re: Problem - by Face9000 - 24.12.2011, 23:58
Re: Problem - by spedico - 25.12.2011, 00:00
Re: Problem - by spedico - 25.12.2011, 00:07
Re: Problem - by Face9000 - 25.12.2011, 00:08
Re: Problem - by Mini` - 25.12.2011, 00:13

Forum Jump:


Users browsing this thread: 1 Guest(s)