I cant Add any More lines Of duty points anymore
#1

My script Tells me This when i try to add another line


PHP код:
C:\Users\Snor !\Desktop\Real Life ENG\gamemodes\mazda.pwn(54039) : error 075input line too long (after substitutions)
C:\Users\Snor !\Desktop\Real Life ENG\gamemodes\mazda.pwn(54041) : error 001expected token","but found "-integer value-"
C:\Users\Snor !\Desktop\Real Life ENG\gamemodes\mazda.pwn(54041) : warning 215expression has no effect
C
:\Users\Snor !\Desktop\Real Life ENG\gamemodes\mazda.pwn(54041) : warning 215expression has no effect
C
:\Users\Snor !\Desktop\Real Life ENG\gamemodes\mazda.pwn(54041) : warning 215expression has no effect
C
:\Users\Snor !\Desktop\Real Life ENG\gamemodes\mazda.pwn(54041) : error 001expected token";"but found ")"
C:\Users\Snor !\Desktop\Real Life ENG\gamemodes\mazda.pwn(54041) : warning 217loose indentation
C
:\Users\Snor !\Desktop\Real Life ENG\gamemodes\mazda.pwn(54041) : error 029invalid expressionassumed zero
C
:\Users\Snor !\Desktop\Real Life ENG\gamemodes\mazda.pwn(54041) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
5 Errors

