[Pomoc]droga,materijali


Započeo (BSL)MasteR, Decembar 23, 2011, 20:52:11 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim:FactionGame Edit
Detaljan opis problema:Kako da napravim da nemzoe da uzimaju drogu i materijale u minus to jest da nemoze da uzimaju pare tako kucaju naprimer /buymats -1000 i toliko para dobiju
Dio skripte:
Neke slike/video za lakse dobivanje pomoci(neobavezno):
Balkan Online Public CS 1.6
IP:188.40.52.207:27027
Forum: www.cs-balkanonline.site40.net
Posjetite nas......

Postavi nam vamo tu komandu.
Ne bi' sada da padam kada sam stigao dovde...
Sta god da se desi , zauvek ostacu ovde
Ostacu ovde...Zauvek ostacu ovde...
Ne zelim nigde da odem ... Jer najlakse je uspeti al najteze je ostati covek !!!

evo za materijale:
if(strcmp(cmd,"/buymats",true)==0) // By Ellis
	 {
	    if(IsPlayerConnected(playerid))
	    {
	        if(gPlayerLogged[playerid] == 0)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   Morate se prvo prijaviti !");
	            return 1;
	        }
	        if(PlayerInfo[playerid][pJob] != 9)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   Niste diler oruzija. ");
			    return 1;
	        }
	        if(!PlayerToPoint(2.0, playerid, 2230.3579,-2286.2107,14.3751))
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   Niste kod Banke Materijala !");
	            return 1;
	        }
	        tmp = strtok(cmdtext, idx);
	        if(!strlen(tmp))
	        {
	            SendClientMessage(playerid, COLOR_WHITE, "Koriscenje: /buymats [ammount]");
	            return 1;
	        }
	        new mammount;
	        mammount = strval(tmp);
	        if(mammount > matssys[MatsAmmount])
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   Nemaju dovoljno materijala ! ");
	            return 1;
	        }
			if(GetPlayerMoney(playerid) < mammount * 5 - 1)
			{
			    SendClientMessage(playerid, COLOR_GREY, "   Nemate dovoljno novca ! ");
			    return 1;
			}
			matssys[MatsAmmount] -= mammount;
			PlayerInfo[playerid][pMats] += mammount;
			SafeGivePlayerMoney(playerid, - mammount * 5);
			format(string, sizeof(string), "   Kupili ste %d materijala za %d$ !", mammount, mammount * 5);
			SendClientMessage(playerid, COLOR_GREY, string);
			SaveMatsSystem();
			return 1;
	    }
	    return 1;
	 }

komanda za drogu:
if(strcmp(cmd,"/get",true)==0)
    {
        if(IsPlayerConnected(playerid))
	    {
			new x_job[256];
			x_job = strtok(cmdtext, idx);

			if(!strlen(x_job)) {
				SendClientMessage(playerid, COLOR_WHITE, "|__________________ Get __________________|");
				SendClientMessage(playerid, COLOR_WHITE, "Koriscenje: /get [ime]");
		  		SendClientMessage(playerid, COLOR_GREY, "Dostupna imena: Fuel Drugs");
				SendClientMessage(playerid, COLOR_GREEN, "|_________________________________________|");
				return 1;
			}

		    if(strcmp(x_job,"drugs",true) == 0)
			{
		        if(PlayerInfo[playerid][pDrugs] > 15)
		        {
		            format(string, sizeof(string), "  Jos uvjek imate %d grama sa sobom, prodajte ih prvo !", PlayerInfo[playerid][pDrugs]);
					SendClientMessage(playerid, COLOR_GREY, string);
		            return 1;
		        }
		        new tel;
			    new price;
			    new ammount;
			    tmp = strtok(cmdtext, idx);
				if(!strlen(tmp))
				{
					SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /get drugs [kolicina]");
					return 1;
				}
				new level = PlayerInfo[playerid][pDrugsSkill];
				ammount = strval(tmp);
				if(level >= 0 && level <= 50)
				{ tel = 200; if(ammount < 1 || ammount > 6) { SendClientMessage(playerid, COLOR_GREY, "   Ne mozete ici ispod 1 ili preko 6 sa trenutnim skillom!"); return 1; } }
				else if(level >= 51 && level <= 100)
				{ tel = 150; if(ammount < 1 || ammount > 12) { SendClientMessage(playerid, COLOR_GREY, "   Ne mozete ici ispod 1 ili preko 12 sa trenutnim skillom!"); return 1; } }
				else if(level >= 101 && level <= 200)
				{ tel = 100; if(ammount < 1 || ammount > 20) { SendClientMessage(playerid, COLOR_GREY, "   Ne mozete ici ispod 1 ili preko 20 sa trenutnim skillom!"); return 1; } }
				else if(level >= 201 && level <= 400)
				{ tel = 50; if(ammount < 1 || ammount > 30) { SendClientMessage(playerid, COLOR_GREY, "   Ne mozete ici ispod 1 ili preko 30 sa trenutnim skillom!"); return 1; } }
				else if(level >= 401)
				{ tel = 10; if(ammount < 1 || ammount > 99) { SendClientMessage(playerid, COLOR_GREY, "   Ne mozete ici ispod 1 ili preko 99 sa trenutnim skillom!"); return 1; } }
			    if (PlayerInfo[playerid][pJob] == 4 && PlayerToPoint(2.0, playerid, 1488.6949,-1721.7136,8.2067))
				{
				    price = ammount * tel;
				    if(GetPlayerMoney(playerid) > price)
				    {
				        format(string, sizeof(string), "* Kupili ste %d grama za $%d.", ammount, price);
						SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
				        SafeGivePlayerMoney(playerid, -price);
						PlayerInfo[playerid][pDrugs] = ammount;
				    }
				    else
				    {
				        SendClientMessage(playerid, COLOR_GREY, "   Ne mozete priustiti drogu !");
				        return 1;
				    }
				}
				else
				{
				    SendClientMessage(playerid, COLOR_GREY, "   Niste diler droge ili niste na Crnom Trzistu !");
				    return 1;
				}
			}
			if(strcmp(x_job,"fuel",true) == 0)
			{
			    if(IsAtGasStation(playerid))
				{
				    new price = 20 * SBizzInfo[3][sbEntranceCost];
				    format(string, sizeof(string), "* Napunili ste kanister sa 20% goriva za $%d",price);
				    SendClientMessage(playerid, COLOR_WHITE, string);
				    PlayerInfo[playerid][pFuel] = 20;
					SafeGivePlayerMoney(playerid, - price);
					return 1;
				}
				else
				{
					SendClientMessage(playerid,COLOR_GREY,"   Niste na Pumpi!");
					return 1;
				}
			}
			else { return 1; }
		}//not connected
		return 1;
	}
Balkan Online Public CS 1.6
IP:188.40.52.207:27027
Forum: www.cs-balkanonline.site40.net
Posjetite nas......