help with onplayertext
#1

Hello guys.
i am using this reaction test fs of ryder :http://pastebin.com/5f0pjpWB

i want to know is there any way to hide the reaction in chat which is typed by the player.
if he types reaction test first and that reaction should be hidden in chat

thanks in advance
Reply
#2

remove this :
PHP код:
                format(stringsizeof(string), "« \%s\" has won the reaction test. »"pName);
                
SendClientMessageToAll(GREENstring); 
you mean that ? if nah explain
Reply
#3

if the person won the reaction .

the reaction letters(xchars) typed by player ex: idfdfdjd&6gfg
should be hidden from the chat...
Reply
#4

He meants if a player is writing the reaction text it must not show to other players.

return 0 on onplayertext ?

EDIT:
pawn Код:
if(!strcmp(xChars, text, false))
                        {
                            new
                                string[128],
                                pName[MAX_PLAYER_NAME]
                                ;
                                GetPlayerName(playerid, pName, sizeof(pName));
                                format(string, sizeof(string), \%s\" has won the reaction test. »", pName);
                            SendClientMessageToAll(GREEN, string);
                            format(string, sizeof(string), "« You have earned $%d + %d score points. »", xCash, xScore);
                            SendClientMessage(playerid, GREEN, string);
                            GivePlayerMoney(playerid, xCash);
                                SetPlayerScore(playerid, GetPlayerScore(playerid) + xScore);
                                xReactionTimer = SetTimer("xReactionTest", TIME, 1);
                            xTestBusy = false;
                            return 0; //Returning Text!
                        }
Reply
#5

There are several ways of doing that... one way might be to create a command /rt instead of just writing down the reaction test characters. That will make it easier.
Reply
#6

Quote:
Originally Posted by superrobot48
Посмотреть сообщение
He meants if a player is writing the reaction text it must not show to other players.

return 0 on onplayertext ?

EDIT:
pawn Код:
if(!strcmp(xChars, text, false))
                        {
                            new
                                string[128],
                                pName[MAX_PLAYER_NAME]
                                ;
                                GetPlayerName(playerid, pName, sizeof(pName));
                                format(string, sizeof(string), \%s\" has won the reaction test. »", pName);
                            SendClientMessageToAll(GREEN, string);
                            format(string, sizeof(string), "« You have earned $%d + %d score points. »", xCash, xScore);
                            SendClientMessage(playerid, GREEN, string);
                            GivePlayerMoney(playerid, xCash);
                                SetPlayerScore(playerid, GetPlayerScore(playerid) + xScore);
                                xReactionTimer = SetTimer("xReactionTest", TIME, 1);
                            xTestBusy = false;
                            return 0; //Returning Text!
                        }
only winners rtest letters should be hidden not all players
Reply
#7

-_- bro read the code i gave you please?
it just hides the winners TEXT!
lol
pawn Код:
public OnPlayerText(playerid, text[])
{
    switch(xTestBusy)
    {
        case true:
        {
            if(!strcmp(xChars, text, false))
            {
                new
                    string[128],
                    pName[MAX_PLAYER_NAME]
                ;
                GetPlayerName(playerid, pName, sizeof(pName));
                format(string, sizeof(string), \%s\" has won the reaction test. »", pName);
                SendClientMessageToAll(GREEN, string);
                format(string, sizeof(string), "« You have earned $%d + %d score points. »", xCash, xScore);
                SendClientMessage(playerid, GREEN, string);
                GivePlayerMoney(playerid, xCash);
                SetPlayerScore(playerid, GetPlayerScore(playerid) + xScore);
                xReactionTimer = SetTimer("xReactionTest", TIME, 1);
                xTestBusy = false;
                           
                            return 0; //returning ....
            }
        }
    }
    return 1;
}
replace that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)