20.02.2013, 12:42
This could work?
pawn Код:
public OnPlayerConnect(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
if(fexist(Path(playerid)))
{
INI_ParseFile(Path(playerid),"loadaccount_user", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_INPUT,"Login","Welcome back. This account is registered. \nInsert your password to login to your account","Login","Quit");
}
else
{
ShowPlayerDialog(playerid,dregister,DIALOG_STYLE_INPUT,"Register","Welcome! This account is not registered.\nEnter your own password to create a new account.","Register","Quit");
return 1;
}
SetPlayerFightingStyle(playerid, pInfo[playerid][Fighting]);
return 1;
}
//OnDialog
if (dialogid == dregister2)
{
if (response)
{
if (listitem == 0)
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_NORMAL);
pInfo[playerid][Fighting] = 0;
SendClientMessage(playerid, COLOUR_LIGHTBLUE, "You have changed your fighting style to - Normal");
}
if (listitem == 1)
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_BOXING);
pInfo[playerid][Fighting] = 1;
SendClientMessage(playerid, COLOUR_LIGHTBLUE, "You have changed your fighting style to - Boxing");
}
if (listitem == 2)
{
pInfo[playerid][Fighting] = 2;
SendClientMessage(playerid, COLOUR_LIGHTBLUE, "You have changed your fighting style to - KungFu");
}
if (listitem == 3)
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_KNEEHEAD);
pInfo[playerid][Fighting] = 3;
SendClientMessage(playerid, COLOUR_LIGHTBLUE, "You have changed your fighting style to - Knee Head");
}
if (listitem == 4)
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_GRABKICK);
pInfo[playerid][Fighting] = 4;
SendClientMessage(playerid, COLOUR_LIGHTBLUE, "You have changed your fighting style to - Grab Kick");
}
if (listitem == 5)
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_ELBOW);
pInfo[playerid][Fighting] = 5;
SendClientMessage(playerid, COLOUR_LIGHTBLUE, "You have changed your fighting style to - Elbow");
}
}
else
{
SendClientMessage(playerid, COLOUR_LIGHTBLUE, "You selected 'cancel'");
}
}