Use this, it looks better:
PHP Code:
shoph( response )
{
self iPrintln("Loool the script has reached this point: 1"); // delete this row if the script works!!!
if (! isDefined(self.pers["team"]) || self.pers["team"] == "spectator")
return;
self iPrintln("Loool the script has reached this point: 2"); // delete this row if the script works!!!
if (self.pers["team"] != "allies" || ! isDefined(self.argent))
return;
self iPrintln("Loool the script has reached this point: 3"); // delete this row if the script works!!!
switch (response)
{
case "energy1":
price = 400; // set the price of the product
if (self.argent < price)
{
self iprintlnbold("^2Y^7ou ^2M^7ust ^2H^7ave " + price + " ^2M^7oney");
}
else
{
self.argent -= price;
self takeWeapon("frag_grenade_american_mp");
self giveWeapon("frag_grenade_american_mp");
self setWeaponClipAmmo("frag_grenade_american_mp", 1);
self iprintlnbold("^2Y^7ou ^2G^7ot 1 ^2N^7ade ^2[^4-" + price + "^2]");
}
break;
case "energy2":
price = 1000; // set the price of the product
if (self.argent < price)
{
self iprintlnbold("^2Y^7ou ^2M^7ust ^2H^7ave " + price + " ^2M^7oney");
}
else
{
self.argent -= price;
self takeWeapon("frag_grenade_american_mp");
self giveWeapon("frag_grenade_american_mp");
self setWeaponClipAmmo("frag_grenade_american_mp", 3);
self iprintlnbold("^2Y^7ou ^2G^7ot 3 ^2N^7ades ^2[^4-" + price + "^2]");
}
break;
default:
break;
}
}