SA-MP Forums Archive
Ahhh, OnPlayerText.. - 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)
+--- Thread: Ahhh, OnPlayerText.. (/showthread.php?tid=428084)



Ahhh, OnPlayerText.. - LeeXian99 - 04.04.2013

I was trying to merge RydeR's reaction test with my gamemode, so here's the code.
pawn Код:
public OnPlayerText(playerid, text[])
{
    new name[MAX_PLAYER_NAME], msg[128];
    GetPlayerName(playerid, name, sizeof(name));
    format(msg, sizeof(msg), "{00FFFF}(%d) {ffffff}%s", playerid, text);
    SendPlayerMessageToAll(playerid, msg);
    return 0;
        {
            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 1;
    }
}
Errors:
Код:
C:\Users\Kelvin\Desktop\Scripting\gamemodes\racerevolution.pwn(6359) : warning 225: unreachable code
C:\Users\Kelvin\Desktop\Scripting\gamemodes\racerevolution.pwn(6359) : warning 217: loose indentation
C:\Users\Kelvin\Desktop\Scripting\gamemodes\racerevolution.pwn(6380) : warning 217: loose indentation
C:\Users\Kelvin\Desktop\Scripting\gamemodes\racerevolution.pwn(6382) : error 054: unmatched closing brace ("}")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: Ahhh, OnPlayerText.. - SuperViper - 04.04.2013

pawn Код:
public OnPlayerText(playerid, text[])
{
    new name[MAX_PLAYER_NAME], msg[128];
    GetPlayerName(playerid, name, sizeof(name));
    format(msg, sizeof(msg), "{00FFFF}(%d) {ffffff}%s", playerid, text);
    SendPlayerMessageToAll(playerid, msg);

    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;
}



Re: Ahhh, OnPlayerText.. - zxc1 - 04.04.2013

EDIT: Too late.