[TO EASY]Problem....
#1

Hello, im doing my duty sytem but, i'm havinng the famouses 26 errors.........

My code:


Код:
if(dialogid == 884)
	{
	    if(response)
		{
			if(listitem == 0)
			{
			    if(CopOnDuty[playerid] == 0)
       			{
       			    if(PlayerInfo[playerid][pRank] = 1)
					{
   						CopOnDuty[playerid] = 1;
						SetPlayerSkin(playerid, 71);
						SetPlayerToFactionColor(playerid);
						GivePlayerWeapon(playerid, 24, 70);
						GivePlayerWeapon(playerid, 3, 0);
						GivePlayerWeapon(playerid, 41, 700);
						SetPlayerArmour(playerid, 100);
						format(string, sizeof(string), "[PSP:] %s esta agora de serviзo.",GetPlayerNameEx(playerid));
 						SendFactionTypeMessage(1, COLOR_LSPD, string);
					}
					else if(PlayerInfo[playerid][pRank] = 2)
					{
					    CopOnDuty[playerid] = 1;
						SetPlayerSkin(playerid, 280);
						SetPlayerToFactionColor(playerid);
						GivePlayerWeapon(playerid, 24, 70);
						GivePlayerWeapon(playerid, 3, 0);
						GivePlayerWeapon(playerid, 41, 700);
						SetPlayerArmour(playerid, 100);
						format(string, sizeof(string), "[PSP:] %s esta agora de serviзo.",GetPlayerNameEx(playerid));
 						SendFactionTypeMessage(1, COLOR_LSPD, string);
 					}
 					else if(PlayerInfo[playerid][pRank] = 3)
					{
					    CopOnDuty[playerid] = 1;
						SetPlayerSkin(playerid, 280);
						SetPlayerToFactionColor(playerid);
						GivePlayerWeapon(playerid, 24, 70);
						GivePlayerWeapon(playerid, 3, 0);
						GivePlayerWeapon(playerid, 41, 700);
						GivePlayerWeapon(playerid, 33, 70);
						SetPlayerArmour(playerid, 100);
						format(string, sizeof(string), "[PSP:] %s esta agora de serviзo.",GetPlayerNameEx(playerid));
 						SendFactionTypeMessage(1, COLOR_LSPD, string);
					}
					else if(PlayerInfo[playerid][pRank] = 4)
					{
					    CopOnDuty[playerid] = 1;
						SetPlayerSkin(playerid, 281);
						SetPlayerToFactionColor(playerid);
						GivePlayerWeapon(playerid, 24, 70);
						GivePlayerWeapon(playerid, 3, 0);
						GivePlayerWeapon(playerid, 41, 700);
						GivePlayerWeapon(playerid, 33, 70);
						SetPlayerArmour(playerid, 100);
						format(string, sizeof(string), "[PSP:] %s esta agora de serviзo.",GetPlayerNameEx(playerid));
 						SendFactionTypeMessage(1, COLOR_LSPD, string);
					}
					else if(PlayerInfo[playerid][pRank] = 5)
					{
					    CopOnDuty[playerid] = 1;
						SetPlayerSkin(playerid, 282);
						SetPlayerToFactionColor(playerid);
						GivePlayerWeapon(playerid, 24, 70);
						GivePlayerWeapon(playerid, 3, 0);
						GivePlayerWeapon(playerid, 41, 700);
						GivePlayerWeapon(playerid, 33, 70);
						GivePlayerWeapon(playerid, 27, 70);
						SetPlayerArmour(playerid, 100);
						format(string, sizeof(string), "[PSP:] %s esta agora de serviзo.",GetPlayerNameEx(playerid));
 						SendFactionTypeMessage(1, COLOR_LSPD, string);
					}
					else if(PlayerInfo[playerid][pRank] = 6)
					{
					    CopOnDuty[playerid] = 1;
						SetPlayerSkin(playerid, 282);
						SetPlayerToFactionColor(playerid);
						GivePlayerWeapon(playerid, 24, 99999);
						GivePlayerWeapon(playerid, 3, 0);
						GivePlayerWeapon(playerid, 41, 99999);
						GivePlayerWeapon(playerid, 33, 99999);
						GivePlayerWeapon(playerid, 27, 99999);
						SetPlayerArmour(playerid, 100);
						format(string, sizeof(string), "[PSP:] %s esta agora de serviзo.",GetPlayerNameEx(playerid));
 						SendFactionTypeMessage(1, COLOR_LSPD, string);
					}
					else if(PlayerInfo[playerid][pRank] = 7)
					{
					    CopOnDuty[playerid] = 1;
						SetPlayerSkin(playerid, 283);
						SetPlayerToFactionColor(playerid);
						GivePlayerWeapon(playerid, 24, 99999);
						GivePlayerWeapon(playerid, 3, 0);
						GivePlayerWeapon(playerid, 41, 99999);
						GivePlayerWeapon(playerid, 33, 99999);
						GivePlayerWeapon(playerid, 27, 99999);
						GivePlayerWeapon(playerid, 29, 99999);
						SetPlayerArmour(playerid, 100);
						format(string, sizeof(string), "[PSP:] %s esta agora de serviзo.",GetPlayerNameEx(playerid));
 						SendFactionTypeMessage(1, COLOR_LSPD, string);
					}
					else if(PlayerInfo[playerid][pRank] = 8)
					{
					    CopOnDuty[playerid] = 1;
						SetPlayerSkin(playerid, 288);
						SetPlayerToFactionColor(playerid);
						GivePlayerWeapon(playerid, 24, 99999);
						GivePlayerWeapon(playerid, 3, 0);
						GivePlayerWeapon(playerid, 41, 99999);
						GivePlayerWeapon(playerid, 33, 99999);
						GivePlayerWeapon(playerid, 27, 99999);
						GivePlayerWeapon(playerid, 29, 99999);
						SetPlayerArmour(playerid, 100);
						format(string, sizeof(string), "[PSP:] %s esta agora de serviзo.",GetPlayerNameEx(playerid));
 						SendFactionTypeMessage(1, COLOR_LSPD, string);
					}
				}
				else if(CopOnDuty[playerid] == 1)
       			{
       			    ResetPlayerWeapons(playerid);
       			    format(string, sizeof(string), "[PSP:] %s esta agora fora de serviзo.",GetPlayerNameEx(playerid));
					SendFactionTypeMessage(1, COLOR_LSPD, string);
				}
			 }
		 }
	return 1;
}


