OnPlayerText Help
#1

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;
}
Reply
#2

Are you creating ReactionString as an array?
Reply
#3

Quote:
Originally Posted by Mean
Посмотреть сообщение
Are you creating ReactionString as an array?
Srsly, can't you really figure it out? Yes, i am. -.-
Reply
#4

This may work better than using strings...

pawn Код:
if reactiontest = 1;
Reply
#5

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

Bump. Did what you said, and still it doesn't work...
Reply
#7

Try
pawn Код:
if(strfind(text, ReactionString, false) != -1)
Instead of
pawn Код:
if(!strcmp(text, ReactionString, false))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)