#1

So this is it, it's just only 2 options but iw anna make it three since i've 3 kinds of drugs which is Crack,Pot,Chemicals but there's no other way to deliver chemicals only this one..

PHP код:
if(GetPVarInt(playerid"ChoosingDrugs") == 1)
    {
        if(
strcmp("pot"texttrue) == 0)
        {
            new 
mypoint = -1;
            for (new 
i=0i<MAX_POINTSi++)
            {
                if(
IsPlayerInRangeOfPoint(playerid3.0Points[i][Pointx], Points[i][Pointy], Points[i][Pointz]) && strcmp(Points[i][Name], "Drug Factory"true) == 0)
                {
                    
mypoint i;
                }
            }
            if(
mypoint == -1)
            {
                
SendClientMessage(playeridCOLOR_GREY"You're not at the Drug Factory!");
                return 
0;
            }
            if(
PlayerInfo[playerid][pCrates])
            {
                
SendClientMessage(playeridCOLOR_GREY"   You can't hold any more Drug Crates!");
                
SetPVarInt(playerid"ChoosingDrugs"0);
                return 
0;
            }
             if(
CheckPointCheck(playerid))
             {
                  
SendClientMessage(playeridCOLOR_WHITE"Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint).");
                return 
0;
              }
            if(
GetPlayerCash(playerid) >= 100)
            {
                
SendClientMessage(playeridCOLOR_LIGHTBLUE,"* You bought some Drug Crates for $100.");
                
GivePlayerCash(playerid, -100);
                
PlayerInfo[playerid][pCrates] = 1;
                
SetPVarInt(playerid"CrateDeliver"1);
                
SetPVarInt(playerid"ChoosingDrugs"0);
                
SetPVarInt(playerid"tpDrugRunTimer"25);
                
SetTimerEx("OtherTimerEx"1000false"ii"playeridTYPE_TPDRUGRUNTIMER);
                
SetPlayerCheckpoint(playerid2166.3772,-1675.3829,15.08593);
                for(new 
0sizeof(FamilyInfo); i++)
                {
                    if(
strcmp(Points[mypoint][Owner], FamilyInfo[i][FamilyName], true) == 0)
                    {
                        
FamilyInfo[i][FamilyBank] += 500;
                    }
                }
                return 
0;
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GREY," You can't afford the $100!");
                
SetPVarInt(playerid"ChoosingDrugs"0);
                return 
0;
            }
        }
        else if(
strcmp("crack"texttrue) == 0)
        {
            new 
mypoint = -1;
            for (new 
i=0i<MAX_POINTSi++)
            {
                if(
IsPlayerInRangeOfPoint(playerid3.0Points[i][Pointx], Points[i][Pointy], Points[i][Pointz]) && strcmp(Points[i][Name], "Drug Factory"true) == 0)
                {
                    
mypoint i;
                }
            }
            if(
mypoint == -1)
            {
                
SendClientMessage(playeridCOLOR_GREY"You're not at the Drug Factory!");
                return 
0;
            }
            if(
PlayerInfo[playerid][pCrates])
            {
                
SendClientMessage(playeridCOLOR_GREY"   You can't hold any more drug crates!");
                
SetPVarInt(playerid"ChoosingDrugs"0);
                return 
0;
            }
             if(
CheckPointCheck(playerid))
             {
                  
SendClientMessage(playeridCOLOR_WHITE"Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint).");
                return 
0;
              }
              if(
GetPlayerCash(playerid) >= 100)
            {
                
SendClientMessage(playeridCOLOR_LIGHTBLUE,"* You bought some drug crates for $100.");
                
GivePlayerCash(playerid, -100);
                
PlayerInfo[playerid][pCrates] = 1;
                
SetPVarInt(playerid"CrateDeliver"2);
                
SetPVarInt(playerid"ChoosingDrugs"0);
                
SetPVarInt(playerid"tpDrugRunTimer"25);
                
SetTimerEx("OtherTimerEx"1000false"ii"playeridTYPE_TPDRUGRUNTIMER);
                
SetPlayerCheckpoint(playerid2354.2808,-1169.2959,28.00663);
                for(new 
0sizeof(FamilyInfo); i++)
                {
                    if(
strcmp(Points[mypoint][Owner], FamilyInfo[i][FamilyName], true) == 0)
                    {
                        
FamilyInfo[i][FamilyBank] += 50;
                    }
                }
                return 
0;
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GREY," You can't afford the $100!");
                
SetPVarInt(playerid"ChoosingDrugs"0);
                return 
0;
            }
        }
        else
        {
             
SendClientMessageEx(playeridCOLOR_LIGHTRED,"What type of drugs would you like to smuggle? Type 'crack, pot or chemicals'.");
            return 
0;
        }
        
        else if(
strcmp("chemicals"texttrue) == 0)
        {
            new 
mypoint = -1;
            for (new 
i=0i<MAX_POINTSi++)
            {
                if(
IsPlayerInRangeOfPoint(playerid3.0Points[i][Pointx], Points[i][Pointy], Points[i][Pointz]) && strcmp(Points[i][Name], "Drug Factory"true) == 0)
                {
                    
mypoint i;
                }
            }
            if(
mypoint == -1)
            {
                
SendClientMessage(playeridCOLOR_GREY"You're not at the Drug Factory!");
                return 
0;
            }
            if(
PlayerInfo[playerid][pCrates])
            {
                
SendClientMessage(playeridCOLOR_GREY"   You can't hold any more drug crates!");
                
SetPVarInt(playerid"ChoosingDrugs"0);
                return 
0;
            }
             if(
CheckPointCheck(playerid))
             {
                  
SendClientMessage(playeridCOLOR_WHITE"Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint).");
                return 
0;
              }
              if(
GetPlayerCash(playerid) >= 100)
            {
                
SendClientMessage(playeridCOLOR_LIGHTBLUE,"* You bought some drug crates for $100.");
                
GivePlayerCash(playerid, -100);
                
PlayerInfo[playerid][pCrates] = 1;
                
SetPVarInt(playerid"CrateDeliver"3);
                
SetPVarInt(playerid"ChoosingDrugs"0);
                
SetPVarInt(playerid"tpDrugRunTimer"25);
                
SetTimerEx("OtherTimerEx"1000false"ii"playeridTYPE_TPDRUGRUNTIMER);
                
SetPlayerCheckpoint(playerid2354.2808,-1169.2959,28.00663);
                for(new 
0sizeof(FamilyInfo); i++)
                {
                    if(
strcmp(Points[mypoint][Owner], FamilyInfo[i][FamilyName], true) == 0)
                    {
                        
FamilyInfo[i][FamilyBank] += 50;
                    }
                }
                return 
0;
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GREY," You can't afford the $100!");
                
SetPVarInt(playerid"ChoosingDrugs"0);
                return 
0;
            }
        }
        else
        {
             
SendClientMessageEx(playeridCOLOR_LIGHTRED,"What type of drugs would you like to smuggle? Type 'crack, pot or chemicals'.");
            return 
0;
        }
    } 
