Error in OnDialogResponse No return value? -
Mustafa6155 - 04.12.2012
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch( dialogid )
{
case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registeren...",""COL_RED"Je hebt een ongewenst wachtwoord in getypt\n"COL_WHITE"Type een wachtwoord om te registeren.","Registeeer","Dicht");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Wachtwoord",udb_hash(inputtext));
INI_WriteInt(File,"Geld",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Moorden",0);
INI_WriteInt(File,"Doden",0);
INI_WriteInt(File,"Score",0);
INI_WriteInt(File,"Bommen",0);
INI_WriteInt(File,"Rank",0);
INI_WriteInt(File,"K/D",0);
INI_WriteInt(File,"Vip",0);
INI_Close(File);
SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Succes!",""COL_GREEN" Kom terug om je stats te saven!","Ok","");
}
}
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Succes!",""COL_GREEN"Je bent succesvol in gelogt.","Ok","");
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"Ongewenst wachtwoord in getypt.\n"COL_WHITE"Type de goed wachtwoord om in te loggen.","Login","Quit");
}
return 1;
}
}
}
}// 1385 <------------------------------
Код:
C:\Users\Mustafa\Desktop\SAmp SRV\ForYou\gamemodes\BF.pwn(1385) : warning 209: function "S@@_OnDialogResponse" should return a value
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Warning.
And When i add return 0; under it.
I get mucher errors?
Код:
C:\Users\Mustafa\Desktop\SAmp SRV\ForYou\gamemodes\BF.pwn(973) : error 017: undefined symbol "SetPlayerToTeamColour"
C:\Users\Mustafa\Desktop\SAmp SRV\ForYou\gamemodes\BF.pwn(982) : error 017: undefined symbol "UserPath"
C:\Users\Mustafa\Desktop\SAmp SRV\ForYou\gamemodes\BF.pwn(984) : error 017: undefined symbol "UserPath"
C:\Users\Mustafa\Desktop\SAmp SRV\ForYou\gamemodes\BF.pwn(996) : error 017: undefined symbol "UserPath"
C:\Users\Mustafa\Desktop\SAmp SRV\ForYou\gamemodes\BF.pwn(1340) : error 079: inconsistent return types (array & non-array)
C:\Users\Mustafa\Desktop\SAmp SRV\ForYou\gamemodes\BF.pwn(1343) : error 079: inconsistent return types (array & non-array)
C:\Users\Mustafa\Desktop\SAmp SRV\ForYou\gamemodes\BF.pwn(1344) : error 017: undefined symbol "UserPath"
C:\Users\Mustafa\Desktop\SAmp SRV\ForYou\gamemodes\BF.pwn(1346) : error 017: undefined symbol "udb_hash"
C:\Users\Mustafa\Desktop\SAmp SRV\ForYou\gamemodes\BF.pwn(1366) : error 079: inconsistent return types (array & non-array)
C:\Users\Mustafa\Desktop\SAmp SRV\ForYou\gamemodes\BF.pwn(1369) : error 017: undefined symbol "udb_hash"
C:\Users\Mustafa\Desktop\SAmp SRV\ForYou\gamemodes\BF.pwn(1371) : error 017: undefined symbol "UserPath"
C:\Users\Mustafa\Desktop\SAmp SRV\ForYou\gamemodes\BF.pwn(1379) : error 079: inconsistent return types (array & non-array)
C:\Users\Mustafa\Desktop\SAmp SRV\ForYou\gamemodes\BF.pwn(1385) : warning 217: loose indentation
C:\Users\Mustafa\Desktop\SAmp SRV\ForYou\gamemodes\BF.pwn(1385) : error 079: inconsistent return types (array & non-array)
C:\Users\Mustafa\Desktop\SAmp SRV\ForYou\gamemodes\BF.pwn(1387) : warning 225: unreachable code
C:\Users\Mustafa\Desktop\SAmp SRV\ForYou\gamemodes\BF.pwn(1387) : error 029: invalid expression, assumed zero
C:\Users\Mustafa\Desktop\SAmp SRV\ForYou\gamemodes\BF.pwn(1387) : error 004: function "S@@_OnPlayerClickPlayer" is not implemented
C:\Users\Mustafa\Desktop\SAmp SRV\ForYou\gamemodes\BF.pwn(1389) : error 079: inconsistent return types (array & non-array)
C:\Users\Mustafa\Desktop\SAmp SRV\ForYou\gamemodes\BF.pwn(1392) : warning 225: unreachable code
C:\Users\Mustafa\Desktop\SAmp SRV\ForYou\gamemodes\BF.pwn(1392) : error 029: invalid expression, assumed zero
C:\Users\Mustafa\Desktop\SAmp SRV\ForYou\gamemodes\BF.pwn(1392) : error 004: function "EndDeathCam" is not implemented
C:\Users\Mustafa\Desktop\SAmp SRV\ForYou\gamemodes\BF.pwn(1398) : error 017: undefined symbol "SetPlayerToTeamColour"
C:\Users\Mustafa\Desktop\SAmp SRV\ForYou\gamemodes\BF.pwn(1412) : error 029: invalid expression, assumed zero
C:\Users\Mustafa\Desktop\SAmp SRV\ForYou\gamemodes\BF.pwn(1412) : error 017: undefined symbol "cmd_help"
C:\Users\Mustafa\Desktop\SAmp SRV\ForYou\gamemodes\BF.pwn(1412) : error 029: invalid expression, assumed zero
C:\Users\Mustafa\Desktop\SAmp SRV\ForYou\gamemodes\BF.pwn(1412) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
23 Errors.
Please help me to fix?
Re: Error in OnDialogResponse No return value? -
XtremeR - 04.12.2012
this can help:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch( dialogid )
{
case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registeren...",""COL_RED"Je hebt een ongewenst wachtwoord in getypt\n"COL_WHITE"Type een wachtwoord om te registeren.","Registeeer","Dicht");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Wachtwoord",udb_hash(inputtext));
INI_WriteInt(File,"Geld",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Moorden",0);
INI_WriteInt(File,"Doden",0);
INI_WriteInt(File,"Score",0);
INI_WriteInt(File,"Bommen",0);
INI_WriteInt(File,"Rank",0);
INI_WriteInt(File,"K/D",0);
INI_WriteInt(File,"Vip",0);
INI_Close(File);
SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Succes!",""COL_GREEN" Kom terug om je stats te saven!","Ok","");
}
}
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Succes!",""COL_GREEN"Je bent succesvol in gelogt.","Ok","");
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"Ongewenst wachtwoord in getypt.\n"COL_WHITE"Type de goed wachtwoord om in te loggen.","Login","Quit");
}
}
}
}
return 1;
}