Very easy but i don't know :S
#1

how to make something that say if you repeat yourself:
"Don't Repeat yourself!"
Reply
#2

Huh?
Reply
#3

do u mean, when they write "ETCLOLBOLLOX" and try to write it again, it sais "Don't repeat yourself!"?
Reply
#4

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
Reply
#5

Thanks but what's the different static, new ?
Reply
#6

look that up in pawn-lang.pdf
Reply
#7

No please tell me i'm on my psp so i can't read the pdf
Reply
#8

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
Reply
#9

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 !!
Reply
#10

Use strcmp instead
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)