Server sided money(points) help.
#7

Okay It's working perfectly the only problem is:

For example I have 11 points and M4 costs 10 points, I can buy it,

If I have exactly 10 points I can't buy it, If I have less that 10 too I also can't buy it

Код:
stock SellWeapon(playerid, points, weapon, ammo)
{
   new ppoints = GetPlayerPoints(playerid);
   if(ppoints>points)
   {
	  new string[80], weaponname[32];
	  GivePlayerPoints(playerid, -points);
	  GetPlayerPoints(playerid);
	  GivePlayerWeapon(playerid, weapon,ammo);
	  GetWeaponName(weapon, weaponname, sizeof(weaponname));
	  format(string, sizeof(string), "{EFB509}(SHOP) You have bought %s with %i ammo for %i points", weaponname, ammo, points);
	  return SendClientMessage(playerid, -1, string);
   }
   else return SendClientMessage(playerid, -1,"{FF0000}(INFO) You don't have enough points");
}
forward GetPlayerPoints(playerid);
public GetPlayerPoints(playerid)
{
    return pInfo[playerid][Points];
}
forward GivePlayerPoints(playerid, amount);
public GivePlayerPoints(playerid,amount)
{
    pInfo[playerid][Points]=pInfo[playerid][Points]+amount;
    return 1;
}
Reply


Messages In This Thread
Server sided money(points) help. - by ivndosos - 05.02.2018, 06:52
Re: Server sided money(points) help. - by Sew_Sumi - 05.02.2018, 07:17
Re: Server sided money(points) help. - by Kane - 05.02.2018, 07:22
Re: Server sided money(points) help. - by Sew_Sumi - 05.02.2018, 07:28
Re: Server sided money(points) help. - by ivndosos - 05.02.2018, 07:29
Re: Server sided money(points) help. - by Sew_Sumi - 05.02.2018, 08:52
Re: Server sided money(points) help. - by ivndosos - 05.02.2018, 08:57
Re: Server sided money(points) help. - by Sew_Sumi - 05.02.2018, 09:00
Re: Server sided money(points) help. - by ivndosos - 05.02.2018, 09:04

Forum Jump:


Users browsing this thread: 1 Guest(s)