Registration System.
#1

I have a problem in Roleplay Quiz system can anybody fix this errors ?

Here is script:

Код:
	if(RegistrationQuestion[playerid] > 0)
	{
        if(RegistrationQuestion[playerid] == 1)
	    {
	        new idx;
	    	tmp = strtok(text, idx);
		    if((strcmp("2", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("2")))
			{
			    SendClientMessage(playerid, COLOR_WHITE, "Excellent!");
			    SendClientMessage(playerid, COLOR_LIGHTRED, "What is IC?");
				SendClientMessage(playerid, COLOR_WHITE, "1. In Charge");
				SendClientMessage(playerid, COLOR_WHITE, "2. In Cheaters");
				SendClientMessage(playerid, COLOR_WHITE, "3. In Character")
				RegistrationQuestion[playerid] = 2;
				return 0;
			}
			else
			{
    			format(string, sizeof(string), "Go to our forums and read our rules. >> %s <<");
			    SendClientMessage(playerid, COLOR_WHITE, string);
				Kick(playerid);
				return 0;
			}
		}
		else if(RegistrationQuestion[playerid] == 2)
	    {
	        new idx;
	    	tmp = strtok(text, idx);
		    if((strcmp("3", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("3")))
			{
			    SendClientMessage(playerid, COLOR_WHITE, "Excellent!");
                SendClientMessage(playerid, COLOR_LIGHTRED, "If you need help, what will you do?");
				SendClientMessage(playerid, COLOR_WHITE, "1. Ask on /report");
				SendClientMessage(playerid, COLOR_WHITE, "2. Ask a helper/admin on duty to help you.");
				SendClientMessage(playerid, COLOR_WHITE, "3. Spam for help on /report");
				RegistrationQuestion[playerid] = 3;
			    return 0;
			}
			else
			{
    			format(string, sizeof(string), "Go to our forums and read our rules. >> %s <<");
			    SendClientMessage(playerid, COLOR_WHITE, string);
				Kick(playerid);
				return 0;
			}
		}
		else if(RegistrationQuestion[playerid] == 3)
	    {
	        new idx;
	    	tmp = strtok(text, idx);
		    if((strcmp("2", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("2")))
			{
			    SendClientMessage(playerid, COLOR_WHITE, "Excellent!");
                SendClientMessage(playerid, COLOR_LIGHTRED, "If you see a cheater, what will you do?");
				SendClientMessage(playerid, COLOR_WHITE, "1. Report him on /helpme");
				SendClientMessage(playerid, COLOR_WHITE, "2. Report him on /report and take some SS for forums if admins don't respond.");
				SendClientMessage(playerid, COLOR_WHITE, "3. Get a gun to kill him.");
				RegistrationQuestion[playerid] = 4;
			    return 0;
			}
			else
			{
    			format(string, sizeof(string), "Go to our forums and read our rules. >> %s <<");
			    SendClientMessage(playerid, COLOR_WHITE, string);
				Kick(playerid);
				return 0;
			}
		}
		else if(RegistrationQuestion[playerid] == 4)
	    {
	        new idx;
	    	tmp = strtok(text, idx);
		    if((strcmp("2", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("2")))
			{
			    SendClientMessage(playerid, COLOR_WHITE, "Excellent!");
                SendClientMessage(playerid, COLOR_LIGHTRED, "If you got banned for something you didn't do, what will you do:");
				SendClientMessage(playerid, COLOR_WHITE, "1. Post ban apeal on forums.");
				SendClientMessage(playerid, COLOR_WHITE, "2. Change my IP and ask admins IG why i got banned.");
				SendClientMessage(playerid, COLOR_WHITE, "3. Try to get in contact with the owner on MSN.");
				RegistrationQuestion[playerid] = 5;
			    return 0;
			}
			else
			{
    			format(string, sizeof(string), "Go to our forums and read our rules. >> %s <<");
			    SendClientMessage(playerid, COLOR_WHITE, string);
				Kick(playerid);
				return 0;
			}
		}
		else if(RegistrationQuestion[playerid] == 5)
	    {
	        new idx;
	    	tmp = strtok(text, idx);
		    if((strcmp("1", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("1")))
			{
			    SendClientMessage(playerid, COLOR_WHITE, "Excellent!");
                SendClientMessage(playerid, COLOR_LIGHTRED, "Which of these /do commands are used properly?");
				SendClientMessage(playerid, COLOR_WHITE, "1. /do lag test.");
				SendClientMessage(playerid, COLOR_WHITE, "2. /do ID 32 is cheating!");
				SendClientMessage(playerid, COLOR_WHITE, "3. /do car window is open.");
				RegistrationQuestion[playerid] = 6;
			    return 0;
			}
			else
			{
    			format(string, sizeof(string), "Go to our forums and read our rules. >> %s <<");
			    SendClientMessage(playerid, COLOR_WHITE, string);
				Kick(playerid);
				return 0;
			}
		}
		else if(RegistrationQuestion[playerid] == 6)
	    {
	        new idx;
	    	tmp = strtok(text, idx);
		    if((strcmp("3", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("3")))
			{
			    SendClientMessage(playerid, COLOR_WHITE, "Excellent!");
                SendClientMessage(playerid, COLOR_LIGHTRED, "If you don't like some staff member, what will you do:");
				SendClientMessage(playerid, COLOR_WHITE, "1. Contact owner");
				SendClientMessage(playerid, COLOR_WHITE, "2. Contact some high level administrator");
				SendClientMessage(playerid, COLOR_WHITE, "3. Post a Complain/Report topic on the forums");
				RegistrationQuestion[playerid] = 7;
			    return 0;
			}
			else
			{
    			format(string, sizeof(string), "Go to our forums and read our rules. >> %s <<");
			    SendClientMessage(playerid, COLOR_WHITE, string);
				Kick(playerid);
				return 0;
			}
		}
		else if(RegistrationQuestion[playerid] == 7)
	    {
	        new idx;
	    	tmp = strtok(text, idx);
		    if((strcmp("3", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("3")))
			{
			    SendClientMessage(playerid, COLOR_WHITE, "Excellent!");
                SendClientMessage(playerid, COLOR_LIGHTRED, "If you want to be a staff member, what will you do:");
				SendClientMessage(playerid, COLOR_WHITE, "1. Ask a high level admin to add me in helper/gm/admin team");
				SendClientMessage(playerid, COLOR_WHITE, "2. Apply on the forums");
				SendClientMessage(playerid, COLOR_WHITE, "3. Contact the owner");
				RegistrationQuestion[playerid] = 8;
			    return 0;
			}
			else
			{
    			format(string, sizeof(string), "Go to our forums and read our rules. >> %s <<");
			    SendClientMessage(playerid, COLOR_WHITE, string);
				Kick(playerid);
				return 0;
			}
		}
		else if(RegistrationQuestion[playerid] == 8)
	    {
	        new idx;
	    	tmp = strtok(text, idx);
		    if((strcmp("2", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("2")))
			{
			    SendClientMessage(playerid, COLOR_WHITE, "Excellent!");
                SendClientMessage(playerid, COLOR_LIGHTRED, "If you need money, what will you do:");
				SendClientMessage(playerid, COLOR_WHITE, "1. Take a job and try to earn it RP way");
				SendClientMessage(playerid, COLOR_WHITE, "2. Ask an admin to give you");
				RegistrationQuestion[playerid] = 9;
			    return 0;
			}
			else
			{
    			format(string, sizeof(string), "Go to our forums and read our rules. >> %s <<");
			    SendClientMessage(playerid, COLOR_WHITE, string);
				Kick(playerid);
				return 0;
			}
		}
		else if(RegistrationQuestion[playerid] == 9)
	    {
	        new idx;
	    	tmp = strtok(text, idx);
		    if((strcmp("1", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("1")))
			{
			    SendClientMessage(playerid, COLOR_WHITE, "Excellent!");
                SendClientMessage(playerid, COLOR_LIGHTRED, "Did you read our rules on our forums and will you follow them?");
				SendClientMessage(playerid, COLOR_WHITE, "1. Yes");
				SendClientMessage(playerid, COLOR_WHITE, "2. No");
				RegistrationQuestion[playerid] = 10;
			    return 0;
			}
			else
			{
    			format(string, sizeof(string), "Go to our forums and read our rules. >> %s <<");
			    SendClientMessage(playerid, COLOR_WHITE, string);
				Kick(playerid);
				return 0;
			}
		}
		else if(RegistrationQuestion[playerid] == 10)
	    {
	        new idx;
	    	tmp = strtok(text, idx);
		    if((strcmp("1", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("1")) || (strcmp("Yes", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("Yes")))
			{
            SetZaiatMoney(playerid, 0);
            GiveZaiatMoney(playerid, 3000);
            SetPlayerPos(playerid, 1499.8129,1308.9163,1093.2891);
	        SetPlayerFacingAngle(playerid, 93.3274);
	        SetCameraBehindPlayer(playerid);
	        SetPlayerInterior(playerid, 3);
	        SetPlayerVirtualWorld(playerid, 0);
            ShowDialog(playerid, 0);
			    return 0;
			}
			else
			{
				ClearChatbox(playerid, 10);
    			format(string, sizeof(string), "	We can't let you in if you don't accept our rules. To check them, use %s!");
			    SendClientMessage(playerid, COLOR_WHITE, string);
				Kick(playerid);
				return 0;
			}

		}
	}
"array sizes do not match, or destination array is too small" ERROR comes on every RegistrationQuestion[playerid] =

Here is Errors:

Код:
E:\GAME\Assassin's Creed III\orbit\Coffesan\COS RP\COS RP\gamemodes\LS-PR.pwn(3579) : error 047: array sizes do not match, or destination array is too small
E:\GAME\Assassin's Creed III\orbit\Coffesan\COS RP\COS RP\gamemodes\LS-PR.pwn(3587) : error 001: expected token: ";", but found "-identifier-"
E:\GAME\Assassin's Creed III\orbit\Coffesan\COS RP\COS RP\gamemodes\LS-PR.pwn(3601) : error 047: array sizes do not match, or destination array is too small
E:\GAME\Assassin's Creed III\orbit\Coffesan\COS RP\COS RP\gamemodes\LS-PR.pwn(3623) : error 047: array sizes do not match, or destination array is too small
E:\GAME\Assassin's Creed III\orbit\Coffesan\COS RP\COS RP\gamemodes\LS-PR.pwn(3645) : error 047: array sizes do not match, or destination array is too small
E:\GAME\Assassin's Creed III\orbit\Coffesan\COS RP\COS RP\gamemodes\LS-PR.pwn(3667) : error 047: array sizes do not match, or destination array is too small
E:\GAME\Assassin's Creed III\orbit\Coffesan\COS RP\COS RP\gamemodes\LS-PR.pwn(3689) : error 047: array sizes do not match, or destination array is too small
E:\GAME\Assassin's Creed III\orbit\Coffesan\COS RP\COS RP\gamemodes\LS-PR.pwn(3711) : error 047: array sizes do not match, or destination array is too small
E:\GAME\Assassin's Creed III\orbit\Coffesan\COS RP\COS RP\gamemodes\LS-PR.pwn(3733) : error 047: array sizes do not match, or destination array is too small
E:\GAME\Assassin's Creed III\orbit\Coffesan\COS RP\COS RP\gamemodes\LS-PR.pwn(3754) : error 047: array sizes do not match, or destination array is too small
E:\GAME\Assassin's Creed III\orbit\Coffesan\COS RP\COS RP\gamemodes\LS-PR.pwn(3775) : error 047: array sizes do not match, or destination array is too small
E:\GAME\Assassin's Creed III\orbit\Coffesan\COS RP\COS RP\gamemodes\LS-PR.pwn(3786) : warning 217: loose indentation
E:\GAME\Assassin's Creed III\orbit\Coffesan\COS RP\COS RP\gamemodes\LS-PR.pwn(23812) : warning 217: loose indentation
Pawn compiler 3.2.3664     Copyright (coffee) 1997-2006, ITB CompuPhase


12 Errors.
Reply
#2

one of the errors : SendClientMessage(playerid, COLOR_WHITE, "3. In Character");
And the ones with array sizes do not match...

EDIT: it could be from this :
pawn Код:
format(string, sizeof(string), "Go to our forums and read our rules. >> %s <<");
the string is probably to small , you should define it at least new string[128]; depending on how large is your forum adress. BTW : on your format is missing something :format(string, sizeof(string), "Go to our forums and read our rules. >> %s <<",Something); . That something should be a array that "holds" the adress of your forum , you need to but something there because you used %s and that need to be replaced with something ... i hope you understand i'm dot so good at explaining

EDIT2:
new forum[64] = "http://www.yourforum.com/forum";
pawn Код:
format(string, sizeof(string), "Go to our forums and read our rules. >> %s <<",forum);
That will result a message like : Go to our forums and read our rules. >> http://www.yourforum.com/forum
<<

BTW: i'm 90% sure that your errors are from that format , because your errors number is equal to how many times you format that string ...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)