Errors.

Код:
C:\Users\randypisonet\Documents\New folder\gamemodes\rrphz.pwn(68362) : warning 225: unreachable code
C:\Users\randypisonet\Documents\New folder\gamemodes\rrphz.pwn(68362) : error 029: invalid expression, assumed zero
C:\Users\randypisonet\Documents\New folder\gamemodes\rrphz.pwn(68362) : warning 215: expression has no effect
C:\Users\randypisonet\Documents\New folder\gamemodes\rrphz.pwn(68362) : error 001: expected token: ";", but found "if"
I also tried to remove "if" but still have an error and unable to compile
Reply
#2

We don't know which lines are 68362.
Reply
#3

Quote:
Originally Posted by Rocket16
Посмотреть сообщение
We don't know which lines are 68362.
My bad, this was the line 68362.
PHP код:
else if(strcmp("chemicals"texttrue) == 0
Reply
#4

PHP код:
if(GetPVarInt(playerid"ChoosingDrugs") == 1
    { 
        if(
strcmp("pot"texttrue) == 0
        { 
            new 
mypoint = -1
            for (new 
i=0i<MAX_POINTSi++) 
            { 
                if(
IsPlayerInRangeOfPoint(playerid3.0Points[i][Pointx], Points[i][Pointy], Points[i][Pointz]) && strcmp(Points[i][Name], "Drug Factory"true) == 0
                { 
                    
mypoint i
                } 
            } 
            if(
mypoint == -1
            { 
                
SendClientMessage(playeridCOLOR_GREY"You're not at the Drug Factory!"); 
                return 
0
            } 
            if(
PlayerInfo[playerid][pCrates]) 
            { 
                
SendClientMessage(playeridCOLOR_GREY"   You can't hold any more Drug Crates!"); 
                
SetPVarInt(playerid"ChoosingDrugs"0); 
                return 
0
            } 
             if(
CheckPointCheck(playerid)) 
             { 
                  
SendClientMessage(playeridCOLOR_WHITE"Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint)."); 
                return 
0
              } 
            if(
GetPlayerCash(playerid) >= 100
            { 
                
SendClientMessage(playeridCOLOR_LIGHTBLUE,"* You bought some Drug Crates for $100."); 
                
GivePlayerCash(playerid, -100); 
                
PlayerInfo[playerid][pCrates] = 1
                
SetPVarInt(playerid"CrateDeliver"1); 
                
SetPVarInt(playerid"ChoosingDrugs"0); 
                
SetPVarInt(playerid"tpDrugRunTimer"25); 
                
SetTimerEx("OtherTimerEx"1000false"ii"playeridTYPE_TPDRUGRUNTIMER); 
                
SetPlayerCheckpoint(playerid2166.3772,-1675.3829,15.08593); 
                for(new 
0sizeof(FamilyInfo); i++) 
                { 
                    if(
strcmp(Points[mypoint][Owner], FamilyInfo[i][FamilyName], true) == 0
                    { 
                        
FamilyInfo[i][FamilyBank] += 500
                    } 
                } 
                return 
0
            } 
            else 
            { 
                
SendClientMessage(playeridCOLOR_GREY," You can't afford the $100!"); 
                
SetPVarInt(playerid"ChoosingDrugs"0); 
                return 
0
            } 
        } 
        else if(
strcmp("crack"texttrue) == 0
        { 
            new 
mypoint = -1
            for (new 
i=0i<MAX_POINTSi++) 
            { 
                if(
IsPlayerInRangeOfPoint(playerid3.0Points[i][Pointx], Points[i][Pointy], Points[i][Pointz]) && strcmp(Points[i][Name], "Drug Factory"true) == 0
                { 
                    
mypoint i
                } 
            } 
            if(
mypoint == -1
            { 
                
SendClientMessage(playeridCOLOR_GREY"You're not at the Drug Factory!"); 
                return 
0
            } 
            if(
PlayerInfo[playerid][pCrates]) 
            { 
                
SendClientMessage(playeridCOLOR_GREY"   You can't hold any more drug crates!"); 
                
SetPVarInt(playerid"ChoosingDrugs"0); 
                return 
0
            } 
             if(
CheckPointCheck(playerid)) 
             { 
                  
SendClientMessage(playeridCOLOR_WHITE"Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint)."); 
                return 
0
              } 
              if(
GetPlayerCash(playerid) >= 100
            { 
                
SendClientMessage(playeridCOLOR_LIGHTBLUE,"* You bought some drug crates for $100."); 
                
GivePlayerCash(playerid, -100); 
                
PlayerInfo[playerid][pCrates] = 1
                
SetPVarInt(playerid"CrateDeliver"2); 
                
SetPVarInt(playerid"ChoosingDrugs"0); 
                
SetPVarInt(playerid"tpDrugRunTimer"25); 
                
SetTimerEx("OtherTimerEx"1000false"ii"playeridTYPE_TPDRUGRUNTIMER); 
                
SetPlayerCheckpoint(playerid2354.2808,-1169.2959,28.00663); 
                for(new 
0sizeof(FamilyInfo); i++) 
                { 
                    if(
strcmp(Points[mypoint][Owner], FamilyInfo[i][FamilyName], true) == 0
                    { 
                        
FamilyInfo[i][FamilyBank] += 50
                    } 
                } 
                return 
0
            } 
            else 
            { 
                
SendClientMessage(playeridCOLOR_GREY," You can't afford the $100!"); 
                
SetPVarInt(playerid"ChoosingDrugs"0); 
                return 
0
            } 
        } 
        else if(
strcmp("chemicals"texttrue) == 0
        { 
            new 
mypoint = -1
            for (new 
i=0i<MAX_POINTSi++) 
            { 
                if(
IsPlayerInRangeOfPoint(playerid3.0Points[i][Pointx], Points[i][Pointy], Points[i][Pointz]) && strcmp(Points[i][Name], "Drug Factory"true) == 0
                { 
                    
mypoint i
                } 
            } 
            if(
mypoint == -1
            { 
                
SendClientMessage(playeridCOLOR_GREY"You're not at the Drug Factory!"); 
                return 
0
            } 
            if(
PlayerInfo[playerid][pCrates]) 
            { 
                
SendClientMessage(playeridCOLOR_GREY"   You can't hold any more drug crates!"); 
                
SetPVarInt(playerid"ChoosingDrugs"0); 
                return 
0
            } 
             if(
CheckPointCheck(playerid)) 
             { 
                  
SendClientMessage(playeridCOLOR_WHITE"Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint)."); 
                return 
0
              } 
              if(
GetPlayerCash(playerid) >= 100
            { 
                
SendClientMessage(playeridCOLOR_LIGHTBLUE,"* You bought some drug crates for $100."); 
                
GivePlayerCash(playerid, -100); 
                
PlayerInfo[playerid][pCrates] = 1
                
SetPVarInt(playerid"CrateDeliver"3); 
                
SetPVarInt(playerid"ChoosingDrugs"0); 
                
SetPVarInt(playerid"tpDrugRunTimer"25); 
                
SetTimerEx("OtherTimerEx"1000false"ii"playeridTYPE_TPDRUGRUNTIMER); 
                
SetPlayerCheckpoint(playerid2354.2808,-1169.2959,28.00663); 
                for(new 
0sizeof(FamilyInfo); i++) 
                { 
                    if(
strcmp(Points[mypoint][Owner], FamilyInfo[i][FamilyName], true) == 0
                    { 
                        
FamilyInfo[i][FamilyBank] += 50
                    } 
                } 
                return 
0
            } 
            else 
            { 
                
SendClientMessage(playeridCOLOR_GREY," You can't afford the $100!"); 
                
SetPVarInt(playerid"ChoosingDrugs"0); 
                return 
0
            } 
        } 
        else 
        { 
             
SendClientMessageEx(playeridCOLOR_LIGHTRED,"What type of drugs would you like to smuggle? Type 'crack, pot or chemicals'."); 
            return 
0
        } 
    } 
I saw the problem.
It was unreachable because it was behind an else which should have been the end of if else statements

PHP код:
else // This else
        

             
SendClientMessageEx(playeridCOLOR_LIGHTRED,"What type of drugs would you like to smuggle? Type 'crack, pot or chemicals'."); 
            return 
0
        } 
         
        else if(
strcmp("chemicals"texttrue) == 0
        { 
            new 
mypoint = -1
            for (new 
i=0i<MAX_POINTSi++) 
            { 
                if(
IsPlayerInRangeOfPoint(playerid3.0Points[i][Pointx], Points[i][Pointy], Points[i][Pointz]) && strcmp(Points[i][Name], "Drug Factory"true) == 0
                { 
                    
mypoint i
                } 
            } 
            if(
mypoint == -1
            { 
                
SendClientMessage(playeridCOLOR_GREY"You're not at the Drug Factory!"); 
                return 
0
            } 
            if(
PlayerInfo[playerid][pCrates]) 
            { 
                
SendClientMessage(playeridCOLOR_GREY"   You can't hold any more drug crates!"); 
                
SetPVarInt(playerid"ChoosingDrugs"0); 
                return 
0
            } 
             if(
CheckPointCheck(playerid)) 
             { 
                  
SendClientMessage(playeridCOLOR_WHITE"Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint)."); 
                return 
0
              } 
              if(
GetPlayerCash(playerid) >= 100
            { 
                
SendClientMessage(playeridCOLOR_LIGHTBLUE,"* You bought some drug crates for $100."); 
                
GivePlayerCash(playerid, -100); 
                
PlayerInfo[playerid][pCrates] = 1
                
SetPVarInt(playerid"CrateDeliver"3); 
                
SetPVarInt(playerid"ChoosingDrugs"0); 
                
SetPVarInt(playerid"tpDrugRunTimer"25); 
                
SetTimerEx("OtherTimerEx"1000false"ii"playeridTYPE_TPDRUGRUNTIMER); 
                
SetPlayerCheckpoint(playerid2354.2808,-1169.2959,28.00663); 
                for(new 
0sizeof(FamilyInfo); i++) 
                { 
                    if(
strcmp(Points[mypoint][Owner], FamilyInfo[i][FamilyName], true) == 0
                    { 
                        
FamilyInfo[i][FamilyBank] += 50
                    } 
                } 
                return 
0
            } 
            else 
            { 
                
SendClientMessage(playeridCOLOR_GREY," You can't afford the $100!"); 
                
SetPVarInt(playerid"ChoosingDrugs"0); 
                return 
0
            } 
        } 
        else 
        { 
             
SendClientMessageEx(playeridCOLOR_LIGHTRED,"What type of drugs would you like to smuggle? Type 'crack, pot or chemicals'."); 
            return 
0
        } 
The first snippet I passed is the corrected one although I am not sure if it does work since I didn't test it, I just exchanged it.
Reply
#5

Quote:
Originally Posted by JesterlJoker
Посмотреть сообщение
PHP код:
if(GetPVarInt(playerid"ChoosingDrugs") == 1
    { 
        if(
strcmp("pot"texttrue) == 0
        { 
            new 
mypoint = -1
            for (new 
i=0i<MAX_POINTSi++) 
            { 
                if(
IsPlayerInRangeOfPoint(playerid3.0Points[i][Pointx], Points[i][Pointy], Points[i][Pointz]) && strcmp(Points[i][Name], "Drug Factory"true) == 0
                { 
                    
mypoint i
                } 
            } 
            if(
mypoint == -1
            { 
                
SendClientMessage(playeridCOLOR_GREY"You're not at the Drug Factory!"); 
                return 
0
            } 
            if(
PlayerInfo[playerid][pCrates]) 
            { 
                
SendClientMessage(playeridCOLOR_GREY"   You can't hold any more Drug Crates!"); 
                
SetPVarInt(playerid"ChoosingDrugs"0); 
                return 
0
            } 
             if(
CheckPointCheck(playerid)) 
             { 
                  
SendClientMessage(playeridCOLOR_WHITE"Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint)."); 
                return 
0
              } 
            if(
GetPlayerCash(playerid) >= 100
            { 
                
SendClientMessage(playeridCOLOR_LIGHTBLUE,"* You bought some Drug Crates for $100."); 
                
GivePlayerCash(playerid, -100); 
                
PlayerInfo[playerid][pCrates] = 1
                
SetPVarInt(playerid"CrateDeliver"1); 
                
SetPVarInt(playerid"ChoosingDrugs"0); 
                
SetPVarInt(playerid"tpDrugRunTimer"25); 
                
SetTimerEx("OtherTimerEx"1000false"ii"playeridTYPE_TPDRUGRUNTIMER); 
                
SetPlayerCheckpoint(playerid2166.3772,-1675.3829,15.08593); 
                for(new 
0sizeof(FamilyInfo); i++) 
                { 
                    if(
strcmp(Points[mypoint][Owner], FamilyInfo[i][FamilyName], true) == 0
                    { 
                        
FamilyInfo[i][FamilyBank] += 500
                    } 
                } 
                return 
0
            } 
            else 
            { 
                
SendClientMessage(playeridCOLOR_GREY," You can't afford the $100!"); 
                
SetPVarInt(playerid"ChoosingDrugs"0); 
                return 
0
            } 
        } 
        else if(
strcmp("crack"texttrue) == 0
        { 
            new 
mypoint = -1
            for (new 
i=0i<MAX_POINTSi++) 
            { 
                if(
IsPlayerInRangeOfPoint(playerid3.0Points[i][Pointx], Points[i][Pointy], Points[i][Pointz]) && strcmp(Points[i][Name], "Drug Factory"true) == 0
                { 
                    
mypoint i
                } 
            } 
            if(
mypoint == -1
            { 
                
SendClientMessage(playeridCOLOR_GREY"You're not at the Drug Factory!"); 
                return 
0
            } 
            if(
PlayerInfo[playerid][pCrates]) 
            { 
                
SendClientMessage(playeridCOLOR_GREY"   You can't hold any more drug crates!"); 
                
SetPVarInt(playerid"ChoosingDrugs"0); 
                return 
0
            } 
             if(
CheckPointCheck(playerid)) 
             { 
                  
SendClientMessage(playeridCOLOR_WHITE"Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint)."); 
                return 
0
              } 
              if(
GetPlayerCash(playerid) >= 100
            { 
                
SendClientMessage(playeridCOLOR_LIGHTBLUE,"* You bought some drug crates for $100."); 
                
GivePlayerCash(playerid, -100); 
                
PlayerInfo[playerid][pCrates] = 1
                
SetPVarInt(playerid"CrateDeliver"2); 
                
SetPVarInt(playerid"ChoosingDrugs"0); 
                
SetPVarInt(playerid"tpDrugRunTimer"25); 
                
SetTimerEx("OtherTimerEx"1000false"ii"playeridTYPE_TPDRUGRUNTIMER); 
                
SetPlayerCheckpoint(playerid2354.2808,-1169.2959,28.00663); 
                for(new 
0sizeof(FamilyInfo); i++) 
                { 
                    if(
strcmp(Points[mypoint][Owner], FamilyInfo[i][FamilyName], true) == 0
                    { 
                        
FamilyInfo[i][FamilyBank] += 50
                    } 
                } 
                return 
0
            } 
            else 
            { 
                
SendClientMessage(playeridCOLOR_GREY," You can't afford the $100!"); 
                
SetPVarInt(playerid"ChoosingDrugs"0); 
                return 
0
            } 
        } 
        else if(
strcmp("chemicals"texttrue) == 0
        { 
            new 
mypoint = -1
            for (new 
i=0i<MAX_POINTSi++) 
            { 
                if(
IsPlayerInRangeOfPoint(playerid3.0Points[i][Pointx], Points[i][Pointy], Points[i][Pointz]) && strcmp(Points[i][Name], "Drug Factory"true) == 0
                { 
                    
mypoint i
                } 
            } 
            if(
mypoint == -1
            { 
                
SendClientMessage(playeridCOLOR_GREY"You're not at the Drug Factory!"); 
                return 
0
            } 
            if(
PlayerInfo[playerid][pCrates]) 
            { 
                
SendClientMessage(playeridCOLOR_GREY"   You can't hold any more drug crates!"); 
                
SetPVarInt(playerid"ChoosingDrugs"0); 
                return 
0
            } 
             if(
CheckPointCheck(playerid)) 
             { 
                  
SendClientMessage(playeridCOLOR_WHITE"Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint)."); 
                return 
0
              } 
              if(
GetPlayerCash(playerid) >= 100
            { 
                
SendClientMessage(playeridCOLOR_LIGHTBLUE,"* You bought some drug crates for $100."); 
                
GivePlayerCash(playerid, -100); 
                
PlayerInfo[playerid][pCrates] = 1
                
SetPVarInt(playerid"CrateDeliver"3); 
                
SetPVarInt(playerid"ChoosingDrugs"0); 
                
SetPVarInt(playerid"tpDrugRunTimer"25); 
                
SetTimerEx("OtherTimerEx"1000false"ii"playeridTYPE_TPDRUGRUNTIMER); 
                
SetPlayerCheckpoint(playerid2354.2808,-1169.2959,28.00663); 
                for(new 
0sizeof(FamilyInfo); i++) 
                { 
                    if(
strcmp(Points[mypoint][Owner], FamilyInfo[i][FamilyName], true) == 0
                    { 
                        
FamilyInfo[i][FamilyBank] += 50
                    } 
                } 
                return 
0
            } 
            else 
            { 
                
SendClientMessage(playeridCOLOR_GREY," You can't afford the $100!"); 
                
SetPVarInt(playerid"ChoosingDrugs"0); 
                return 
0
            } 
        } 
        else 
        { 
             
SendClientMessageEx(playeridCOLOR_LIGHTRED,"What type of drugs would you like to smuggle? Type 'crack, pot or chemicals'."); 
            return 
0
        } 
    } 
I saw the problem.
It was unreachable because it was behind an else which should have been the end of if else statements

PHP код:
else // This else
        

             
SendClientMessageEx(playeridCOLOR_LIGHTRED,"What type of drugs would you like to smuggle? Type 'crack, pot or chemicals'."); 
            return 
0
        } 
         
        else if(
strcmp("chemicals"texttrue) == 0
        { 
            new 
mypoint = -1
            for (new 
i=0i<MAX_POINTSi++) 
            { 
                if(
IsPlayerInRangeOfPoint(playerid3.0Points[i][Pointx], Points[i][Pointy], Points[i][Pointz]) && strcmp(Points[i][Name], "Drug Factory"true) == 0
                { 
                    
mypoint i
                } 
            } 
            if(
mypoint == -1
            { 
                
SendClientMessage(playeridCOLOR_GREY"You're not at the Drug Factory!"); 
                return 
0
            } 
            if(
PlayerInfo[playerid][pCrates]) 
            { 
                
SendClientMessage(playeridCOLOR_GREY"   You can't hold any more drug crates!"); 
                
SetPVarInt(playerid"ChoosingDrugs"0); 
                return 
0
            } 
             if(
CheckPointCheck(playerid)) 
             { 
                  
SendClientMessage(playeridCOLOR_WHITE"Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint)."); 
                return 
0
              } 
              if(
GetPlayerCash(playerid) >= 100
            { 
                
SendClientMessage(playeridCOLOR_LIGHTBLUE,"* You bought some drug crates for $100."); 
                
GivePlayerCash(playerid, -100); 
                
PlayerInfo[playerid][pCrates] = 1
                
SetPVarInt(playerid"CrateDeliver"3); 
                
SetPVarInt(playerid"ChoosingDrugs"0); 
                
SetPVarInt(playerid"tpDrugRunTimer"25); 
                
SetTimerEx("OtherTimerEx"1000false"ii"playeridTYPE_TPDRUGRUNTIMER); 
                
SetPlayerCheckpoint(playerid2354.2808,-1169.2959,28.00663); 
                for(new 
0sizeof(FamilyInfo); i++) 
                { 
                    if(
strcmp(Points[mypoint][Owner], FamilyInfo[i][FamilyName], true) == 0
                    { 
                        
FamilyInfo[i][FamilyBank] += 50
                    } 
                } 
                return 
0
            } 
            else 
            { 
                
SendClientMessage(playeridCOLOR_GREY," You can't afford the $100!"); 
                
SetPVarInt(playerid"ChoosingDrugs"0); 
                return 
0
            } 
        } 
        else 
        { 
             
SendClientMessageEx(playeridCOLOR_LIGHTRED,"What type of drugs would you like to smuggle? Type 'crack, pot or chemicals'."); 
            return 
0
        } 
The first snippet I passed is the corrected one although I am not sure if it does work since I didn't test it, I just exchanged it.
Many many errors appear bruvv...
Reply
#6

What type of errors?

I am also assuming that this is inside OnPlayerText...
Reply
#7

Quote:
Originally Posted by JesterlJoker
Посмотреть сообщение
What type of errors?

I am also assuming that this is inside OnPlayerText...
Indeed, it's inside OnPlayerText bruv...
i removed this line

PHP код:
        else
        {
              
SendClientMessageEx(playeridCOLOR_LIGHTRED,"What type of drugs would you like to smuggle? Type 'crack, pot or chemicals'.");
            return 
0;
        } 
Will this line affect the third option or no?
Reply
#8

Yes it will remove that question of which drug would you like that won't show it. Which fails the sense of it.
Reply
#9

Quote:
Originally Posted by JesterlJoker
Посмотреть сообщение
Yes it will remove that question of which drug would you like that won't show it. Which fails the sense of it.
But even if without that message, the 3rd option will still works right?
Reply
#10

It will work yes, but like I said, it won't show the "which drug message". It should show that or you could just add a textdraw on top of the icon of which they should be able to choose from.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)