[POMOC] Hitno skladiste


Započeo Danisha, Decembar 12, 2012, 17:24:32 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim:ravens preradjeni
Detaljan opis problema:e ovako napravio sam skladiste i sada ocu da se nemoze uzet iz njega dok prvo ne prilozis matsa i onda mozes uzet bilo kojeg guna npr stavis 1000 matsa i mozes uzeti 500 metaka bilo kojeg guna ili 2000matsa i mozes uzet 1000guna bilo kojeg a isto tako da nemozes uzet ni mats dok ne prilozis oruzja bilo kojeg npr ja prilozim 1000metaka nekog guna i mogu uzeti 2000matsa i tako jel konatate
EVO DOLE KOMANDE OD GUNA I MATSA
Dio skripte:
EVO /TAKEGUNS
CMD:takeguns(playerid, params[])
{
	if(IsPlayerConnected(playerid))
	{
		new x_nr[24];
		new string[128],sendername[MAX_PLAYER_NAME],ammo;
		GetPlayerName(playerid,sendername,sizeof(sendername));
		if(sscanf(params,"s[24]D",x_nr,ammo))
		{
			SCM(playerid, COLOR_WHITE, "Koriscenje: /takeguns [slot 1-5] [kolicina]");
			return 1;
		}
		if(ReduceTime[playerid] == 1)
		{
			SCM(playerid, COLOR_GREY, "   Moras sacekati 3 sekunde da ponovo koristis ovu komandu !");
			return 1;
		}
		if(ServerRestartovan == 1) return 1;
		if(PlayerInfo[playerid][pLeader] == 22 || PlayerInfo[playerid][pMember] == 22)
		{
			ReduceTime[playerid] = 1;
			SetTimerEx("ReduceTimer", 3000, false, "i", playerid);
			if(strcmp(x_nr,"1",true) == 0 || strcmp(x_nr,"1",true) == 0)
			{
				new gunname[24];
				new weapon = SkladisteInfo[0][skWeapon1];
				GetWeaponName(weapon,gunname, sizeof(gunname));
				if(IsPlayerInRangeOfPoint(playerid, 15, 2998.4851,-1938.7047,4.1313))
				{
					if(sscanf(params,"s[24]d",x_nr,ammo))
					{
						SCM(playerid, COLOR_GRAD1, "Koriscenje: /takeguns 1 [kolicina]");
						format(string, sizeof(string),"* You have a %s with %d Bullets at the Slot 1",gunname, SkladisteInfo[0][skAmmo1]);
						SCM(playerid, COLOR_GRAD1, string);
						return 1;
					}
					if(ammo < 0 || ammo > SkladisteInfo[0][skAmmo1])
					{
						SCM(playerid, COLOR_GREY, "   You don't have so many Ammo.");
						return 1;
					}
					if(SkladisteInfo[0][skWeapon1] != 0)
					{
						SafeGivePlayerWeapon(playerid, weapon, ammo);
						if(ammo == SkladisteInfo[0][skAmmo1]) SkladisteInfo[0][skWeapon1] = 0;
						SkladisteInfo[0][skAmmo1] -= ammo;
						if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his %s and places it at his backpack.", sendername,gunname); }
						else { format(string, sizeof(string), "* %s takes out her %s and places it at her backpack.", sendername,gunname); }
						ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
						new y1, m, d;
						new h,mi,s;
						getdate(y1,m,d);
						gettime(h,mi,s);
						format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /load weapon %d (%s)",d,m,y1,h,mi,s,sendername, ammo, gunname);
						CommandLog(string);
						OnPropUpdate(5, 0);
					}
					else
					{
						SCM(playerid, COLOR_GREY,"* There is nothing on this slot!");
						return 1;
					}
				}
				else
				{
					SCM(playerid, COLOR_GREY,"Niste u skladistu!");
					return 1;
				}
			}
			else if(strcmp(x_nr,"2",true) == 0 || strcmp(x_nr,"2",true) == 0)
			{
				new gunname[24];
				new weapon = SkladisteInfo[0][skWeapon2];
				GetWeaponName(weapon,gunname, sizeof(gunname));
				if(IsPlayerInRangeOfPoint(playerid, 15, 2998.4851,-1938.7047,4.1313))
				{
					if(sscanf(params,"s[24]d",x_nr,ammo))
					{
						SCM(playerid, COLOR_GRAD1, "Koriscenje: /takeguns 2 [kolicina]");
						format(string, sizeof(string),"* You have a %s with %d Bullets at the Slot 1",gunname, SkladisteInfo[0][skAmmo1]);
						SCM(playerid, COLOR_GRAD1, string);
						return 1;
					}
					if(ammo < 0 || ammo > SkladisteInfo[0][skAmmo2])
					{
						SCM(playerid, COLOR_GREY, "   You don't have so many Ammo.");
						return 1;
					}
					if(SkladisteInfo[0][skWeapon2] != 0)
					{
						SafeGivePlayerWeapon(playerid, weapon, ammo);
						if(ammo == SkladisteInfo[0][skAmmo2]) SkladisteInfo[0][skWeapon2] = 0;
						SkladisteInfo[0][skAmmo2] -= ammo;
						if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his %s and places it at his backpack.", sendername,gunname); }
						else { format(string, sizeof(string), "* %s takes out her %s and places it at her backpack.", sendername,gunname); }
						ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
						new y1, m, d;
						new h,mi,s;
						getdate(y1,m,d);
						gettime(h,mi,s);
						format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /load weapon %d (%s)",d,m,y1,h,mi,s,sendername, ammo, gunname);
						CommandLog(string);
						OnPropUpdate(5, 0);
					}
					else
					{
						SCM(playerid, COLOR_GREY,"* There is nothing on this slot!");
						return 1;
					}
				}
				else
				{
					SCM(playerid, COLOR_GREY,"Niste u skladistu!");
					return 1;
				}
			}
			else if(strcmp(x_nr,"3",true) == 0 || strcmp(x_nr,"3",true) == 0)
			{
				new gunname[24];
				new weapon = SkladisteInfo[0][skWeapon3];
				GetWeaponName(weapon,gunname, sizeof(gunname));
				if(IsPlayerInRangeOfPoint(playerid, 15, 2998.4851,-1938.7047,4.1313))
				{
					if(sscanf(params,"s[24]d",x_nr,ammo))
					{
						SCM(playerid, COLOR_GRAD1, "Koriscenje: /takeguns 3 [kolicina]");
						format(string, sizeof(string),"* You have a %s with %d Bullets at the Slot 1",gunname, SkladisteInfo[0][skAmmo1]);
						SCM(playerid, COLOR_GRAD1, string);
						return 1;
					}
					if(ammo < 0 || ammo > SkladisteInfo[0][skAmmo3])
					{
						SCM(playerid, COLOR_GREY, "   You don't have so many Ammo.");
						return 1;
					}
					if(SkladisteInfo[0][skWeapon3] != 0)
					{
						SafeGivePlayerWeapon(playerid, weapon, ammo);
						if(ammo == SkladisteInfo[0][skAmmo3]) SkladisteInfo[0][skWeapon3] = 0;
						SkladisteInfo[0][skAmmo3] -= ammo;
						if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his %s and places it at his backpack.", sendername,gunname); }
						else { format(string, sizeof(string), "* %s takes out her %s and places it at her backpack.", sendername,gunname); }
						ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
						new y1, m, d;
						new h,mi,s;
						getdate(y1,m,d);
						gettime(h,mi,s);
						format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /load weapon %d (%s)",d,m,y1,h,mi,s,sendername, ammo, gunname);
						CommandLog(string);
						OnPropUpdate(5, 0);
					}
					else
					{
						SCM(playerid, COLOR_GREY,"* There is nothing on this slot!");
						return 1;
					}
				}
				else
				{
					SCM(playerid, COLOR_GREY,"Niste u skladistu!");
					return 1;
				}
			}
			else if(strcmp(x_nr,"4",true) == 0 || strcmp(x_nr,"4",true) == 0)
			{
				new gunname[24];
				new weapon = SkladisteInfo[0][skWeapon4];
				GetWeaponName(weapon,gunname, sizeof(gunname));
				if(IsPlayerInRangeOfPoint(playerid, 15, 2998.4851,-1938.7047,4.1313))
				{
					if(sscanf(params,"s[24]d",x_nr,ammo))
					{
						SCM(playerid, COLOR_GRAD1, "Koriscenje: /takeguns 4 [kolicina]");
						format(string, sizeof(string),"* You have a %s with %d Bullets at the Slot 1",gunname, SkladisteInfo[0][skAmmo1]);
						SCM(playerid, COLOR_GRAD1, string);
						return 1;
					}
					if(ammo < 0 || ammo > SkladisteInfo[0][skAmmo4])
					{
						SCM(playerid, COLOR_GREY, "   You don't have so many Ammo.");
						return 1;
					}
					if(SkladisteInfo[0][skWeapon4] != 0)
					{
						SafeGivePlayerWeapon(playerid, weapon, ammo);
						if(ammo == SkladisteInfo[0][skAmmo4]) SkladisteInfo[0][skWeapon4] = 0;
						SkladisteInfo[0][skAmmo4] -= ammo;
						if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his %s and places it at his backpack.", sendername,gunname); }
						else { format(string, sizeof(string), "* %s takes out her %s and places it at her backpack.", sendername,gunname); }
						ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
						new y1, m, d;
						new h,mi,s;
						getdate(y1,m,d);
						gettime(h,mi,s);
						format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /load weapon %d (%s)",d,m,y1,h,mi,s,sendername, ammo, gunname);
						CommandLog(string);
						OnPropUpdate(5, 0);
					}
					else
					{
						SCM(playerid, COLOR_GREY,"* There is nothing on this slot!");
						return 1;
					}
				}
				else
				{
					SCM(playerid, COLOR_GREY,"Niste u skladistu!");
					return 1;
				}
			}
			else if(strcmp(x_nr,"5",true) == 0 || strcmp(x_nr,"5",true) == 0)
			{
				new gunname[24];
				new weapon = SkladisteInfo[0][skWeapon5];
				GetWeaponName(weapon,gunname, sizeof(gunname));
				if(IsPlayerInRangeOfPoint(playerid, 15, 2998.4851,-1938.7047,4.1313))
				{
					if(sscanf(params,"s[24]d",x_nr,ammo))
					{
						SCM(playerid, COLOR_GRAD1, "Koriscenje: /takeguns 5 [kolicina]");
						format(string, sizeof(string),"* You have a %s with %d Bullets at the Slot 1",gunname, SkladisteInfo[0][skAmmo1]);
						SCM(playerid, COLOR_GRAD1, string);
						return 1;
					}
					if(ammo < 0 || ammo > SkladisteInfo[0][skAmmo5])
					{
						SCM(playerid, COLOR_GREY, "   You don't have so many Ammo.");
						return 1;
					}
					if(SkladisteInfo[0][skWeapon5] != 0)
					{
						SafeGivePlayerWeapon(playerid, weapon, ammo);
						if(ammo == SkladisteInfo[0][skAmmo5]) SkladisteInfo[0][skWeapon5] = 0;
						SkladisteInfo[0][skAmmo5] -= ammo;
						if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his %s and places it at his backpack.", sendername,gunname); }
						else { format(string, sizeof(string), "* %s takes out her %s and places it at her backpack.", sendername,gunname); }
						ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
						new y1, m, d;
						new h,mi,s;
						getdate(y1,m,d);
						gettime(h,mi,s);
						format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /load weapon %d (%s)",d,m,y1,h,mi,s,sendername, ammo, gunname);
						CommandLog(string);
						OnPropUpdate(5, 0);
					}
					else
					{
						SCM(playerid, COLOR_GREY,"* There is nothing on this slot!");
						return 1;
					}
				}
				else
				{
					SCM(playerid, COLOR_GREY,"Niste u skladistu!");
					return 1;
				}
			}
		}
		else
		{
			SCM(playerid, COLOR_GREY, "Niste u ovlasteni!");
			return 1;
		}
	}
	return 1;
}

