OnPlayerText usage?
#10

Quote:
Originally Posted by Ben7544
Посмотреть сообщение
Well, I haven't noticed what you've done, but I done this :


Код:
new fuck[1][] =
{
	"fuck"
			};
Код:
for(new f; f < sizeof(fuck); f++){
	new string[256];
		if(strfind(text, fuck[f], true) != -1)
		{
		    new name[MAX_PLAYER_NAME]; new string[128];
			GetPlayerName(playerid, name, sizeof(name));
			format(string,sizeof(string), "%s: I'm gay", name);
			SendClientMessageToAll(GetPlayerColor(playerid), string);
			}
		}
And I got those three errors :

PHP код:
C:\Documents and Settings\gidon\щемзп дтбегд\ъйчйд згщд\pawno\new.pwn(97) : warning 217loose indentation
C
:\Documents and Settings\gidon\щемзп дтбегд\ъйчйд згщд\pawno\new.pwn(99) : warning 219local variable "string" shadows a variable at a preceding level
C
:\Documents and Settings\gidon\щемзп дтбегд\ъйчйд згщд\pawno\new.pwn(96) : warning 204symbol is assigned a value that is never used"string" 
Those errors roughly translate to: Stop being homophobic.

He wants it so when someone says 'fuck you' it'll turn into '**** you' - not remove the whole message.

strfind returns the position of the first character in the string that is found, it's basically the number of letters before the word you're searching for. So you can strfind 'fuck' then strdel the characters strfind to strfind+4 - that'll remove fuck. Then strins at the strfind position four *'s. Simples.
Reply


Messages In This Thread
OnPlayerText usage? - by Ben7544 - 13.04.2011, 16:07
Re: OnPlayerText usage? - by MP2 - 13.04.2011, 16:10
Re: OnPlayerText usage? - by Ben7544 - 13.04.2011, 16:12
Re: OnPlayerText usage? - by MP2 - 13.04.2011, 16:14
Re: OnPlayerText usage? - by Skylar Paul - 13.04.2011, 16:15
Re: OnPlayerText usage? - by MP2 - 13.04.2011, 16:16
Re: OnPlayerText usage? - by Skylar Paul - 13.04.2011, 16:19
Re: OnPlayerText usage? - by Ben7544 - 13.04.2011, 16:37
Re: OnPlayerText usage? - by WillyP - 13.04.2011, 16:49
Re: OnPlayerText usage? - by MP2 - 14.04.2011, 11:51

Forum Jump:


Users browsing this thread: 2 Guest(s)