Mats don't decrease.
#1

Hey there ,

I got a problem that the mats won't decrease after doing the command.

Here's my command:

Код:
dcmd_acceptgun(playerid, params[])
	{
	    #pragma unused params
    	if(weaponbeingoffered[playerid] == 0)
		{
	 	SendClientMessage(playerid, COLOR_GREY, "No-one has offered you a weapon.");
	 	return 1;
	 	}
		if(beingofferedby[playerid] > -1)
		{
			new str[128];
	 		new price;
	 		GunPrice[playerid] = price;
		    GivePlayerWeapon(playerid, weaponbeingoffered[playerid], 60000);
			format(str, sizeof(str), "[SOLD]: %s has accepted the weapon.", GetName(playerid));
			SendClientMessage(beingofferedby[playerid], COLOR_CYAN, str);
			format(str, sizeof(str), "[SOLD]: You have accepted the weapon from %s for $%d", GetName(beingofferedby[playerid]), price);
			SendClientMessage(beingofferedby[playerid], COLOR_CYAN, str);
			beingofferedby[playerid] = -1;
	  		weaponbeingoffered[playerid] = 0;
			PlayerInfo[playerid][pCash] -= GunPrice[playerid];
			PlayerInfo[playerid][pCash] -= GunOffer[playerid];
			if(weaponbeingoffered[playerid] == 23)
			{
	  		PlayerInfo[beingofferedby[playerid]][pMats] -= 100;
	  		return 1;
	  		}
	  		if(weaponbeingoffered[playerid] == 22)
	  		{
	    	PlayerInfo[beingofferedby[playerid]][pMats] -= 150;
	    	return 1;
			}
	  		if(weaponbeingoffered[playerid] == 25)
	  		{
	  		PlayerInfo[beingofferedby[playerid]][pMats] -= 200;
	  		return 1;
	  		}
	  		if(weaponbeingoffered[playerid] == 29)
			{
	  		PlayerInfo[beingofferedby[playerid]][pMats] -= 400;
	  		return 1;
	  		}
	  		if(weaponbeingoffered[playerid] == 5)
	  		{
	  		PlayerInfo[beingofferedby[playerid]][pMats] -= 25;
	  		return 1;
	  		}
	  		if(weaponbeingoffered[playerid] == 33)
	  		{
	  		PlayerInfo[beingofferedby[playerid]][pMats] -= 1500;
	  		return 1;
	  		}
	  	  	if(weaponbeingoffered[playerid] == 8)
			{
	  		PlayerInfo[beingofferedby[playerid]][pMats] -= 50;
	  		return 1;
  			}
	  		if(weaponbeingoffered[playerid] == 30)
	  		{
	  		PlayerInfo[beingofferedby[playerid]][pMats] -= 2000;
	  		return 1;
	  		}
	  		if(weaponbeingoffered[playerid] == 24)
	  		{
	  		PlayerInfo[beingofferedby[playerid]][pMats] -= 1000;
	  		return 1;
	  		}
	  		if(weaponbeingoffered[playerid] == 27)
	  		{
	  		PlayerInfo[beingofferedby[playerid]][pMats] -= 6000;
	  		return 1;
	  		}
	  		if(weaponbeingoffered[playerid] == 31)
	  		{
	  		PlayerInfo[beingofferedby[playerid]][pMats] -= 3000;
	  		return 1;
	  		}
	  		if(weaponbeingoffered[playerid] == 34)
  			{
	  		PlayerInfo[beingofferedby[playerid]][pMats] -= 7000;
	  		return 1;
	  		}
	  		if(weaponbeingoffered[playerid] == 1)
	  		{
	    	PlayerInfo[beingofferedby[playerid]][pMats] -= 50;
			return 1;
			}
	  		return 1;
		}
		return 1;
	}
I don't get errors so there's not the problem!

Thanks for reading and I hope you can help me fixing this problem!

EDIT: Sorry for this I'm in the wrong section. I'm very tired maybe that's the problem of seeing this to late. I will post this in the Scripting Help section. Sorry again....

- Mariooo -
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)