EVO /PUTGUNS
CMD:putguns(playerid, params[])
{
	if(IsPlayerConnected(playerid))
	{
		new x_nr[24];
		new string[128],sendername[MAX_PLAYER_NAME],ammo;
		GetPlayerName(playerid,sendername,sizeof(sendername));
		if(sscanf(params,"s[24]D",x_nr,ammo))
		{
			SCM(playerid, COLOR_WHITE, "Koriscenje: /putguns [slot 1-5] [kolicina]");
			return 1;
		}
		if(ReduceTime[playerid] == 1)
		{
			SCM(playerid, COLOR_GREY, "   Moras sacekati 3 sekunde da ponovo koristis ovu komandu !");
			return 1;
		}
		if(ServerRestartovan == 1) return 1;
		if(PlayerInfo[playerid][pAdminDuty] == 1)
		{
			SCM(playerid, COLOR_GRAD2, "** Prvo iskljucite duty!");
			return 1;
		}
		if(PlayerInfo[playerid][pGmDuty] == 1)
		{
			SCM(playerid, COLOR_GRAD2, "** Prvo iskljucite duty!");
			return 1;
		}
		if(PlayerInfo[playerid][pLeader] == 22 || PlayerInfo[playerid][pMember] == 22)
		{
			ReduceTime[playerid] = 1;
			SetTimerEx("ReduceTimer", 3000, false, "i", playerid);
			if(strcmp(x_nr,"1",true) == 0 || strcmp(x_nr,"1",true) == 0)
			{
				new gunname[24];
				if(IsPlayerInRangeOfPoint(playerid, 15, 2998.4851,-1938.7047,4.1313))
				{
					if(sscanf(params,"s[24]d",x_nr,ammo))
					{
						SCM(playerid, COLOR_GRAD1, "Koriscenje: /putguns 1 [kolicina]");
						return 1;
					}
					if(ammo < 0 || ammo > GetPlayerAmmo(playerid))
					{
						SCM(playerid, COLOR_GREY, "   You don't have so many Ammo.");
						return 1;
					}
					new weapon = GetPlayerWeapon(playerid);
					GetWeaponName(weapon,gunname, sizeof(gunname));
					if(weapon != 0)
					{
						if(SkladisteInfo[0][skWeapon1] == 0)
						{
							if(SkladisteInfo[0][skAmmo1] >= 10000) return SCM(playerid, COLOR_GREY,"* You cannot exceed the 25000 Limit.");
							SafeGivePlayerWeapon(playerid, weapon, -ammo);
							SkladisteInfo[0][skWeapon1] = weapon;
							SkladisteInfo[0][skAmmo1] = ammo;
							if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his %s and places it at his safe.", sendername,gunname); }
							else { format(string, sizeof(string), "* %s takes out her %s and places it at her safe.", sendername,gunname); }
							ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
						}
						else if(SkladisteInfo[0][skWeapon1] == weapon)
						{
							if(SkladisteInfo[0][skAmmo1] >= 10000) return SCM(playerid, COLOR_GREY,"* You cannot exceed the 25000 Limit.");
							SafeGivePlayerWeapon(playerid, weapon, -ammo);
							SkladisteInfo[0][skAmmo1] += ammo;
							if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his %s and places it at his safe.", sendername,gunname); }
							else { format(string, sizeof(string), "* %s takes out her %s and places it at her safe.", sendername,gunname); }
							ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
						}
						else
						{
							SCM(playerid, COLOR_GREY,"* This slot is taken by another weapon!");
							return 1;
						}
						new y1, m, d;
						new h,mi,s;
						getdate(y1,m,d);
						gettime(h,mi,s);
						format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /stavi weapon %d (%s)",d,m,y1,h,mi,s,sendername, ammo, gunname);
						CommandLog(string);
						OnPropUpdate(5, 0);
					}
					else
					{
						SCM(playerid, COLOR_GREY,"* This slot is taken by another weapon!");
						SCM(playerid, COLOR_GREY,"* Either deposit more ammo of the same weapon or load it up!");
						return 1;
					}
				}
				else
				{
					SCM(playerid, COLOR_GREY,"Niste u skladistu!");
					return 1;
				}
			}
			else if(strcmp(x_nr,"2",true) == 0 || strcmp(x_nr,"2",true) == 0)
			{
				new gunname[24];
				if(IsPlayerInRangeOfPoint(playerid, 15, 2998.4851,-1938.7047,4.1313))
				{
					if(sscanf(params,"s[24]d",x_nr,ammo))
					{
						SCM(playerid, COLOR_GRAD1, "Koriscenje: /putguns 2 [kolicina]");
						return 1;
					}
					if(ammo < 0 || ammo > GetPlayerAmmo(playerid))
					{
						SCM(playerid, COLOR_GREY, "   You don't have so many Ammo.");
						return 1;
					}
					new weapon = GetPlayerWeapon(playerid);
					GetWeaponName(weapon,gunname, sizeof(gunname));
					if(weapon != 0)
					{
						if(SkladisteInfo[0][skWeapon2] == 0)
						{
							if(SkladisteInfo[0][skAmmo2] >= 10000) return SCM(playerid, COLOR_GREY,"* You cannot exceed the 25000 Limit.");
							SafeGivePlayerWeapon(playerid, weapon, -ammo);
							SkladisteInfo[0][skWeapon2] = weapon;
							SkladisteInfo[0][skAmmo2] = ammo;
							if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his %s and places it at his safe.", sendername,gunname); }
							else { format(string, sizeof(string), "* %s takes out her %s and places it at her safe.", sendername,gunname); }
							ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
						}
						else if(SkladisteInfo[0][skWeapon2] == weapon)
						{
							if(SkladisteInfo[0][skAmmo2] >= 10000) return SCM(playerid, COLOR_GREY,"* You cannot exceed the 25000 Limit.");
							SafeGivePlayerWeapon(playerid, weapon, -ammo);
							SkladisteInfo[0][skAmmo2] += ammo;
							if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his %s and places it at his safe.", sendername,gunname); }
							else { format(string, sizeof(string), "* %s takes out her %s and places it at her safe.", sendername,gunname); }
							ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
						}
						else
						{
							SCM(playerid, COLOR_GREY,"* This slot is taken by another weapon!");
							return 1;
						}
						new y1, m, d;
						new h,mi,s;
						getdate(y1,m,d);
						gettime(h,mi,s);
						format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /stavi weapon %d (%s)",d,m,y1,h,mi,s,sendername, ammo, gunname);
						CommandLog(string);
						OnPropUpdate(5, 0);
					}
					else
					{
						SCM(playerid, COLOR_GREY,"* This slot is taken by another weapon!");
						SCM(playerid, COLOR_GREY,"* Either deposit more ammo of the same weapon or load it up!");
						return 1;
					}
				}
				else
				{
					SCM(playerid, COLOR_GREY,"Niste u skladistu!");
					return 1;
				}
			}
			else if(strcmp(x_nr,"3",true) == 0 || strcmp(x_nr,"3",true) == 0)
			{
				new gunname[24];
				if(IsPlayerInRangeOfPoint(playerid, 15, 2998.4851,-1938.7047,4.1313))
				{
					if(sscanf(params,"s[24]d",x_nr,ammo))
					{
						SCM(playerid, COLOR_GRAD1, "Koriscenje: /putguns 3 [kolicina]");
						return 1;
					}
					if(ammo < 0 || ammo > GetPlayerAmmo(playerid))
					{
						SCM(playerid, COLOR_GREY, "   You don't have so many Ammo.");
						return 1;
					}
					new weapon = GetPlayerWeapon(playerid);
					GetWeaponName(weapon,gunname, sizeof(gunname));
					if(weapon != 0)
					{
						if(SkladisteInfo[0][skWeapon3] == 0)
						{
							if(SkladisteInfo[0][skAmmo3] >= 10000) return SCM(playerid, COLOR_GREY,"* You cannot exceed the 25000 Limit.");
							SafeGivePlayerWeapon(playerid, weapon, -ammo);
							SkladisteInfo[0][skWeapon3] = weapon;
							SkladisteInfo[0][skAmmo3] = ammo;
							if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his %s and places it at his safe.", sendername,gunname); }
							else { format(string, sizeof(string), "* %s takes out her %s and places it at her safe.", sendername,gunname); }
							ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
						}
						else if(SkladisteInfo[0][skWeapon3] == weapon)
						{
							if(SkladisteInfo[0][skAmmo3] >= 10000) return SCM(playerid, COLOR_GREY,"* You cannot exceed the 25000 Limit.");
							SafeGivePlayerWeapon(playerid, weapon, -ammo);
							SkladisteInfo[0][skAmmo3] += ammo;
							if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his %s and places it at his safe.", sendername,gunname); }
							else { format(string, sizeof(string), "* %s takes out her %s and places it at her safe.", sendername,gunname); }
							ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
						}
						else
						{
							SCM(playerid, COLOR_GREY,"* This slot is taken by another weapon!");
							return 1;
						}
						new y1, m, d;
						new h,mi,s;
						getdate(y1,m,d);
						gettime(h,mi,s);
						format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /stavi weapon %d (%s)",d,m,y1,h,mi,s,sendername, ammo, gunname);
						CommandLog(string);
						OnPropUpdate(5, 0);
					}
					else
					{
						SCM(playerid, COLOR_GREY,"* This slot is taken by another weapon!");
						SCM(playerid, COLOR_GREY,"* Either deposit more ammo of the same weapon or load it up!");
						return 1;
					}
				}
				else
				{
					SCM(playerid, COLOR_GREY,"Niste u skladistu!");
					return 1;
				}
			}
			else if(strcmp(x_nr,"4",true) == 0 || strcmp(x_nr,"4",true) == 0)
			{
				new gunname[24];
				if(IsPlayerInRangeOfPoint(playerid, 15, 2998.4851,-1938.7047,4.1313))
				{
					if(sscanf(params,"s[24]d",x_nr,ammo))
					{
						SCM(playerid, COLOR_GRAD1, "Koriscenje: /putguns 4 [kolicina]");
						return 1;
					}
					if(ammo < 0 || ammo > GetPlayerAmmo(playerid))
					{
						SCM(playerid, COLOR_GREY, "   You don't have so many Ammo.");
						return 1;
					}
					new weapon = GetPlayerWeapon(playerid);
					GetWeaponName(weapon,gunname, sizeof(gunname));
					if(weapon != 0)
					{
						if(SkladisteInfo[0][skWeapon4] == 0)
						{
							if(SkladisteInfo[0][skAmmo4] >= 10000) return SCM(playerid, COLOR_GREY,"* You cannot exceed the 25000 Limit.");
							SafeGivePlayerWeapon(playerid, weapon, -ammo);
							SkladisteInfo[0][skWeapon4] = weapon;
							SkladisteInfo[0][skAmmo4] = ammo;
							if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his %s and places it at his safe.", sendername,gunname); }
							else { format(string, sizeof(string), "* %s takes out her %s and places it at her safe.", sendername,gunname); }
							ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
						}
						else if(SkladisteInfo[0][skWeapon4] == weapon)
						{
							if(SkladisteInfo[0][skAmmo4] >= 10000) return SCM(playerid, COLOR_GREY,"* You cannot exceed the 25000 Limit.");
							SafeGivePlayerWeapon(playerid, weapon, -ammo);
							SkladisteInfo[0][skAmmo4] += ammo;
							if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his %s and places it at his safe.", sendername,gunname); }
							else { format(string, sizeof(string), "* %s takes out her %s and places it at her safe.", sendername,gunname); }
							ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
						}
						else
						{
							SCM(playerid, COLOR_GREY,"* This slot is taken by another weapon!");
							return 1;
						}
						new y1, m, d;
						new h,mi,s;
						getdate(y1,m,d);
						gettime(h,mi,s);
						format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /stavi weapon %d (%s)",d,m,y1,h,mi,s,sendername, ammo, gunname);
						CommandLog(string);
						OnPropUpdate(5, 0);
					}
					else
					{
						SCM(playerid, COLOR_GREY,"* This slot is taken by another weapon!");
						SCM(playerid, COLOR_GREY,"* Either deposit more ammo of the same weapon or load it up!");
						return 1;
					}
				}
				else
				{
					SCM(playerid, COLOR_GREY,"*Niste u skladistu!");
					return 1;
				}
			}
			else if(strcmp(x_nr,"5",true) == 0 || strcmp(x_nr,"5",true) == 0)
			{
				new gunname[24];
				if(IsPlayerInRangeOfPoint(playerid, 15, 2998.4851,-1938.7047,4.1313))
				{
					if(sscanf(params,"s[24]d",x_nr,ammo))
					{
						SCM(playerid, COLOR_GRAD1, "Koriscenje: /putguns 5 [kolicina]");
						return 1;
					}
					if(ammo < 0 || ammo > GetPlayerAmmo(playerid))
					{
						SCM(playerid, COLOR_GREY, "   You don't have so many Ammo.");
						return 1;
					}
					new weapon = GetPlayerWeapon(playerid);
					GetWeaponName(weapon,gunname, sizeof(gunname));
					if(weapon != 0)
					{
						if(SkladisteInfo[0][skWeapon5] == 0)
						{
							if(SkladisteInfo[0][skAmmo5] >= 10000) return SCM(playerid, COLOR_GREY,"* You cannot exceed the 25000 Limit.");
							SafeGivePlayerWeapon(playerid, weapon, -ammo);
							SkladisteInfo[0][skWeapon5] = weapon;
							SkladisteInfo[0][skAmmo5] = ammo;
							if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his %s and places it at his safe.", sendername,gunname); }
							else { format(string, sizeof(string), "* %s takes out her %s and places it at her safe.", sendername,gunname); }
							ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
						}
						else if(SkladisteInfo[0][skWeapon5] == weapon)
						{
							if(SkladisteInfo[0][skAmmo5] >= 10000) return SCM(playerid, COLOR_GREY,"* You cannot exceed the 25000 Limit.");
							SafeGivePlayerWeapon(playerid, weapon, -ammo);
							SkladisteInfo[0][skAmmo5] += ammo;
							if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his %s and places it at his safe.", sendername,gunname); }
							else { format(string, sizeof(string), "* %s takes out her %s and places it at her safe.", sendername,gunname); }
							ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
						}
						else
						{
							SCM(playerid, COLOR_GREY,"* This slot is taken by another weapon!");
							return 1;
						}
						new y1, m, d;
						new h,mi,s;
						getdate(y1,m,d);
						gettime(h,mi,s);
						format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /stavi weapon %d (%s)",d,m,y1,h,mi,s,sendername, ammo, gunname);
						CommandLog(string);
						OnPropUpdate(5, 0);
					}
					else
					{
						SCM(playerid, COLOR_GREY,"* This slot is taken by another weapon!");
						SCM(playerid, COLOR_GREY,"* Either deposit more ammo of the same weapon or load it up!");
						return 1;
					}
				}
				else
				{
					SCM(playerid, COLOR_GREY,"Niste u skladistu!");
					return 1;
				}
			}
		}
		else
		{
			SCM(playerid, COLOR_GREY, "Niste ovlasteni!");
			return 1;
		}
	}
	return 1;
}

