Very easy but i don't know :S - 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: Very easy but i don't know :S (
/showthread.php?tid=66617)
Very easy but i don't know :S -
harrold - 23.02.2009
how to make something that say if you repeat yourself:
"Don't Repeat yourself!"
Re: Very easy but i don't know :S -
MenaceX^ - 23.02.2009
Huh?
Re: Very easy but i don't know :S -
My_Waffles_Bitch_L0L - 23.02.2009
do u mean, when they write "ETCLOLBOLLOX" and try to write it again, it sais "Don't repeat yourself!"?
Re: Very easy but i don't know :S -
Nero_3D - 23.02.2009
pawn Code:
//OnPlayerText
static stext[MAX_PLAYERS][128];
if(!strfind(text, stext[playerid], true))
return SendClientMessage(playerid, 0xFFFFFFAA, "Don't Repeat yourself!"), false;
format(stext[playerid], sizeof stext[], text);
if you type
hello
hello -> "Don't Repeat yourself!" and dont sends the hello in public
or
hello
hellottt -> "Don't Repeat yourself!" and dont sends the hellottt in public
Re: Very easy but i don't know :S -
harrold - 23.02.2009
Thanks but what's the different static, new ?
Re: Very easy but i don't know :S -
Nero_3D - 23.02.2009
look that up in pawn-lang.pdf
Re: Very easy but i don't know :S -
harrold - 23.02.2009
No please tell me i'm on my psp so i can't read the pdf
Re: Very easy but i don't know :S -
Nero_3D - 23.02.2009
ah ok
Quote:
Originally Posted by pawn-lang.pdf
State variable declarations
A state variable is a global variable with a state classier appended at the end. The scope and the lifespan of the variable are restricted to the states that are listed in the classier.
|
or
a static variable is just a variable that holds the saved value after the end
Re: Very easy but i don't know :S -
harrold - 27.02.2009
Quote:
Originally Posted by ♣ ⓐⓢⓢ
pawn Code:
//OnPlayerText static stext[MAX_PLAYERS][128]; if(!strfind(text, stext[playerid], true)) return SendClientMessage(playerid, 0xFFFFFFAA, "Don't Repeat yourself!"), false; format(stext[playerid], sizeof stext[], text);
if you type
hello
hello -> "Don't Repeat yourself!" and dont sends the hello in public
or
hello
hellottt -> "Don't Repeat yourself!" and dont sends the hellottt in public
|
But now i can Get if i type hello
And i say Does anybody know what Hello means
Then it block!
Or if i press s
Then it block if i say i don't like roadblocks on the bridges!
Then it block !!
Re: Very easy but i don't know :S -
beckzy - 27.02.2009
Use strcmp instead