Small Problem -
Dan_Barocu - 11.06.2012
i made a thngy for dialog and it gives me a pawno stops responding look.
pawn Код:
if(dialogid==Dialog_Test)
{
if(response)//daca apasa primul buton
{
if(listitem==0)//Ajutor
{
if (GetPlayerState(playerid) == 1)
{
SendClientMessage(playerid, 0x83FF46FF, "::: Ai luat Jobul Detective :::");
PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pJob] = 1;
PlayerInfo[playerid][pContractTime] = 5;
}
}
if(listitem==1)//Teleporturi
{
if(strcmp(x_nr,"Detective",true) == 0)
{
if (GetPlayerState(playerid) == 1)
{
SendClientMessage(playerid, 0x83FF46FF, "::: Ai luat Jobul Detective :::");
PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pJob] = 1;
PlayerInfo[playerid][pContractTime] = 5;
}
}
if(listitem==2)
{
if (GetPlayerState(playerid) == 1)
{
SendClientMessage(playerid, 0x83FF46FF, "::: Ai luat jobul Lawyer :::");
PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pJob] = 2;
PlayerInfo[playerid][pContractTime] = 5;
}
}
if(listitem==3)
{
if (GetPlayerState(playerid) == 1)
{
SendClientMessage(playerid, 0x83FF46FF, "::: Ai luat jobul Bodyguard :::");
PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pJob] = 8;
PlayerInfo[playerid][pContractTime] = 5;
}
}
if(listitem==4)
{
if (GetPlayerState(playerid) == 1)
{
SendClientMessage(playerid, 0x83FF46FF, "::: Ai luat jobul Bus Driver :::");
PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pJob] = 14;
PlayerInfo[playerid][pContractTime] = 5;
CP[playerid] = 1000;
SetPlayerCheckpoint(playerid, 1792.6107,-1915.7822,13.3946, 3.0);
}
}
if(listitem==5)
{
if (GetPlayerState(playerid) == 1)
{
SendClientMessage(playerid, 0x83FF46FF, "::: Ai luat jobul Boxer :::");
PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pJob] = 12;
PlayerInfo[playerid][pContractTime] = 5;
}
}
if(listitem==6)
{
if (GetPlayerState(playerid) == 1)
{
SendClientMessage(playerid, 0x83FF46FF, "::: Ai luat jobul Sweeper :::");
PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pJob] = 18;
PlayerInfo[playerid][pContractTime] = 5;
CP[playerid] = 1002;
SetPlayerCheckpoint(playerid, 1102.3403,-1232.5560,15.8203, 3.0);
}
}
if(listitem==7)
{
if (GetPlayerState(playerid) == 1)
{
SendClientMessage(playerid, 0x83FF46FF, "::: Ai luat jobul Car Dealer :::");
PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pJob] = 10;
PlayerInfo[playerid][pContractTime] = 5;
}
}
if(listitem==8)
{
if (GetPlayerState(playerid) == 1)
{
SendClientMessage(playerid, 0x83FF46FF, "::: Ai luat jobul Paper Boy :::");
PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pJob] = 15;
PlayerInfo[playerid][pContractTime] = 5;
}
}
if(listitem==9)
{
if (GetPlayerState(playerid) == 1)
{
SendClientMessage(playerid, 0x83FF46FF, "::: Ai luat jobul Farmer :::");
PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pJob] = 11;
PlayerInfo[playerid][pContractTime] = 5;
CP[playerid] = 1004;
SetPlayerCheckpoint(playerid, -109.1764,32.7763,3.1094, 3.0);
}
}
if(listitem==10)
{
if (GetPlayerState(playerid) == 1)
{
SendClientMessage(playerid, 0x83FF46FF, "::: Ai luat jobul Trucker :::");
PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pJob] = 16;
PlayerInfo[playerid][pContractTime] = 5;
CP[playerid] = 1003;
SetPlayerCheckpoint(playerid, 81.4055,-1126.1174,0.6408, 3.0);
}
}
if(listitem==11)
{
if (GetPlayerState(playerid) == 1)
{
SendClientMessage(playerid, 0x83FF46FF, "::: 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 1;
}
or its here?
pawn Код:
if(strcmp(cmd,"/takejob",true)==0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(25.0,playerid,1236.1875,-2517.4473,253.4778))
{
ShowPlayerDialog(playerid,Dialog_Test,DIALOG_STYLE_LIST,"Bar","Detective\nLawyer\nBodyguard\nFarmer","Selecteaza","Inchide");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not in the JP !");
return 1;
}
}//not connected
return 1;
}
Re: Small Problem -
FalconX - 11.06.2012
See my indentation and yours. Believe or not your problems can be fixed very easily if you learn how to indent your code :/
pawn Код:
if( dialogid == Dialog_Test )
{
if( response )//daca apasa primul buton
{
if( listitem == 0 )//Ajutor
{
if ( GetPlayerState( playerid ) == 1 )
{
SendClientMessage( playerid, 0x83FF46FF, "::: Ai luat Jobul Detective :::" );
PlayerPlaySound( playerid, 1056, 0.0, 0.0, 0.0 );
PlayerInfo[playerid ][ pJob ] = 1;
PlayerInfo[ playerid ][ pContractTime ] = 5;
}
}
if( listitem == 1 )//Teleporturi
{
if( strcmp( x_nr,"Detective",true ) == 0 )
{
if( GetPlayerState( playerid ) == 1 )
{
SendClientMessage( playerid, 0x83FF46FF, "::: Ai luat Jobul Detective :::" );
PlayerPlaySound( playerid, 1056, 0.0, 0.0, 0.0 );
PlayerInfo[ playerid ] [pJob ] = 1;
PlayerInfo[ playerid ][ pContractTime ] = 5;
}
}
if( listitem == 2 )
{
if ( GetPlayerState( playerid ) == 1 )
{
SendClientMessage(playerid, 0x83FF46FF, "::: Ai luat jobul Lawyer :::");
PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pJob] = 2;
PlayerInfo[playerid][pContractTime] = 5;
}
}
if( listitem == 3 )
{
if( GetPlayerState( playerid ) == 1 )
{
SendClientMessage( playerid, 0x83FF46FF, "::: Ai luat jobul Bodyguard :::" );
PlayerPlaySound( playerid, 1056, 0.0, 0.0, 0.0 );
PlayerInfo[ playerid ][ pJob] = 8;
PlayerInfo[ playerid ][ pContractTime ] = 5;
}
}
if( listitem == 4 )
{
if( GetPlayerState( playerid ) == 1 )
{
SendClientMessage( playerid, 0x83FF46FF, "::: Ai luat jobul Bus Driver :::" );
PlayerPlaySound( playerid, 1056, 0.0, 0.0, 0.0 );
PlayerInfo[ playerid ][ pJob ] = 14;
PlayerInfo[ playerid][ pContractTime ] = 5;
CP[ playerid ] = 1000;
SetPlayerCheckpoint( playerid, 1792.6107,-1915.7822,13.3946, 3.0 );
}
}
if( listitem == 5 )
{
if( GetPlayerState( playerid ) == 1 )
{
SendClientMessage( playerid, 0x83FF46FF, "::: Ai luat jobul Boxer :::" );
PlayerPlaySound( playerid, 1056, 0.0, 0.0, 0.0 );
PlayerInfo[ playerid ][ pJob] = 12;
PlayerInfo[ playerid ][ pContractTime ] = 5;
}
}
if(listitem==6)
{
if (GetPlayerState(playerid) == 1)
{
SendClientMessage(playerid, 0x83FF46FF, "::: Ai luat jobul Sweeper :::");
PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pJob] = 18;
PlayerInfo[playerid][pContractTime] = 5;
CP[playerid] = 1002;
SetPlayerCheckpoint(playerid, 1102.3403,-1232.5560,15.8203, 3.0);
}
}
if(listitem==7)
{
if (GetPlayerState(playerid) == 1)
{
SendClientMessage(playerid, 0x83FF46FF, "::: Ai luat jobul Car Dealer :::");
PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pJob] = 10;
PlayerInfo[playerid][pContractTime] = 5;
}
}
if(listitem==8)
{
if (GetPlayerState(playerid) == 1)
{
SendClientMessage(playerid, 0x83FF46FF, "::: Ai luat jobul Paper Boy :::");
PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pJob] = 15;
PlayerInfo[playerid][pContractTime] = 5;
}
}
if(listitem==9)
{
if (GetPlayerState(playerid) == 1)
{
SendClientMessage(playerid, 0x83FF46FF, "::: Ai luat jobul Farmer :::");
PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pJob] = 11;
PlayerInfo[playerid][pContractTime] = 5;
CP[playerid] = 1004;
SetPlayerCheckpoint(playerid, -109.1764,32.7763,3.1094, 3.0);
}
}
if(listitem==10)
{
if (GetPlayerState(playerid) == 1)
{
SendClientMessage(playerid, 0x83FF46FF, "::: Ai luat jobul Trucker :::");
PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pJob] = 16;
PlayerInfo[playerid][pContractTime] = 5;
CP[playerid] = 1003;
SetPlayerCheckpoint(playerid, 81.4055,-1126.1174,0.6408, 3.0);
}
}
if(listitem==11)
{
if (GetPlayerState(playerid) == 1)
{
SendClientMessage(playerid, 0x83FF46FF, "::: Ai luat jobul Garbage Collector :::");
PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pJob] = 19;
PlayerInfo[playerid][pContractTime] = 5;
}
}
}
return 1;
}
The dialog is finished so the last bracket is closed, we don't need the rest of the brackets.
pawn Код:
if(strcmp(cmd,"/takejob",true)==0)
{
// the IsPlayerCOnnect is NOT necessary.
if(PlayerToPoint(25.0,playerid,1236.1875,-2517.4473,253.4778))
{
ShowPlayerDialog(playerid,Dialog_Test,DIALOG_STYLE_LIST,"Bar","Detective\nLawyer\nBodyguard\nFarmer","Selecteaza","Inchide");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not in the JP !");
return 1;
}
return 1;
}
I think the problem was in the command but now I fixed it.
-FalconX
Re: Small Problem -
Dan_Barocu - 11.06.2012
why do i get 26 errors??
Re: Small Problem -
FalconX - 11.06.2012
Quote:
Originally Posted by Dan_Barocu
why do i get 26 errors??
|
Try the command, restore the Dialog script by pressing CTRL + Z.
Re: Small Problem -
Dan_Barocu - 11.06.2012
FIXED but why do restoff them if i press cancel i get server closed connection?
Re: Small Problem -
Dan_Barocu - 12.06.2012
how do i put if i want apeear message Stopped radio and stopaudio..
if( !response ) return StopAudioStreamForPlayer(playerid);?
Re: Small Problem -
Jonny5 - 12.06.2012
i sent the answer in the pm you just sent me,
regards,