OnPlayerText Help - 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: OnPlayerText Help (
/showthread.php?tid=247545)
OnPlayerText Help -
Carrot - 09.04.2011
Like, if the reaction test text is iLiKecArrots and i type that, it doesn't say that %s has won the reaction test...
pawn Код:
public OnPlayerText(playerid, text[])
{
new string[256];
if(ReactionState == R_STATE_ACTIVE)
{
if(!strcmp(text, ReactionString, false))
{
ReactionState = R_STATE_NOT_ACTIVE;
new sPlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid,sPlayerName,MAX_PLAYER_NAME);
format(string,sizeof(string),"{FF2800}[REACTION TEST] {00A5DB}"lgrey"%s("lgreen"%d"lgrey") "lyellow"won $%d and 2 scores for phrasing "lred"%s "lyellow"before all!**",sPlayerName,playerid,ReactionCash,ReactionString);
SendClientMessageToAll(0x00F300FF,string);
GivePlayerMoney(playerid,ReactionCash);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 2 );
ReactionCash = 0;
}
}
format(string,sizeof(string),"%s("lorange"ID:"lred"%d"lgreen"){FFFFFF}: %s",GetPName(playerid),playerid,text);
SendClientMessageToAll(GetPlayerColor(playerid),string);
return 0;
}
Re: OnPlayerText Help -
Mean - 09.04.2011
Are you creating ReactionString as an array?
Re: OnPlayerText Help -
Carrot - 09.04.2011
Quote:
Originally Posted by Mean
Are you creating ReactionString as an array?
|
Srsly, can't you really figure it out? Yes, i am. -.-
Re: OnPlayerText Help -
linuxthefish - 09.04.2011
This may work better than using strings...
Re: OnPlayerText Help -
Mean - 10.04.2011
Quote:
Originally Posted by Carrot
Srsly, can't you really figure it out? Yes, i am. -.-
|
No because you HAVEN'T posted how you create it!
Re: OnPlayerText Help -
Carrot - 11.04.2011
Bump. Did what you said, and still it doesn't work...
Re: OnPlayerText Help -
Alby Fire - 11.04.2011
Try
pawn Код:
if(strfind(text, ReactionString, false) != -1)
Instead of
pawn Код:
if(!strcmp(text, ReactionString, false))