SA-MP Forums Archive
else return format? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: else return format? (/showthread.php?tid=651194)



else return format? - ivndosos - 15.03.2018

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);



Re: else return format? - ivndosos - 15.03.2018

Fixed, I forgot quote.