[HELP] Splitmessage
#1

I got this strok splitstring:

Код:
stock SplitStringI(CharPerLine, playerid, StringToSplit[])
{
    new Lines = floatround(strval(StringToSplit) / CharPerLine, floatround_ceil);
    new Tempstr[256];
    for(new x = 1; x<Lines; x++)
    {
        strmid(Tempstr, StringToSplit, x*150 - 150, x*150);
        ProxDetector(30.0, playerid, Tempstr, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    }
    return 1;
}
And this is my realchat

Код:
    if (realchat)
    {
        if(gPlayerLogged[playerid] == 0)
        {
            return 0;
          }
        GetPlayerName(playerid, sendername, sizeof(sendername));
        if(!IsPlayerInAnyVehicle(playerid))
        {
            if(PlayerInfo[playerid][pMaskuse] == 1)
            {
                format(string, sizeof(string), "Stranger Says: %s", text);
                ProxDetector(5.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
            }
            else
            {
                if(PlayerInfo[playerid][pAccent] == 0) format(string, sizeof(string), "%s Says: %s", RemoveUnderScore(playerid), text);
                else if(PlayerInfo[playerid][pAccent] == 1) format(string, sizeof(string), "%s Says [British Accent]: %s", RemoveUnderScore(playerid), text);
                else if(PlayerInfo[playerid][pAccent] == 2)  format(string, sizeof(string), "%s Says [Japanese Accent]: %s", RemoveUnderScore(playerid), text);
                else if(PlayerInfo[playerid][pAccent] == 3)  format(string, sizeof(string), "%s Says [Chinese Accent]: %s", RemoveUnderScore(playerid), text);
                else if(PlayerInfo[playerid][pAccent] == 4)  format(string, sizeof(string), "%s Says [Korean Accent]: %s", RemoveUnderScore(playerid), text);
                else if(PlayerInfo[playerid][pAccent] == 5)  format(string, sizeof(string), "%s Says [Scottish Accent]: %s", RemoveUnderScore(playerid), text);
                else if(PlayerInfo[playerid][pAccent] == 6)  format(string, sizeof(string), "%s Says [Irish Accent]: %s", RemoveUnderScore(playerid), text);
                else if(PlayerInfo[playerid][pAccent] == 7)  format(string, sizeof(string), "%s Says [Russian Accent]: %s", RemoveUnderScore(playerid), text);
                else if(PlayerInfo[playerid][pAccent] == 8)  format(string, sizeof(string), "%s Says [American Accent]: %s", RemoveUnderScore(playerid), text);
                else if(PlayerInfo[playerid][pAccent] == 9)  format(string, sizeof(string), "%s Says [Mexican Accent]: %s", RemoveUnderScore(playerid), text);
                else if(PlayerInfo[playerid][pAccent] == 10)  format(string, sizeof(string), "%s Says [Texan Accent]: %s", RemoveUnderScore(playerid), text);
                else if(PlayerInfo[playerid][pAccent] == 11)  format(string, sizeof(string), "%s Says [Cuban Accent]: %s", RemoveUnderScore(playerid), text);
                else if(PlayerInfo[playerid][pAccent] == 12)  format(string, sizeof(string), "%s Says [Italian Accent]: %s", RemoveUnderScore(playerid), text);
                else if(PlayerInfo[playerid][pAccent] == 13)  format(string, sizeof(string), "%s Says [Gangsta Accent]: %s", RemoveUnderScore(playerid), text);
                else if(PlayerInfo[playerid][pAccent] == 14)  format(string, sizeof(string), "%s Says [Australian Accent]: %s", RemoveUnderScore(playerid), text);
                else format(string, sizeof(string), "%s Says: %s", RemoveUnderScore(playerid), text);
                ProxDetector(5.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
            }
        }
Now I'm asking you guys.. How do I put those 2 together?
Reply
#2

Under your "realchat" replace ProxDetector with SplitStringI.
Reply
#3

I got this errors:
Код:
C:\Users\mma\Desktop\New Server SAMP\gamemodes\prisonrp.pwn(38691) : warning 213: tag mismatch
C:\Users\mma\Desktop\New Server SAMP\gamemodes\prisonrp.pwn(38691) : warning 202: number of arguments does not match definition
C:\Users\mma\Desktop\New Server SAMP\gamemodes\prisonrp.pwn(38691) : warning 202: number of arguments does not match definition
C:\Users\mma\Desktop\New Server SAMP\gamemodes\prisonrp.pwn(38691) : warning 202: number of arguments does not match definition
C:\Users\mma\Desktop\New Server SAMP\gamemodes\prisonrp.pwn(38691) : warning 202: number of arguments does not match definition
C:\Users\mma\Desktop\New Server SAMP\gamemodes\prisonrp.pwn(38691) : warning 202: number of arguments does not match definition
C:\Users\mma\Desktop\New Server SAMP\gamemodes\prisonrp.pwn(38725) : warning 213: tag mismatch
C:\Users\mma\Desktop\New Server SAMP\gamemodes\prisonrp.pwn(38725) : warning 202: number of arguments does not match definition
C:\Users\mma\Desktop\New Server SAMP\gamemodes\prisonrp.pwn(38725) : warning 202: number of arguments does not match definition
C:\Users\mma\Desktop\New Server SAMP\gamemodes\prisonrp.pwn(38725) : warning 202: number of arguments does not match definition
C:\Users\mma\Desktop\New Server SAMP\gamemodes\prisonrp.pwn(38725) : warning 202: number of arguments does not match definition
C:\Users\mma\Desktop\New Server SAMP\gamemodes\prisonrp.pwn(38725) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase

Header size:           9500 bytes
Code size:          1602888 bytes
Data size:          9024940 bytes
Stack/heap size:      16384 bytes; estimated max. usage=5266 cells (21064 bytes)
Total requirements:10653712 bytes

12 Warnings.
And this is my code:

Код:
	if (realchat)
	{
	    if(gPlayerLogged[playerid] == 0)
	    {
	        return 0;
      	}
		GetPlayerName(playerid, sendername, sizeof(sendername));
		if(!IsPlayerInAnyVehicle(playerid))
		{
			if(PlayerInfo[playerid][pMaskuse] == 1)
			{
				format(string, sizeof(string), "Stranger Says: %s", text);
				ProxDetector(5.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
			}
			else
			{
				if(PlayerInfo[playerid][pAccent] == 0) format(string, sizeof(string), "%s Says: %s", RemoveUnderScore(playerid), text);
				else if(PlayerInfo[playerid][pAccent] == 1) format(string, sizeof(string), "%s Says [British Accent]: %s", RemoveUnderScore(playerid), text);
				else if(PlayerInfo[playerid][pAccent] == 2)  format(string, sizeof(string), "%s Says [Japanese Accent]: %s", RemoveUnderScore(playerid), text);
				else if(PlayerInfo[playerid][pAccent] == 3)  format(string, sizeof(string), "%s Says [Chinese Accent]: %s", RemoveUnderScore(playerid), text);
				else if(PlayerInfo[playerid][pAccent] == 4)  format(string, sizeof(string), "%s Says [Korean Accent]: %s", RemoveUnderScore(playerid), text);
				else if(PlayerInfo[playerid][pAccent] == 5)  format(string, sizeof(string), "%s Says [Scottish Accent]: %s", RemoveUnderScore(playerid), text);
				else if(PlayerInfo[playerid][pAccent] == 6)  format(string, sizeof(string), "%s Says [Irish Accent]: %s", RemoveUnderScore(playerid), text);
				else if(PlayerInfo[playerid][pAccent] == 7)  format(string, sizeof(string), "%s Says [Russian Accent]: %s", RemoveUnderScore(playerid), text);
				else if(PlayerInfo[playerid][pAccent] == 8)  format(string, sizeof(string), "%s Says [American Accent]: %s", RemoveUnderScore(playerid), text);
				else if(PlayerInfo[playerid][pAccent] == 9)  format(string, sizeof(string), "%s Says [Mexican Accent]: %s", RemoveUnderScore(playerid), text);
				else if(PlayerInfo[playerid][pAccent] == 10)  format(string, sizeof(string), "%s Says [Texan Accent]: %s", RemoveUnderScore(playerid), text);
				else if(PlayerInfo[playerid][pAccent] == 11)  format(string, sizeof(string), "%s Says [Cuban Accent]: %s", RemoveUnderScore(playerid), text);
				else if(PlayerInfo[playerid][pAccent] == 12)  format(string, sizeof(string), "%s Says [Italian Accent]: %s", RemoveUnderScore(playerid), text);
				else if(PlayerInfo[playerid][pAccent] == 13)  format(string, sizeof(string), "%s Says [Gangsta Accent]: %s", RemoveUnderScore(playerid), text);
				else if(PlayerInfo[playerid][pAccent] == 14)  format(string, sizeof(string), "%s Says [Australian Accent]: %s", RemoveUnderScore(playerid), text);
				else format(string, sizeof(string), "%s Says: %s", RemoveUnderScore(playerid), text);
				SplitStringI(5.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
			}
		}
		else
		{
		    new carid = GetPlayerVehicleID(playerid);
		    new pveh = GetVehicleModel(GetPlayerVehicleID(playerid));
		    if(IsABike(carid) || IsAOBike(carid) || IsAPizzabike(carid) || IsAPlane(carid) || IsABoat(carid) || IsASweeper(carid) || IsAHarvest(carid) || IsADrugHarvest(carid) || IsATank(carid) || pveh == 523 || pveh == 480 || pveh == 567 || pveh == 533 || pveh == 555 || pveh == 539 || pveh == 572 || pveh == 571 || pveh == 530 || pveh == 457 || pveh == 575 || pveh == 536 || pveh == 424)
      		{
		        if(PlayerInfo[playerid][pMaskuse] == 1)
				{
					format(string, sizeof(string), "Stranger Says: %s", text);
					ProxDetector(5.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
				}
				else
				{
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "Says: %s", text);
					if(PlayerInfo[playerid][pAccent] == 0) format(string, sizeof(string), "%s Says: %s", RemoveUnderScore(playerid), text);
					else if(PlayerInfo[playerid][pAccent] == 1) format(string, sizeof(string), "%s Says [British Accent]: %s", RemoveUnderScore(playerid), text);
					else if(PlayerInfo[playerid][pAccent] == 2)  format(string, sizeof(string), "%s Says [Japanese Accent]: %s", RemoveUnderScore(playerid), text);
					else if(PlayerInfo[playerid][pAccent] == 3)  format(string, sizeof(string), "%s Says [Chinese Accent]: %s", RemoveUnderScore(playerid), text);
					else if(PlayerInfo[playerid][pAccent] == 4)  format(string, sizeof(string), "%s Says [Korean Accent]: %s", RemoveUnderScore(playerid), text);
					else if(PlayerInfo[playerid][pAccent] == 5)  format(string, sizeof(string), "%s Says [Scottish Accent]: %s", RemoveUnderScore(playerid), text);
					else if(PlayerInfo[playerid][pAccent] == 6)  format(string, sizeof(string), "%s Says [Irish Accent]: %s", RemoveUnderScore(playerid), text);
					else if(PlayerInfo[playerid][pAccent] == 7)  format(string, sizeof(string), "%s Says [Russian Accent]: %s", RemoveUnderScore(playerid), text);
					else if(PlayerInfo[playerid][pAccent] == 8)  format(string, sizeof(string), "%s Says [American Accent]: %s", RemoveUnderScore(playerid), text);
					else if(PlayerInfo[playerid][pAccent] == 9)  format(string, sizeof(string), "%s Says [Mexican Accent]: %s", RemoveUnderScore(playerid), text);
					else if(PlayerInfo[playerid][pAccent] == 10)  format(string, sizeof(string), "%s Says [Texan Accent]: %s", RemoveUnderScore(playerid), text);
					else if(PlayerInfo[playerid][pAccent] == 11)  format(string, sizeof(string), "%s Says [Cuban Accent]: %s", RemoveUnderScore(playerid), text);
					else if(PlayerInfo[playerid][pAccent] == 12)  format(string, sizeof(string), "%s Says [Italian Accent]: %s", RemoveUnderScore(playerid), text);
					else if(PlayerInfo[playerid][pAccent] == 13)  format(string, sizeof(string), "%s Says [Gangsta Accent]: %s", RemoveUnderScore(playerid), text);
					else if(PlayerInfo[playerid][pAccent] == 14)  format(string, sizeof(string), "%s Says [Australian Accent]: %s", RemoveUnderScore(playerid), text);
     				else format(string, sizeof(string), "%s Says: %s", RemoveUnderScore(playerid), text);
					SplitStringI(5.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
				}
		    }
Reply
#4

SplitStringI(CharPerLine, playerid, StringToSplit[])
This is from the code you posted yourself. You should be able to read and understand it.
Reply
#5

Now it gave me this error:

Код:
C:\Users\mma\Desktop\New Server SAMP\gamemodes\prisonrp.pwn(38691) : error 017: undefined symbol "CharPerLine"
C:\Users\mma\Desktop\New Server SAMP\gamemodes\prisonrp.pwn(38725) : error 017: undefined symbol "CharPerLine"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#6

Quote:
Originally Posted by joeri55
Посмотреть сообщение
Now it gave me this error:

Код:
C:\Users\mma\Desktop\New Server SAMP\gamemodes\prisonrp.pwn(38691) : error 017: undefined symbol "CharPerLine"
C:\Users\mma\Desktop\New Server SAMP\gamemodes\prisonrp.pwn(38725) : error 017: undefined symbol "CharPerLine"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Replace CharPerLine with a integer number. Number indicates how many characters will be on one line. So... go in-game and look how many characters can fit into chat (one line).
Reply
#7

I did that and now I get this one

Код:
C:\Users\mma\Desktop\New Server SAMP\gamemodes\prisonrp.pwn(38691) : error 017: undefined symbol "StringToSplit"
C:\Users\mma\Desktop\New Server SAMP\gamemodes\prisonrp.pwn(38725) : error 017: undefined symbol "StringToSplit"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Damn.. lmao.
Reply
#8

replace StringToSplit with just string. But not in the function, only in the thing you call "realchat". And don't use the [].
Reply
#9

It complied well but it doesn't works. I don't see any text.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)