unintelligible muttering whilst gagged
#5

Quote:
Originally Posted by Pottus
Посмотреть сообщение
Consider this I have not tested it but pretty sure I got it right the rest is up to you to test and make sure it works right.

Код:
// Replacement rules (these can have any number of characters)
static LetterA[3] = { 'g', 'h', 'd' };
static LetterE[3] = { 'g', 'h', 'd' };
static LetterI[3] = { 'g', 'h', 'd' };
static LetterO[3] = { 'g', 'h', 'd' };

// Only has one
static LetterU = 'g';

BabbleText(string[])
{
	new output[144], len, currpos;
	
	len = strlen(string);
	
	// Loop through string
	for(new i = 0; i < len; i++)
	{
		// Check for letter rules
	    switch(string[i])
	    {
			// Found a letter that has an addition
			case 'a', 'e', 'i', 'o', 'u':
			{
				// Letter needs to be added no matter what
				output[currpos] = string[i];

			    // Chance of letter actually being added
				if(random(2) == 1)
				{
					// Only need to increment position if we actually need to replace
					currpos++;
                    switch(string[i])
                    {
                        case 'a': { output[currpos] = LetterA[random(strlen(LetterA))]; }
                        case 'e': { output[currpos] = LetterE[random(strlen(LetterE))]; }
                        case 'i': { output[currpos] = LetterI[random(strlen(LetterI))]; }
                        case 'o': { output[currpos] = LetterO[random(strlen(LetterO))]; }

						// Only has one no need for random
                        case 'u': { output[currpos] = LetterU; }
                    }
				}
			}

			// No rule on letter
	        default: { output[currpos] = string[i]; }
	    }

		// Always increment current position
		currpos++;
	}
	return output;
}
Where would I put this code? I also can't find where it checks for if a player is gagged or not.. To be honest, I don't understand the code at all Please assist me some more, thanks so far.
Reply


Messages In This Thread
unintelligible muttering whilst gagged - by Stefhan - 09.06.2018, 19:29
Re: unintelligible muttering whilst gagged - by Logic_ - 09.06.2018, 19:31
Re: unintelligible muttering whilst gagged - by Stefhan - 09.06.2018, 19:35
Re: unintelligible muttering whilst gagged - by Pottus - 09.06.2018, 20:06
Re: unintelligible muttering whilst gagged - by Stefhan - 09.06.2018, 20:11
Re: unintelligible muttering whilst gagged - by Pottus - 09.06.2018, 20:21
Re: unintelligible muttering whilst gagged - by Stefhan - 10.06.2018, 14:16
Re: unintelligible muttering whilst gagged - by Pottus - 10.06.2018, 15:01

Forum Jump:


Users browsing this thread: 1 Guest(s)