EVO /PUTMATS
CMD:putmats(playerid, params[])
{
	if(IsPlayerConnected(playerid))
	{
		new string[128],sendername[MAX_PLAYER_NAME],ammo;
		GetPlayerName(playerid,sendername,sizeof(sendername));
		if(sscanf(params,"d",ammo))
		{
			SCM(playerid, COLOR_WHITE, "Koriscenje: /putmats [kolicina]");
			return 1;
		}
		if(ReduceTime[playerid] == 1)
		{
			SCM(playerid, COLOR_GREY, "   Moras sacekati 3 sekunde da ponovo koristis ovu komandu !");
			return 1;
		}
		if(ServerRestartovan == 1) return 1;
		if(PlayerInfo[playerid][pLeader] == 22 || PlayerInfo[playerid][pMember] == 22)
		{
			ReduceTime[playerid] = 1;
			SetTimerEx("ReduceTimer", 3000, false, "i", playerid);
			if(IsPlayerInRangeOfPoint(playerid, 15, 2998.4851,-1938.7047,4.1313)
			{
				if(ammo < 0 || ammo> PlayerInfo[playerid][pMats]) return SCM(playerid, COLOR_GREY, "* You don't have so many Materials.");
				if(SkladisteInfo[0][skMaterials] >= 500000) return SCM(playerid, COLOR_GREY,"Najvise moze stati 500000 matsa.");
				PlayerInfo[playerid][pMats] -= ammo;
				SkladisteInfo[0][skMaterials] += ammo;
				if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s stavlja materijale u skladiste.", sendername); }
				else { format(string, sizeof(string), "* %s stavlja materijale u skladiste.", sendername); }
				ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
				new y1, m, d;
				new h,mi,s;
				getdate(y1,m,d);
				gettime(h,mi,s);
				format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /putmats %d",d,m,y1,h,mi,s,sendername, ammo);
				CommandLog(string);
				OnPropUpdate(5, 0);
			}
			else
			{
				SCM(playerid, COLOR_GREY,"Niste u skladistu!");
				return 1;
			}
		}
		else
		{
			SCM(playerid, COLOR_GREY, "Niste ovlasteni!");
			return 1;
		}
	}
	return 1;
}

I EVO /TAKEMATS
CMD:takemats(playerid, params[])
{
	if(IsPlayerConnected(playerid))
	{
		new string[128],sendername[MAX_PLAYER_NAME],ammo;
		GetPlayerName(playerid,sendername,sizeof(sendername));
		if(sscanf(params,"d",ammo))
		{
			SCM(playerid, COLOR_WHITE, "Koriscenje: /takemats [kolicina]");
			return 1;
		}
		if(ReduceTime[playerid] == 1)
		{
			SCM(playerid, COLOR_GREY, "   Moras sacekati 3 sekunde da ponovo koristis ovu komandu !");
			return 1;
		}
		if(ServerRestartovan == 1) return 1;
		if(PlayerInfo[playerid][pLeader] == 22 || PlayerInfo[playerid][pMember] == 22)
		{
			ReduceTime[playerid] = 1;
			SetTimerEx("ReduceTimer", 3000, false, "i", playerid);
			if(IsPlayerInRangeOfPoint(playerid, 15, 2998.4851,-1938.7047,4.1313)
			{
				if(ammo < 0 || ammo > SkladisteInfo[0][skMaterials]) { SCM(playerid, COLOR_GREY, "   You don't have so many drugs."); return 1; }
				PlayerInfo[playerid][pMats] += ammo;
				SkladisteInfo[0][skMaterials] -= ammo;
				if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s uzima materijale iz skladista.", sendername); }
				else { format(string, sizeof(string), "* %s uzima materijale iz skladista.", sendername); }
				ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
				new y1, m, d;
				new h,mi,s;
				getdate(y1,m,d);
				gettime(h,mi,s);
				format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /takemats %d",d,m,y1,h,mi,s,sendername, ammo);
				CommandLog(string);
				OnPropUpdate(5, 0);
			}
			else
			{
				SCM(playerid, COLOR_GREY,"Niste u skladistu!");
				return 1;
			}
		}
		else
		{
			SCM(playerid, COLOR_GREY, "Niste ovlasteni!");
			return 1;
		}
	}
	return 1;
}

I SADA DA PISE AKO IGRAC NIJE NISTA PRILOZIO DA PISE NISTE PRILOZILI DOVOLJNO MATERIJALA SKLADISTU ZA TO ORUZJE ILI TAKO NESTO
Neke slike/video za lakse dobivanje pomoci(neobavezno): ////
HVALA UNAPRED

Blaeks

*

Madmen

ovako, uradis varijablu jednu i onda stavis ovako
if(Prilozio[playerid] == 0) return SendClientMessage(playerid, -1, " nisi dao nista ",);
a stavis u komandu gde se prilaze to ovo
Prilozio[playerid] == 1;
to je da mu stavi da je prilozio, nadam se da razumes

joj druze nebi ti ja to znao uradit mozes mi ti to sredis eto dao sam gore komande te i vidi ajd molim te hitno mi je

Blaeks

*

Madmen

Citat: Danisha poslato Decembar 12, 2012, 17:42:40 POSLE PODNE
joj druze nebi ti ja to znao uradit mozes mi ti to sredis eto dao sam gore komande te i vidi ajd molim te hitno mi je
ovo na vrh new Prilozio[MAX_PLAYERS]; ovo u komandu gde se stavljajju gunovi
Prilozio[playerid] == 1;
ovo gde se uzimaju gunovi
if(Prilozio[playerid] == 0) return SendClientMessage(playerid, -1, " nisi dao nista ",);
Prilozio[playerid] == 0;

A kako da sredim ako stavi 200matsa da moze uzet 100metaka bilo kojeg guna i ako stavi 100metaka guna da moze uzet 200matsa

Blaeks

*

Madmen

if(PlayerInfo[playerid][pVARIJABLA ZA MATS] == 200)
					{
						PlayerInfo[playerid][pVARIJABLA ZA MATS] == 100;
					}

pMats je varijabla
ali rodjeno neznam ja to uradit ajd mi ti uradi molim te

Blaeks

*

Madmen

dodas ovo u komandu za uzimanje matsa
if(Prilozeno[playerid] == 200)
					{
						PlayerInfo[playerid][pMats] == 100;
					}
nema sta da se razume tu, jednostavno je