How can i fix this? and make more duty points
The duty Lines
PHP код:
    if(strcmp(cmd"/duty"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pWanted] == 1) return SendClientMessage(playeridCOLOR_GREY"* Criminals can not go on duty!");
            if(
PlayerInfo[playerid][pMember] == || PlayerInfo[playerid][pLeader] == || PlayerInfo[playerid][pMember] == || PlayerInfo[playerid][pLeader] == || PlayerInfo[playerid][pMember] == || PlayerInfo[playerid][pLeader] == || PlayerInfo[playerid][pLeader] == || PlayerInfo[playerid][pMember] == || PlayerInfo[playerid][pLeader] == 12  || PlayerInfo[playerid][pMember] == 12 || IsAFreecop(playerid))
            {
                if(
PlayerInfo[playerid][pDBanned] == 1)
                {
                    
SendClientMessage(playeridCOLOR_GREY"* You are Banned from Cop Duty!");
                    return 
1;
                }
                if(
IsPlayerInRangeOfPoint(playerid6,220.4274,74.9089,1005.0391) || IsPlayerInRangeOfPoint(playerid6,1345.89,521.74,1067.76) || IsPlayerInRangeOfPoint(playerid6,354.1142,154.9421,1025.7964) || IsPlayerInRangeOfPoint(playerid61565.35,-1671.68,1723.10) || IsPlayerInRangeOfPoint(playerid6233.5504,124.9487,1003.2188) || IsPlayerInRangeOfPoint(playerid6,203.5945,1869.5051,13.1406) || IsPlayerInRangeOfPoint(playerid6,-1342.0365,494.2091,11.1953) || IsPlayerInRangeOfPoint(playerid6,-1342.0365,494.2091,11.1953) || PlayerInfo[playerid][pLocal] != 255)
                {
                    if(
PlayerInfo[playerid][pDuty] == 0)
                    {
                        if(
IsAFreecop(playerid))
                        {
                            
format(stringsizeof(string), "* Voluntary Officer %s took a Badge and a Gun from his locker."sendername);
                            
ProxDetector(30.0playeridstringCOLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
                            
SafeResetPlayerWeapons(playerid);
                            
SafeGivePlayerWeapon(playerid41150);
                            
SafeGivePlayerWeapon(playerid2470);
                            
SafeGivePlayerWeapon(playerid30);
                            
SetPlayerColor(playerid,COLOR_NEUTRALBLUE);
                            
PlayerInfo[playerid][pDuty] = 1;
                            
PlayerInfo[playerid][pChar] = 71;
                            new 
factionskin PlayerInfo[playerid][pChar];
                            
SetPlayerSkin(playeridfactionskin);
                            
SaveGuns(playerid);
                            return 
1;
                        }
                        if(
PlayerInfo[playerid][pMember] == || PlayerInfo[playerid][pLeader] == 1)
                        {
                            
format(stringsizeof(string), "* Officer %s took a Badge and a Gun from his locker."sendername);
                            
SendClientMessage(playeridCOLOR_WHITE"Type /equip for equipments // Type /undercover to see UC Skins!");
                        }
                        else if(
PlayerInfo[playerid][pMember] == || PlayerInfo[playerid][pLeader] == 2)
                        {
                            
format(stringsizeof(string), "* Agent %s took a Badge and a Gun from his locker."sendername);
                            
SendClientMessage(playeridCOLOR_WHITE"Type /equip, /agent and /undercover for equipments & Skins!");
                        }
                        else if(
PlayerInfo[playerid][pMember] == || PlayerInfo[playerid][pLeader] == 3)
                        {
                            
format(stringsizeof(string), "* Sheriff %s took a Badge and a Gun from his locker."sendername);
                            
SendClientMessage(playeridCOLOR_WHITE"Type /equip and /Sheriff for equipments & Skins!");
                        }
                        else if(
PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12)
                        {
                            
format(stringsizeof(string), "* Army Member %s took a Badge and a Gun from his locker."sendername);
                            
SendClientMessage(playeridCOLOR_WHITE"Type /equip For equips!");
                        }
                        else if(
PlayerInfo[playerid][pMember] == || PlayerInfo[playerid][pLeader] == 7)
                        {
                            
format(stringsizeof(string), "* Goverment Member %s took a Badge and a Gun from his locker."sendername);
                            
SendClientMessage(playeridCOLOR_WHITE"Type /equip For equips!");
                        }
                        
SendClientMessage(playeridCOLOR_WHITE,"* If you wish to use your tazer type /tazer");
                        
ProxDetector(30.0playeridstringCOLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
                        
SafeResetPlayerWeapons(playerid);
                        
SafeGivePlayerWeapon(playerid2470);
                        
SafeGivePlayerWeapon(playerid30);
                        
PlayerInfo[playerid][pTazerBullets] = 20;
                        
PlayerInfo[playerid][pDuty] = 1;
                        
SetPlayerToTeamColor(playerid);
                        new 
factionskin PlayerInfo[playerid][pChar];
                        
SetPlayerSkin(playeridfactionskin);
                        
AttachWeaponCorrectly(playerid23);
                    }
                    else if(
PlayerInfo[playerid][pDuty] == 1)
                    {
                        if(
IsAFreecop(playerid))
                        {
                            
format(stringsizeof(string), "* Voluntary Officer %s places his Badge and Gun in his locker."sendername);
                            
ProxDetector(30.0playeridstringCOLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
                            
SafeResetPlayerWeapons(playerid);
                            
PlayerInfo[playerid][pDuty] = 0;
                            
SetPlayerColor(playeridTEAM_HIT_COLOR);
                            new 
originalskin PlayerInfo[playerid][pModel];
                            
SetPlayerSkin(playeridoriginalskin);
                            
PlayerInfo[playerid][pChar] = 0;
                            
SetPlayerWeapons(playerid);
                            return 
1;
                        }
                        if(
PlayerInfo[playerid][pMember] == || PlayerInfo[playerid][pLeader] == 1)
                        {
                            
OnSwatDuty[playerid] = 0;
                            
format(stringsizeof(string), "* Officer %s places his Badge and Gun in his locker."sendername);
                        }
                        else if(
PlayerInfo[playerid][pMember] == || PlayerInfo[playerid][pLeader] == 2)
                        {
                            
OnTacticalDuty[playerid] = 0;
                            
format(stringsizeof(string), "* Agent %s places his Badge and Gun in his locker."sendername);
                        }
                        else if(
PlayerInfo[playerid][pMember] == || PlayerInfo[playerid][pLeader] == 3)
                        {
                            
OnSpecialFDuty[playerid] = 0;
                            
format(stringsizeof(string), "* Sheriff %s places his Badge and Gun in his locker."sendername);
                        }
                        else if(
PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12)
                        {
                            
OnSpecialFDuty[playerid] = 0;
                            
format(stringsizeof(string), "* Army Member %s places his Badge and Gun in his locker."sendername);
                        }
                        else if(
PlayerInfo[playerid][pMember] == || PlayerInfo[playerid][pLeader] == 7)
                        {
                            
format(stringsizeof(string), "* Goverment Member %s places his Badge and Gun in his locker."sendername);
                        }
                        
ProxDetector(30.0playeridstringCOLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
                        
SafeResetPlayerWeapons(playerid);
                        
SafeSetPlayerArmour(playerid0);
                        
SafeGivePlayerWeapon(playerid41500);
                        
PlayerInfo[playerid][pDuty] = 0;
                        
SetPlayerColor(playeridTEAM_HIT_COLOR);
                        new 
originalskin PlayerInfo[playerid][pModel];
                        
SetPlayerSkin(playeridoriginalskin);
                        
AttachWeaponCorrectly(playerid99);
                    }
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_GRAD2"** You are Not At the Equip Point! !");
                    return 
1;
                }
            }
            else if(
PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4)
            {
                if(!
IsPlayerInRangeOfPoint(playerid3.01222.1793,-1246.3489,1287.8243))
                {
                    
SendClientMessage(playeridCOLOR_GRAD1"You are not at the Medic Lockers!");
                    return 
1;
                }
                if(
JobDuty[playerid] == 1)
                {
                    
SendClientMessage(playeridCOLOR_WHITE"* You are now Off Duty from your Medic Job and will not receive calls anymore.");
                    
JobDuty[playerid] = 0;
                    
Medics -= 1;
                    
SetPlayerColor(playeridTEAM_HIT_COLOR);
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_WHITE"* You are now On Duty with your Medic Job and will receive calls from people in need.");
                    
SendClientMessage(playeridTEAM_GROVE_COLOR"* Hint: Type /Medicskin to change your skin.");
                    
JobDuty[playerid] = 1;
                    
Medics += 1;
                    
SetPlayerColor(playerid0xFF828200);
                }
            }
            else if(
PlayerInfo[playerid][pJob] == 17)
               {
                   if(
JobDuty[playerid] == 1)
                   {
                       
SendClientMessage(playeridCOLOR_WHITE"* You are now Off Duty from your Pizza Delivery Job and will not receive calls anymore.");
                       
JobDuty[playerid] = 0;
                       
PizzaBoys -= 1;
                   }
                   else
                   {
                       
SendClientMessage(playeridCOLOR_WHITE"* You are now On Duty with your Pizza Delivery Job and will receive calls from people in need.");
                       
JobDuty[playerid] = 1;
                    
PizzaBoys += 1;
                    
GetPlayerName(playerid,sendername,sizeof(sendername));
                       
format(stringsizeof(string), "[Advert] Well stacked pizza worker %s is now On Duty, /call 111 to order a pizza."sendername);
                    
OOCNews(0xFF7E00AA,string);
                }
            }
            else if(
PlayerInfo[playerid][pJob] == 7)
            {
                if(
JobDuty[playerid] == 1)
                {
                    
SendClientMessage(playeridCOLOR_WHITE"* You are now Off Duty from your Car Mechanic Job and will not receive calls anymore.");
                    
JobDuty[playerid] = 0;
                    
Mechanics -= 1;
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_WHITE"* You are now On Duty with your Car Mechanic Job and will receive calls from people in need.");
                    
JobDuty[playerid] = 1;
                    
Mechanics += 1;
                    
GetPlayerName(playerid,sendername,sizeof(sendername));
                       
format(stringsizeof(string), "[Advert] Car mechanic %s is now On Duty, /call 555 to call a mechanic."sendername);
                    
OOCNews(0x2993EDAA,string);
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GRAD1"   You are not a Cop !");
            }
            new 
ymd;
            new 
h,mi,s;
            
getdate(y,m,d);
            
gettime(h,mi,s);
            
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /duty",d,m,y,h,mi,s,sendername);
            
CommandLog(string);
        }
        return 
1;
    } 
Reply
#2

Use an array and a loop. And stop using godforsaken godfather edits.

pawn Код:
static const Float:dutyPoints[][3] = {
    {220.4274,74.9089,1005.0391},
    {1345.89,521.74,1067.76},
    // you get the point
};
Add that on top or in the command, depending on if you want to use these locations elsewhere.

pawn Код:
new
    bool:found;

for(new i; i < sizeof(dutyPoints); i++)
{
    if(IsPlayerInRangeOfPoint(playerid, 6, dutyPoints[i][0], dutyPoints[i][1], dutyPoints[i][2]))
    {
        found = true;
        break;
    }
}

if(found)
{
    // stuff if they're in range
}
Reply
#3

Ah can u help me on teamvieuwer with this or else Fill the code for me My Pawno crashes with it lol
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)