SA-MP Forums Archive
[TO EASY]Problem.... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [TO EASY]Problem.... (/showthread.php?tid=344850)



[TO EASY]Problem.... - Scripter123 - 22.05.2012

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...


Re: [TO EASY]Problem.... - ViniBorn - 22.05.2012

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;
}



Re: [TO EASY]Problem.... - Scripter123 - 23.05.2012

Sorry, but i still having thhe errors


Re: [TO EASY]Problem.... - Verbal - 23.05.2012

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


Re: [TO EASY]Problem.... - MeDaKewlDude - 23.05.2012

what errors are you getting?


AW: [TO EASY]Problem.... - Tigerkiller - 23.05.2012

you forgotten someone { or }

this is the easyest way to get 26 errors


Re: [TO EASY]Problem.... - MeDaKewlDude - 23.05.2012

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.


Re: [TO EASY]Problem.... - Scripter123 - 23.05.2012

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.