PDA

View Full Version : else return format?


ivndosos
15/03/2018, 04:12 PM
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);

ivndosos
15/03/2018, 04:21 PM
Fixed, I forgot quote.