else return format?
#1

I know why my pawno crashed, but what's the way to do it then?

Код:
stock SellGun(playerid, price, weaponid, ammo) {

   new
	   gPlayerMoney = GetPlayerMoney(playerid);
	   
   if(gPlayerMoney > price) {

	  new
		  String[80],
		  WeaponName[32];
		  
	  GivePlayerMoney(playerid, -price);
	  GivePlayerWeapon(playerid, weaponid, ammo);
	  
	  GetWeaponName(weaponid, WeaponName, sizeof (WeaponName));
	  
	  format(String, sizeof(String),
	  
	  "SERVER: You have bought %s(Ammo: %i) for $%i), WeaponName, ammo, price);
	  
	  return SendClientMessage(playerid, -1, String);
  }
  else return format(String, sizeof(String),
  
  "You don't have enough money to buy %s (Money Required: $%i), WeaponName, price);
  
  SendClientMessage(playerid, -1, String);
}
This specific piece of code makes it crash.
:

Код:
  else return format(String, sizeof(String),
  
  "You don't have enough money to buy %s (Money Required: $%i), WeaponName, price);
  
  SendClientMessage(playerid, -1, String);
Reply
#2

Fixed, I forgot quote.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)