Can someone help me ? Please...
Reply
#2

Try
pawn Код:
if(dialogid == 884)
{
    if(response)
    {
        if(listitem == 0)
        {
            if(CopOnDuty[playerid] == 0)
            {
                if(PlayerInfo[playerid][pRank] == 1)
                {
                    CopOnDuty[playerid] = 1;
                    SetPlayerSkin(playerid, 71);
                    SetPlayerToFactionColor(playerid);
                    GivePlayerWeapon(playerid, 24, 70);
                    GivePlayerWeapon(playerid, 3, 0);
                    GivePlayerWeapon(playerid, 41, 700);
                    SetPlayerArmour(playerid, 100);
                    format(string, sizeof(string), "[PSP:] %s esta agora de serviзo.",GetPlayerNameEx(playerid));
                    SendFactionTypeMessage(1, COLOR_LSPD, string);
                }
                else if(PlayerInfo[playerid][pRank] == 2)
                {
                    CopOnDuty[playerid] = 1;
                    SetPlayerSkin(playerid, 280);
                    SetPlayerToFactionColor(playerid);
                    GivePlayerWeapon(playerid, 24, 70);
                    GivePlayerWeapon(playerid, 3, 0);
                    GivePlayerWeapon(playerid, 41, 700);
                    SetPlayerArmour(playerid, 100);
                    format(string, sizeof(string), "[PSP:] %s esta agora de serviзo.",GetPlayerNameEx(playerid));
                    SendFactionTypeMessage(1, COLOR_LSPD, string);
                }
                else if(PlayerInfo[playerid][pRank] == 3)
                {
                    CopOnDuty[playerid] = 1;
                    SetPlayerSkin(playerid, 280);
                    SetPlayerToFactionColor(playerid);
                    GivePlayerWeapon(playerid, 24, 70);
                    GivePlayerWeapon(playerid, 3, 0);
                    GivePlayerWeapon(playerid, 41, 700);
                    GivePlayerWeapon(playerid, 33, 70);
                    SetPlayerArmour(playerid, 100);
                    format(string, sizeof(string), "[PSP:] %s esta agora de serviзo.",GetPlayerNameEx(playerid));
                    SendFactionTypeMessage(1, COLOR_LSPD, string);
                }
                else if(PlayerInfo[playerid][pRank] == 4)
                {
                    CopOnDuty[playerid] = 1;
                    SetPlayerSkin(playerid, 281);
                    SetPlayerToFactionColor(playerid);
                    GivePlayerWeapon(playerid, 24, 70);
                    GivePlayerWeapon(playerid, 3, 0);
                    GivePlayerWeapon(playerid, 41, 700);
                    GivePlayerWeapon(playerid, 33, 70);
                    SetPlayerArmour(playerid, 100);
                    format(string, sizeof(string), "[PSP:] %s esta agora de serviзo.",GetPlayerNameEx(playerid));
                    SendFactionTypeMessage(1, COLOR_LSPD, string);
                }
                else if(PlayerInfo[playerid][pRank] == 5)
                {
                    CopOnDuty[playerid] = 1;
                    SetPlayerSkin(playerid, 282);
                    SetPlayerToFactionColor(playerid);
                    GivePlayerWeapon(playerid, 24, 70);
                    GivePlayerWeapon(playerid, 3, 0);
                    GivePlayerWeapon(playerid, 41, 700);
                    GivePlayerWeapon(playerid, 33, 70);
                    GivePlayerWeapon(playerid, 27, 70);
                    SetPlayerArmour(playerid, 100);
                    format(string, sizeof(string), "[PSP:] %s esta agora de serviзo.",GetPlayerNameEx(playerid));
                    SendFactionTypeMessage(1, COLOR_LSPD, string);
                }
                else if(PlayerInfo[playerid][pRank] == 6)
                {
                    CopOnDuty[playerid] = 1;
                    SetPlayerSkin(playerid, 282);
                    SetPlayerToFactionColor(playerid);
                    GivePlayerWeapon(playerid, 24, 99999);
                    GivePlayerWeapon(playerid, 3, 0);
                    GivePlayerWeapon(playerid, 41, 99999);
                    GivePlayerWeapon(playerid, 33, 99999);
                    GivePlayerWeapon(playerid, 27, 99999);
                    SetPlayerArmour(playerid, 100);
                    format(string, sizeof(string), "[PSP:] %s esta agora de serviзo.",GetPlayerNameEx(playerid));
                    SendFactionTypeMessage(1, COLOR_LSPD, string);
                }
                else if(PlayerInfo[playerid][pRank] == 7)
                {
                    CopOnDuty[playerid] = 1;
                    SetPlayerSkin(playerid, 283);
                    SetPlayerToFactionColor(playerid);
                    GivePlayerWeapon(playerid, 24, 99999);
                    GivePlayerWeapon(playerid, 3, 0);
                    GivePlayerWeapon(playerid, 41, 99999);
                    GivePlayerWeapon(playerid, 33, 99999);
                    GivePlayerWeapon(playerid, 27, 99999);
                    GivePlayerWeapon(playerid, 29, 99999);
                    SetPlayerArmour(playerid, 100);
                    format(string, sizeof(string), "[PSP:] %s esta agora de serviзo.",GetPlayerNameEx(playerid));
                    SendFactionTypeMessage(1, COLOR_LSPD, string);
                }
                else if(PlayerInfo[playerid][pRank] == 8)
                {
                    CopOnDuty[playerid] = 1;
                    SetPlayerSkin(playerid, 288);
                    SetPlayerToFactionColor(playerid);
                    GivePlayerWeapon(playerid, 24, 99999);
                    GivePlayerWeapon(playerid, 3, 0);
                    GivePlayerWeapon(playerid, 41, 99999);
                    GivePlayerWeapon(playerid, 33, 99999);
                    GivePlayerWeapon(playerid, 27, 99999);
                    GivePlayerWeapon(playerid, 29, 99999);
                    SetPlayerArmour(playerid, 100);
                    format(string, sizeof(string), "[PSP:] %s esta agora de serviзo.",GetPlayerNameEx(playerid));
                    SendFactionTypeMessage(1, COLOR_LSPD, string);
                }
            }
            else
            {
                ResetPlayerWeapons(playerid);
                format(string, sizeof(string), "[PSP:] %s esta agora fora de serviзo.",GetPlayerNameEx(playerid));
                SendFactionTypeMessage(1, COLOR_LSPD, string);
            }
        }
    }
    return 1;
}
Reply
#3

Sorry, but i still having thhe errors
Reply
#4

It's very nice to use something called "switch" .
Could you show the errors?
Reply
#5

what errors are you getting?
Reply
#6

you forgotten someone { or }

this is the easyest way to get 26 errors
Reply
#7

yeah, if your getting random errors from all around your script. like a bunch of "unidentified symbol"and/or "unreachable code" errors, search your script for missing brackets.
Reply
#8

Now i'm not getting erros, im sorry it was a "}" cause of else :P


If you don't know what are the FAMOUS 26 Error on pawn, so u arent a human person.


Thank you , for all help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)