Problem with CMD
#1

Hello, I'm trying to fix my /join CMD that you need to be at the right actor type but it isn't working I need some help


PHP код:
CMD:join(playeridparams[])
{
        if(
IsPlayerInAnyVehicle(playerid)) return SendClientMessageEx(playeridCOLOR_GRAD1"You cannot do this while being inside a vehicle.");
        if(
GetPlayerState(playerid) == && PlayerInfo[playerid][pJob] == || PlayerInfo[playerid][pJob2] == 0) {
[
COLOR="GREEN"]>>>>[/COLOR]        for(new iMAX_DYNAMIC_ACTORSi++)
          {
                      new 
Floati_Pos[3];
                      
GetActorPos(ActorInfo[i][a_Actor], i_Pos[0], i_Pos[1], i_Pos[2]);
                    if(
IsPlayerInRangeOfPoint(playerid3.0i_Pos[0], i_Pos[1], i_Pos[2]))
                    {
               if(
ActorInfo[i][a_Type] == 4)
               {
                    if(
PlayerInfo[playerid][pJob] == 0){
                    
SendClientMessageEx(playeridCOLOR_LIGHTBLUE"* If you are sure to become a ATM Driver, type /accept job.");
                    
GettingJob[playerid] = 22;
                    return 
1;
                    }
                    if((
PlayerInfo[playerid][pVIP] > || PlayerInfo[playerid][pVIPS] > 0) && PlayerInfo[playerid][pJob2] == 0) {
                        
SendClientMessageEx(playeridCOLOR_LIGHTBLUE"* If you are sure to become a ATM Driver, type /accept job.");
                        
SendClientMessageEx(playeridCOLOR_YELLOW"You are getting a secondary job. Only Donator can do this.");
                        
GettingJob2[playerid] = 22;
                        return 
1;
                        }
                    }
                }
            }
[
COLOR="Red"]>>>>[/COLOR]            for(new iMAX_DYNAMIC_ACTORSi++)
            {
            new 
Floati_Pos[3];
            
GetActorPos(ActorInfo[i][a_Actor], i_Pos[0], i_Pos[1], i_Pos[2]);
            if(
IsPlayerInRangeOfPoint(playerid3.0i_Pos[0], i_Pos[1], i_Pos[2]))
            {
            if(
ActorInfo[i][a_Type] == 5)
            {
                    if(
PlayerInfo[playerid][pJob] == 0){
                    
SendClientMessageEx(playeridCOLOR_LIGHTBLUE"* If you are sure to become a bodyguard, type /accept job.");
                    
GettingJob[playerid] = 8;
                    return 
1;
                    }
                    if((
PlayerInfo[playerid][pVIP] > || PlayerInfo[playerid][pVIPS] > 0) && PlayerInfo[playerid][pJob2] == 0) {
                        
SendClientMessageEx(playeridCOLOR_LIGHTBLUE"* If you are sure to become a bodyguard, type /accept job.");
                        
SendClientMessageEx(playeridCOLOR_YELLOW"You are getting a secondary job. Only Donator can do this.");
                        
GettingJob2[playerid] = 8;
                        return 
1;
                        }
                    }
                }
            }
[
COLOR="Red"]>>>>[/COLOR]            for(new iMAX_DYNAMIC_ACTORSi++)
            {
              new 
Floati_Pos[3];
            
GetActorPos(ActorInfo[i][a_Actor], i_Pos[0], i_Pos[1], i_Pos[2]);
            if(
IsPlayerInRangeOfPoint(playerid3.0i_Pos[0], i_Pos[1], i_Pos[2]))
            {
            if(
ActorInfo[i][a_Type] == 6)
            {
                    if(
PlayerInfo[playerid][pJob] == 0){
                    
SendClientMessageEx(playeridCOLOR_LIGHTBLUE"* If you are sure to become a detective, type /accept job.");
                    
GettingJob[playerid] = 1;
                    return 
1;
                    }
                    if((
PlayerInfo[playerid][pVIP] > || PlayerInfo[playerid][pVIPS] > 0) && PlayerInfo[playerid][pJob2] == 0) {
                        
SendClientMessageEx(playeridCOLOR_LIGHTBLUE"* If you are sure to become a detective, type /accept job.");
                        
SendClientMessageEx(playeridCOLOR_YELLOW"You are getting a secondary job. Only Donator can do this.");
                        
GettingJob2[playerid] = 1;
                        return 
1;
                        }
                    }
                }
            }
[
COLOR="Red"]>>>>[/COLOR]            for(new iMAX_DYNAMIC_ACTORSi++)
            {
            new 
Floati_Pos[3];
            
GetActorPos(ActorInfo[i][a_Actor], i_Pos[0], i_Pos[1], i_Pos[2]);
             if(
IsPlayerInRangeOfPoint(playerid3.0i_Pos[0], i_Pos[1], i_Pos[2]))
            {
            if(
ActorInfo[i][a_Type] == 7)
            {
                    if(
PlayerInfo[playerid][pJob] == 0){
                    
SendClientMessageEx(playeridCOLOR_LIGHTBLUE"* If you are sure to become a lawyer, type /accept job.");
                    
GettingJob[playerid] = 2;
                    return 
1;
                    }
                    if((
PlayerInfo[playerid][pVIP] > || PlayerInfo[playerid][pVIPS] > 0) && PlayerInfo[playerid][pJob2] == 0) {
                        
SendClientMessageEx(playeridCOLOR_LIGHTBLUE"* If you are sure to become a lawyer, type /accept job.");
                        
SendClientMessageEx(playeridCOLOR_YELLOW"You are getting a secondary job. Only Donator can do this.");
                        
GettingJob2[playerid] = 2;
                        return 
1;
                        }
                    }
                }
            }
            if (
IsPlayerInRangeOfPoint(playerid,3.0,1215.1304,-11.8431,1000.9219)) {
                if(
PlayerInfo[playerid][pJob] == 0){
                    
SendClientMessageEx(playeridCOLOR_LIGHTBLUE"* If you are sure to become a Whore, type /accept job.");
                    
GettingJob[playerid] = 3;
                    return 
1;
                }
                if((
PlayerInfo[playerid][pVIP] > || PlayerInfo[playerid][pVIPS] > 0) && PlayerInfo[playerid][pJob2] == 0) {
                    
SendClientMessageEx(playeridCOLOR_LIGHTBLUE"* If you are sure to become a Whore, type /accept job.");
                    
SendClientMessageEx(playeridCOLOR_YELLOW"You are getting a secondary job. Only Donator can do this.");
                    
GettingJob2[playerid] = 3;
                    return 
1;
                }
            } 
PHP код:
Script.pwn(12775) : warning 217loose indentation
Script
.pwn(12854) : warning 217loose indentation
Script
.pwn(13020) : warning 217loose indentation
Script
.pwn(13029) : warning 217loose indentation
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase
4 Warnings

Is there any wait to fix this how can I add simple new lines with other jobs
Reply
#2

Anyone ? what is the best way to create this because I feel that I have done something wrong..
Reply
#3

This is wrong

Код:
if(PlayerInfo[playerid][pJob] == 0){
 
return 1;
}
This is Correct

Код:
if(PlayerInfo[playerid][pJob] == 0)
{
 
return 1;
}
Try to Fix { } they will be Fixed easily.
Reply
#4

Quote:
Originally Posted by MBilal
Посмотреть сообщение
This is wrong

Код:
if(PlayerInfo[playerid][pJob] == 0){
 
return 1;
}
This is Correct

if(PlayerInfo[playerid][pJob] == 0)
{

return 1;
}


Try to Fix { } they will be Fixed easily.
This is complete bullsh!t.

Код:
if(PlayerInfo[playerid][pJob] == 0) {
	return 1;
}
That code is totally correct, will compile totally fine and will work totally fine.

@Sacrifice, can you please point out the lines that you are showing, so we know which are triggering the warnings? Besides that, includes are there for a reason, grouping your code in several includes is more efficient than having over 10k lines in one file.
Reply
#5

what is the problem? @MBilal he said its not working so it wont be that warnings due to indentation problems
Reply
#6

Quote:
Originally Posted by JasperM
Посмотреть сообщение
This is complete bullsh!t.

Код:
if(PlayerInfo[playerid][pJob] == 0) {
	return 1;
}
That code is totally correct, will compile totally fine and will work totally fine.

@Sacrifice, can you please point out the lines that you are showing, so we know which are triggering the warnings? Besides that, includes are there for a reason, grouping your code in several includes is more efficient than having over 10k lines in one file.
Updated red are warnings and green is good
Reply
#7

Quote:
Originally Posted by SacrificeGaming
Посмотреть сообщение
Updated red are warnings and green is good
so the cmd is working and it is just showing indentation warning?
Reply
#8

Should be obvious now. Remove the tabs infront of the "for" so it lines up with the braces. Remember it's just a warning, no error.
Reply
#9

Quote:
Originally Posted by JasperM
Посмотреть сообщение
This is complete bullsh!t.

Код:
if(PlayerInfo[playerid][pJob] == 0) {
	return 1;
}
That code is totally correct, will compile totally fine and will work totally fine.

@Sacrifice, can you please point out the lines that you are showing, so we know which are triggering the warnings? Besides that, includes are there for a reason, grouping your code in several includes is more efficient than having over 10k lines in one file.
Dude Kindly read what he posted.

Look what he posted in First post

Код:
Script.pwn(12775) : warning 217: loose indentation 
Script.pwn(12854) : warning 217: loose indentation 
Script.pwn(13020) : warning 217: loose indentation 
Script.pwn(13029) : warning 217: loose indentation 
Pawn compiler 3.2.3664              Copyright © 1997-2006, ITB CompuPhase 


4 Warnings.
I'm just telling him the way to fix Lose indentation read before post anything THANKS
Reply
#10

Quote:
Originally Posted by MBilal
Посмотреть сообщение
Dude Kindly read what he posted.

I'm just telling him the way to fix Lose indecation read before post anything THANKS
That wont fix indentation and jasper is right that was bullshit
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)