Strins stopping all commands from processing?
#1

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(incall[playerid] == 0) {
        new pname[MAX_PLAYER_NAME], str[144], str2[24], str3[128];
        GetPlayerName(playerid, pname, sizeof(pname));
        strreplace(pname, '_', ' ');
        format(str3,sizeof(str3),"%s",text);
        if(ducttaped[playerid] == 1) {
            new rand = random(5);
            switch(rand) {
                case 0: {
                    format(str2,sizeof(str2),"alfafphabbb");
                    strins(str3,str2,5,sizeof(str2));
                }
                case 1: {
                    format(str2,sizeof(str2),"phhaBBBabf");
                    strins(str3,str2,5,sizeof(str2));
                    format(str2,sizeof(str2),"bbbaphasph");
                    strins(str3,str2,10,sizeof(str2));
                }
                case 2: {
                    format(str2,sizeof(str2),"aaphhbabbl");
                    strins(str3,str2,6,sizeof(str2));
                    format(str2,sizeof(str2),"hafffphaAAHf");
                    strins(str3,str2,16,sizeof(str2));
                }
                case 3: {
                    format(str2,sizeof(str2),"bbbbbahphhab");
                    strins(str3,str2,3,sizeof(str2));
                    format(str2,sizeof(str2),"phpbb");
                    strins(str3,str2,15,sizeof(str2));
                    format(str2,sizeof(str2),"bphabphh");
                    strins(str3,str2,25,sizeof(str2));
                }
                case 4: {
                    format(str2,sizeof(str2),"bbbbbahphhab");
                    strins(str3,str2,4,sizeof(str2));
                    format(str2,sizeof(str2),"phpbb");
                    strins(str3,str2,8,sizeof(str2));
                    format(str2,sizeof(str2),"phsssphbbab");
                    strins(str3,str2,28,sizeof(str2));
                }
                case 5: {
                    format(str2,sizeof(str2),"AHHHBBBBBPhaaaspt");
                    strins(str3,str2,4,sizeof(str2));
                    format(str2,sizeof(str2),"BBAPHOOFBab");
                    strins(str3,str2,10,sizeof(str2));
                    format(str2,sizeof(str2),"babbhpssshpf");
                    strins(str3,str2,19,sizeof(str2));
                }
            }
           
        }
        format(str, sizeof(str), "%s says %s", pname, str3);
        ProxDetector(25.0, playerid, str, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
        print(str);
    }
        return 0;
}
What the code above is doing is basically creating local role play chat. If the player is NOT duct taped, send their text as is. If their mouth is duct taped, select a random int out of 5 and depending on the result insert a different spam text into their message.

When no one speaks with duct tape, the server will continue to run as normal. If someone duct tapes a player and that player speaks, the outputted text will be formatted correctly with spam but after that all commands return SERVER: UNKNOWN COMMAND. What am I doing wrong?
Reply


Messages In This Thread
Strins stopping all commands from processing? - by RedditWhiskers - 11.05.2013, 16:44
Re: Strins stopping all commands from processing? - by dominik523 - 11.05.2013, 17:22
Re: Strins stopping all commands from processing? - by RedditWhiskers - 11.05.2013, 19:40

Forum Jump:


Users browsing this thread: 1 Guest(s)