SA-MP Forums Archive
1 word then reclam, must be without.? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: 1 word then reclam, must be without.? (/showthread.php?tid=155422)



1 word then reclam, must be without.? - Mechscape - 18.06.2010

Код:
if(Mobile[playerid] == 1180)
		{
		  if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GREEN, "[KХNE] ABC Stuudio: Mis sa reklaamida tahaksid?");
				return 0;
			}
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(text);
			while ((idx < length) && (text[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[64];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = text[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
			{
				format(string, sizeof(string), "Please try again later %d seconds between Advertisements!", (addtimer/1000));
				SendClientMessage(playerid, COLOR_GRAD2, string);
				return 1;

			}
			new payout = idx * 10;
			if(GetPlayerMoney(playerid) < payout + 200)
	    {
	      format(string, sizeof(string), "* You used %d characters which cost $%d, you don't have enough.", offset, payout);
	      SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
	      Mobile[playerid] = 255;
	      return 1;
	    }
	    SafeGivePlayerMoney(playerid, - payout);
	    SafeGivePlayerMoney(playerid, - 200);
			FirmaInfo[4][sbTill] += payout + 200;
			ExtortionSBiz(4, payout + 200);
			format(string, sizeof(string), "[REKLAAM] %s. Number: %d.", result, PlayerInfo[playerid][pPnumber]);
			OOCNews(TEAM_GROVE_COLOR,string);
			format(string, sizeof(string), "~r~Paid $%d~n~~w~Message contained: %d Characters~n~~w~Plus ~g~200$~w~ for ad through phone", payout, idx);
			GameTextForPlayer(playerid, string, 5000, 1);
			if (PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
			Mobile[playerid] = 255;
		}
I type /call 1180
and i write

Selling car for 250000 cash!

then entering, showing:

[RECLAM] car for 250000 cash!

When i do:

asd Selling car for 250000 cash!

then shows

[RECLAM] Selling car for 250000 cash!

how do make it without that asd or anything? Must be:

Selling car for 250000 cash!

then shows:

[RECLAM] Selling car for 250000 cash!

not

[RECLAM] car for 250000 cash!


Re: 1 word then reclam, must be without.? - Mechscape - 18.06.2010

Help please.


Re: 1 word then reclam, must be without.? - Mechscape - 18.06.2010

Please help. Topic was in 3 pages.


Re: 1 word then reclam, must be without.? - DJDhan - 18.06.2010

I am sorry but I don't seem to understand what you mean. Your english pwns me


Re: 1 word then reclam, must be without.? - Mechscape - 19.06.2010

Quote:
Originally Posted by DJDhan
I am sorry but I don't seem to understand what you mean. Your english pwns me
Sorry, my english is bad :S

You type into box:
/call 1180

Then write box:
Selling car for 250000!

And In-Game shows:
[RECLAM] car for 250000!

if you write into box:
asd Selling car for 250000!

Then shows ingame:
[RECLAM] Selling car for 250000!

Like he needs 1 word to show full, how do edit, it dont needed or delete it?


Re: 1 word then reclam, must be without.? - Mechscape - 20.06.2010

Please help.


Re: 1 word then reclam, must be without.? - DJDhan - 20.06.2010

Quote:

if you write into box:
asd Selling car for 250000!

Then shows ingame:
[RECLAM] Selling car for 250000!

So you mean, if he makes some mistake in spelling the ad correct, the ad shouldn't display?


Re: 1 word then reclam, must be without.? - KuHS - 20.06.2010

Why don't you use like that? There's a lot of code, i really don't understand it, you might get it easier, by using functions. I think it's a check code from result to the showing lines. Use easier methods... or you're experienced.

format(string, sizeof(string), "[REKLAAM] %s. Number: %d.", text, PlayerInfo[playerid][pPnumber]);


Re: 1 word then reclam, must be without.? - Mechscape - 24.06.2010

Quote:
Originally Posted by KuHS
Why don't you use like that? There's a lot of code, i really don't understand it, you might get it easier, by using functions. I think it's a check code from result to the showing lines. Use easier methods... or you're experienced.

format(string, sizeof(string), "[REKLAAM] %s. Number: %d.", text, PlayerInfo[playerid][pPnumber]);
Thanks! Worked now.