Help[rep]
#1

this cmd is for jobs in dialog list..it says pawno not responding what might be problem??
[REP]


PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
switch(
dialogid)
                        {
                        case 
9035:
                        {
                        switch(
listitem)
                        {
                        case 
0:
                        {
                        for(new 
0i<MAX_PLAYERSi++)
                        {
                        
SendClientMessage(playerid0x83FF46FF".: [Bravo]: Ai luat jobul Detective :.");
                        
PlayerPlaySound(playerid10560.00.00.0);
                        
PlayerInfo[playerid][pJob] = 1;
                        
PlayerInfo[playerid][pContractTime] = 5;
                        }
                        }
                        return 
1;
                        }
                        case 
1:
                        {
                        for(new 
0i<MAX_PLAYERSi++)
                        {
                        
SendClientMessage(playerid(i0x83FF46FF".: [Bravo]: Ai luat jobul Lawyer :.");
                        
PlayerPlaySound(playerid10560.00.00.0);
                        
PlayerInfo[playerid][pJob] = 2;
                        
PlayerInfo[playerid][pContractTime] = 5;
                        }
                        }
                        return 
1;
                        }
                        case 
2:
                        {
                        for(new 
0i<MAX_PLAYERSi++)
                        {
                        
SendClientMessage(playerid(i0x83FF46FF".: [Bravo]: Ai luat jobul Bodyguard :.");
                        
PlayerPlaySound(playerid10560.00.00.0);
                        
PlayerInfo[playerid][pJob] = 8;
                        
PlayerInfo[playerid][pContractTime] = 5;
                        }
                        }
                        return 
1;
                        }
                        case 
3:
                        {
                        for(new 
0i<MAX_PLAYERSi++)
                        {
                        
SendClientMessage(playerid(i0x83FF46FF".: [Bravo]: Ai luat jobul Bus Driver :.");
                        
PlayerPlaySound(playerid10560.00.00.0);
                        
PlayerInfo[playerid][pJob] = 14;
                        
PlayerInfo[playerid][pContractTime] = 5;
                        }
                        }
                        return 
1;
                        }
                        case 
4:
                        {
                        for(new 
0i<MAX_PLAYERSi++)
                        {
                        
SendClientMessage(playerid(i0x83FF46FF".: [Bravo]: Ai luat jobul Boxer :.");
                        
PlayerPlaySound(playerid10560.00.00.0);
                        
PlayerInfo[playerid][pJob] = 12;
                        
PlayerInfo[playerid][pContractTime] = 5;
                        }
                        }
                        return 
1;
                        }
                        case 
5:
                        {
                        if (
GetPlayerState(playerid) == 1)
                        {
                        for(new 
0i<MAX_PLAYERSi++)
                        {
                        
SendClientMessage(playerid(i0x83FF46FF".: [Bravo]: Ai luat jobul Maturator :.");
                        
PlayerPlaySound(playerid10560.00.00.0);
                        
PlayerInfo[playerid][pJob] = 18;
                        
PlayerInfo[playerid][pContractTime] = 5;
                        }
                        }
                        return 
1;
                        }
                        case 
6:
                        {
                        if (
GetPlayerState(playerid) == 1)
                        {
                        for(new 
0i<MAX_PLAYERSi++)
                        {
                        
SendClientMessage(playerid(i0x83FF46FF".: [Bravo]: Ai luat jobul Car Dealer :.");
                        
PlayerPlaySound(playerid10560.00.00.0);
                        
PlayerInfo[playerid][pJob] = 10;
                        
PlayerInfo[playerid][pContractTime] = 5;
                        }
                        }
                        return 
1;
                        }
                        case 
7:
                        {
                        for(new 
0i<MAX_PLAYERSi++)
                        {
                        
SendClientMessage(playerid(i0x83FF46FF".: [Bravo]: Ai luat jobul Paper Boy :.");
                        
PlayerPlaySound(playerid10560.00.00.0);
                        
PlayerInfo[playerid][pJob] = 15;
                        
PlayerInfo[playerid][pContractTime] = 5;
                        }
                        }
                        return 
1;
                        }
                        case 
8:
                        {
                        for(new 
0i<MAX_PLAYERSi++)
                        {
                        
SendClientMessage(playerid(i0x83FF46FF".: [Bravo]: Ai luat jobul Farmer :.");
                        
PlayerPlaySound(playerid10560.00.00.0);
                        
PlayerInfo[playerid][pJob] = 17;
                        
PlayerInfo[playerid][pContractTime] = 5;
                        }
                        }
                        return 
1;
                        }
                        case 
9:
                        {
                        for(new 
0i<MAX_PLAYERSi++)
                        {
                        
SendClientMessage(playerid(i0x83FF46FF".: [Bravo]: Ai luat jobul Trucker :.");
                        
PlayerPlaySound(playerid10560.00.00.0);
                        
PlayerInfo[playerid][pJob] = 16;
                        
PlayerInfo[playerid][pContractTime] = 5;
                        }
                        }
                        return 
1;
                        }
                        case 
10:
                        {
                        for(new 
0i<MAX_PLAYERSi++)
                        {
                        
SendClientMessage(playerid(i0x83FF46FF".: [Bravo]: Ai luat jobul Garbage Collector :.");
                        
PlayerPlaySound(playerid10560.00.00.0);
                        
PlayerInfo[playerid][pJob] = 19;
                        
PlayerInfo[playerid][pContractTime] = 5;
                        }
                        }
                        return 
1;
                        }
                        }
                        }
                        }
                        }
                        return 
