11.02.2013, 15:49
Having some problems here, can anyone help me?
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case REG_DIALOG:
{
if(!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, REG_DIALOG, DIALOG_STYLE_INPUT, "{AFAFAF}Register", "{FFFFFF}Welcome to Intelligent Roleplay\n{FFFFFF}Please register your account by typing the password below.", "Register", "Quit");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File, "User Variables");
INI_WriteInt(File, "Encrypted Password", udb_hash(inputtext));
INI_WriteInt(File, "Cash", 0);
INI_WriteInt(File, "Admin", 0);
INI_WriteInt(File, "Level", 0);
INI_WriteInt(File, "Supporter", 0);
INI_WriteInt(File, "Donator", 0);
INI_WriteFloat(File, "PXPOS", 1224.8784);
INI_WriteFloat(File, "PYPOS", -1815.1611);
INI_WriteFloat(File, "PZPOS", 16.5938);
INI_WriteFloat(File, "PAPOS", 246.7154);
INI_Close(File);
SetSpawnInfo(playerid, 0, 0, 1224.8784,-1815.1611,16.5938,246.7154, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
}
}
case LOG_DIALOG:
{
if(!response) return Kick(playerid);
if(response)
{
if(udb_hash(inputtext) == P_DATA[playerid][Pass])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, P_DATA[playerid][Cash]);}
}
else
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{AFAFAF}Login -", "{FFFFFF}You've entered a wrong password\n{FFFFFF}please your password to login.", "Enter", "Quit");
return 1;
}
}
}
} // LINE 345
return 1; // LINE 346
}
pawn Код:
D:\Users\Bart\SA-MP\NEW 0.3X\gamemodes\IntelligentRP.pwn(345) : warning 209: function "OnDialogResponse" should return a value
D:\Users\Bart\SA-MP\NEW 0.3X\gamemodes\IntelligentRP.pwn(346) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.