[Pomoc]/oglas /ad


Započeo ...Nikola..., Jun 24, 2011, 11:05:10 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: FactionGame
Detaljan opis problema: Da li neko moze da mi namesti da kad dam oglas da je cena uvek primer 50$ a ne koliko slova
Dio skripte:
if(strcmp(cmd, "/oglas", true) == 0 || strcmp(cmd, "/ad", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(gPlayerLogged[playerid] == 0)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   Niste se prijavili !");
	            return 1;
	        }
	        if(PlayerInfo[playerid][pLevel] < 2)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   Morate biti lvl 2 da Koristite ovu funkciju !");
	            return 1;
	        }
	        if(!PlayerToPoint(3.0,playerid,1737.5134,-1270.8007,13.5446))
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   Niste u RSC studiju !");
	            return 1;
	        }
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[64];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Koristi: /ad [tekst]");
				return 1;
			}
			if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
			{
				format(string, sizeof(string), "   Molimo pokusajte kasnije jer izmenju golasa treba da prodje: %d sekundi!",  (addtimer/1000));
				SendClientMessage(playerid, COLOR_GRAD2, string);
				return 1;

			}
			//new payout = idx * 5;
			//if(GetPlayerMoney(playerid) < payout)
	        //{
	          //  format(string, sizeof(string), "* Vi ste isKoristili %d slova sto kosta $%d, nemate dovoljno novca.", offset, payout);
	          //  SendClientMessage(playerid, COLOR_WHITE, string);
	          //  return 1;
	        //}
			//SafeGivePlayerMoney(playerid, - payout);
			//SBizzInfo[7][sbTill] += payout;
//			ExtortionSBiz(7);
			format(string, sizeof(string), "[OGLAS] %s, Br: %d, Ime: %s",  result, PlayerInfo[playerid][pPnumber], sendername);
			OOCNews(TEAM_GROVE_COLOR,string);
			//format(string, sizeof(string), "~r~Racun $%d~n~~w~Poruka je sadrzala: %d Slova", payout, idx);
			//GameTextForPlayer(playerid, string, 5000, 1);
			if (PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
		}
		return 1;
	}

Neke slike/video za lakse dobivanje pomoci(neobavezno): /

dragan12

Radice ovako evo probaj:
if(strcmp(cmd, "/oglas", true) == 0 || strcmp(cmd, "/ad", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(gPlayerLogged[playerid] == 0)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   Niste se prijavili !");
	            return 1;
	        }
	        if(PlayerInfo[playerid][pLevel] < 2)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   Morate biti lvl 2 da Koristite ovu funkciju !");
	            return 1;
	        }
	        if(!PlayerToPoint(3.0,playerid,1737.5134,-1270.8007,13.5446))
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   Niste u RSC studiju !");
	            return 1;
	        }
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[64];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Koristi: /ad [tekst]");
				return 1;
			}
			if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
			{
				format(string, sizeof(string), "   Molimo pokusajte kasnije jer izmenju golasa treba da prodje: %d sekundi!",  (addtimer/1000));
				SendClientMessage(playerid, COLOR_GRAD2, string);
				return 1;

			}
			new payout = idx * 5;
			if(GetPlayerMoney(playerid) < 50)
	        {
				format(string, sizeof(string), "* Vi ste isKoristili %d slova sto kosta $%d, nemate dovoljno novca.", offset, payout);
	            SendClientMessage(playerid, COLOR_WHITE, string);
	            return 1;
	        }
			SafeGivePlayerMoney(playerid, -50);
			SBizzInfo[7][sbTill] += 50;
			ExtortionSBiz(7);
			format(string, sizeof(string), "[OGLAS] %s, Br: %d, Ime: %s",  result, PlayerInfo[playerid][pPnumber], sendername);
			OOCNews(TEAM_GROVE_COLOR,string);
			format(string, sizeof(string), "~r~Racun $50~n~~w~Poruka je sadrzala: %d Slova", idx);
			GameTextForPlayer(playerid, string, 5000, 1);
			if (PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
		}
		return 1;
	}


dragan12

Dao sam ti to samo treba da uredis ;)
Vidi
if(strcmp(cmd, "/oglas", true) == 0 || strcmp(cmd, "/ad", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(gPlayerLogged[playerid] == 0)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   Niste se prijavili !");
	            return 1;
	        }
	        if(PlayerInfo[playerid][pLevel] < 2)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   Morate biti lvl 2 da Koristite ovu funkciju !");
	            return 1;
	        }
	        if(!PlayerToPoint(3.0,playerid,1737.5134,-1270.8007,13.5446))
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   Niste u RSC studiju !");
	            return 1;
	        }
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[64];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Koristi: /ad [tekst]");
				return 1;
			}
			if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
			{
				format(string, sizeof(string), "   Molimo pokusajte kasnije jer izmenju golasa treba da prodje: %d sekundi!",  (addtimer/1000));
				SendClientMessage(playerid, COLOR_GRAD2, string);
				return 1;

			}
			new payout = idx * 5;
			if(GetPlayerMoney(playerid) < 50)//Proverava koliko ima para
	        {
				format(string, sizeof(string), "Nemate dovoljno novca za oglas ");
	            SendClientMessage(playerid, COLOR_WHITE, string);
	            return 1;
	        }
			SafeGivePlayerMoney(playerid, -50);//ODuzima mu pare
			SBizzInfo[7][sbTill] += 50;//Daje u bizz $50
			ExtortionSBiz(7);
			format(string, sizeof(string), "[OGLAS] %s, Br: %d, Ime: %s",  result, PlayerInfo[playerid][pPnumber], sendername);
			OOCNews(TEAM_GROVE_COLOR,string);
			format(string, sizeof(string), "~r~Racun $50~n~~w~");
			GameTextForPlayer(playerid, string, 5000, 1);
			if (PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
		}
		return 1;
	}


vlado_plavsic

Omg,Pa ispravio ti je ono sto ti ne valja,copy njegovo i zameni sa tvojim!


dragan12

Citat: Boki Pro poslato Jun 26, 2011, 12:13:51 POSLE PODNE
Ma sve valja ja sam to stavio pod // ,NE Razumete VI To.

DA Li moze neko ko razume da mi pomogne ako ne mozete LOCK
Aj ponovo objasni sta ti neradi. Stavio sam ti da ti oduzima $50 (bez slova) i da daje u biz $50 i sklonio da neplacas slova. I sta tu nevalja sta si ti jos hteo da dodas? To si napisao u prvom postu samo to da se uradi. Jel si ti uopste testirao ovo pa da vidis da li radi?


Citat: Boki Pro poslato Jun 26, 2011, 15:21:00 POSLE PODNE
ma ja ocu samo da uzima 50$ da nema biza ni nista samo da skida pare i bez slova ono da napljacuje.

pa to ti je i uradjeno :S :S :S :S te pare idu u biz ko posjeduje firmu za oglasavanje..sto je vise RP... sta jos hoces :S ?
//

dragan12

Citat: Boki Pro poslato Jun 26, 2011, 15:21:00 POSLE PODNE
ma ja ocu samo da uzima 50$ da nema biza ni nista samo da skida pare i bez slova ono da napljacuje.
Stavio sam da ti skida 50$ i da nenapljacuje slova
Ako hoces da sklonis da pare neidu u biz obrisi ovu liniju i pare nece ici u biz.
SBizzInfo[7][sbTill] += 50;