1;
                        } 
Edit:i moved it somewhere else ondialogResponse and it gave me 26 errors that have nothing..
Reply
#2

PHP код:
all 26 errors are:
error 010invalid function or declaration 
Reply
#3

anyone help??
Reply
#4

God, fix the indentation first! No one's gonna bother figuring out which bracket should be in which spot.
Reply
#5

This post can be removed, seems like it didnt work
Reply
#6

Quote:
Originally Posted by GNGification
Посмотреть сообщение
Try this or wait fixing it first xD
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	switch(dialogid)
	{
 		case 9035:
   		{
     		switch(listitem)
       		{
         	case 0:
          	{
       			for(new i = 0; i<MAX_PLAYERS; i++)
         		{
	         	SendClientMessage(playerid, 0x83FF46FF, ".: [Bravo]: Ai luat jobul Detective :.");
	          	PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	           	PlayerInfo[playerid][pJob] = 1;
	           	PlayerInfo[playerid][pContractTime] = 5;
            	}
            }
            return 1;
            }
            case 1:
            {
	            for(new i = 0; i<MAX_PLAYERS; i++)
	            {
	            SendClientMessage(playerid(i, 0x83FF46FF, ".: [Bravo]: Ai luat jobul Lawyer :.");
	            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	            PlayerInfo[playerid][pJob] = 2;
	            PlayerInfo[playerid][pContractTime] = 5;
            	}
            }
            return 1;
            }
            case 2:
            {
	            for(new i = 0; i<MAX_PLAYERS; i++)
	            {
	            SendClientMessage(playerid(i, 0x83FF46FF, ".: [Bravo]: Ai luat jobul Bodyguard :.");
	            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	            PlayerInfo[playerid][pJob] = 8;
	            PlayerInfo[playerid][pContractTime] = 5;
            	}
            }
            return 1;
            }
            case 3:
            {
	            for(new i = 0; i<MAX_PLAYERS; i++)
	            {
	            SendClientMessage(playerid(i, 0x83FF46FF, ".: [Bravo]: Ai luat jobul Bus Driver :.");
	            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	            PlayerInfo[playerid][pJob] = 14;
	            PlayerInfo[playerid][pContractTime] = 5;
            	}
            }
            return 1;
            }
            case 4:
            {
	            for(new i = 0; i<MAX_PLAYERS; i++)
	            {
	            SendClientMessage(playerid(i, 0x83FF46FF, ".: [Bravo]: Ai luat jobul Boxer :.");
	            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	            PlayerInfo[playerid][pJob] = 12;
	            PlayerInfo[playerid][pContractTime] = 5;
            	}
            }
            return 1;
            }
            case 5:
            {
            if (GetPlayerState(playerid) == 1)
            {
	            for(new i = 0; i<MAX_PLAYERS; i++)
	            {
	            SendClientMessage(playerid(i, 0x83FF46FF, ".: [Bravo]: Ai luat jobul Maturator :.");
	            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	            PlayerInfo[playerid][pJob] = 18;
	            PlayerInfo[playerid][pContractTime] = 5;
            	}
            }
            return 1;
            }
            case 6:
            {
            if (GetPlayerState(playerid) == 1)
            {
	            for(new i = 0; i<MAX_PLAYERS; i++)
	            {
	            SendClientMessage(playerid(i, 0x83FF46FF, ".: [Bravo]: Ai luat jobul Car Dealer :.");
	            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	            PlayerInfo[playerid][pJob] = 10;
	            PlayerInfo[playerid][pContractTime] = 5;
            	}
            }
            return 1;
            }
            case 7:
            {
	            for(new i = 0; i<MAX_PLAYERS; i++)
	            {
	            SendClientMessage(playerid(i, 0x83FF46FF, ".: [Bravo]: Ai luat jobul Paper Boy :.");
	            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	            PlayerInfo[playerid][pJob] = 15;
	            PlayerInfo[playerid][pContractTime] = 5;
            	}
            }
            return 1;
            }
            case 8:
            {
	            for(new i = 0; i<MAX_PLAYERS; i++)
	            {
	            SendClientMessage(playerid(i, 0x83FF46FF, ".: [Bravo]: Ai luat jobul Farmer :.");
	            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	            PlayerInfo[playerid][pJob] = 17;
	            PlayerInfo[playerid][pContractTime] = 5;
            	}
            }
            return 1;
            }
            case 9:
            {
	            for(new i = 0; i<MAX_PLAYERS; i++)
	            {
	            SendClientMessage(playerid(i, 0x83FF46FF, ".: [Bravo]: Ai luat jobul Trucker :.");
	            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	            PlayerInfo[playerid][pJob] = 16;
	            PlayerInfo[playerid][pContractTime] = 5;
           		}
            }
            return 1;
            }
            case 10:
            {
	            for(new i = 0; i<MAX_PLAYERS; i++)
	            {
	            SendClientMessage(playerid(i, 0x83FF46FF, ".: [Bravo]: Ai luat jobul Garbage Collector :.");
	            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	            PlayerInfo[playerid][pJob] = 19;
	            PlayerInfo[playerid][pContractTime] = 5;
				}
            }
            return 1;
     	}
	}
	return 0;
}
why is it same??:O:O (
Reply
#7

BTW I FIXED MY ORIGINAL POST but that [code]seems to fuck it up D: try to learn from that anyway
Just as a notice for you.

See indentantions,

like this is wrong

Код:
If(GetPlayerScore == 300)
{
SendClientMessage(playerid, COLOR_RED,"You're poor");
and this is right
Код:
If(GetPlayerScore == 300)
{
       SendClientMessage(playerid, COLOR_RED,"You're poor");
Reply
#8

Quote:
Originally Posted by Dan_Barocu
Посмотреть сообщение
PHP код:
all 26 errors are:
error 010invalid function or declaration 
theres a bracket..siting how it sohludent be.. geting 26 errors that have no sense with this..
Reply
#9

Would be nice if it was just one bracket, the code is completely messed. See the beginning of it with cleaned indentation and you should see the problem:

pawn Код:
switch(dialogid)
{
    case 9035:
    {
        switch(listitem)
        {
            case 0:
            {
                for(new i = 0; i<MAX_PLAYERS; i++)
                {
                    SendClientMessage(playerid, 0x83FF46FF, ".: [Bravo]: Ai luat jobul Detective :.");
                    PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
                    PlayerInfo[playerid][pJob] = 1;
                    PlayerInfo[playerid][pContractTime] = 5;
                }
            }
            return 1;
        }
        case 1:
        {
            for(new i = 0; i<MAX_PLAYERS; i++)
            {
                SendClientMessage(playerid(i, 0x83FF46FF, ".: [Bravo]: Ai luat jobul Lawyer :.");
                PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
                PlayerInfo[playerid][pJob] = 2;
                PlayerInfo[playerid][pContractTime] = 5;
            }
        }
        return 1;
    }
   
    case 2:
The returns are misplaced, and theres an extra bracket after every single case that messes the whole switch statement. Move all return 1; inside the case block, and remove the unneccesary } after every case.
Reply
#10

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
Would be nice if it was just one bracket, the code is completely messed. See the beginning of it with cleaned indentation and you should see the problem:

pawn Код:
switch(dialogid)
{
    case 9035:
    {
        switch(listitem)
        {
            case 0:
            {
                for(new i = 0; i<MAX_PLAYERS; i++)
                {
                    SendClientMessage(playerid, 0x83FF46FF, ".: [Bravo]: Ai luat jobul Detective :.");
                    PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
                    PlayerInfo[playerid][pJob] = 1;
                    PlayerInfo[playerid][pContractTime] = 5;
                }
            }
            return 1;
        }
        case 1:
        {
            for(new i = 0; i<MAX_PLAYERS; i++)
            {
                SendClientMessage(playerid(i, 0x83FF46FF, ".: [Bravo]: Ai luat jobul Lawyer :.");
                PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
                PlayerInfo[playerid][pJob] = 2;
                PlayerInfo[playerid][pContractTime] = 5;
            }
        }
        return 1;
    }
   
    case 2:
The returns are misplaced, and theres an extra bracket after every single case that messes the whole switch statement. Move all return 1; inside the case block, and remove the unneccesary } after every case.
are this from above exemple how i should do??
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)