|
Tried this include, but the commands ain't working at all. Nothing happens. It just tells me that the command is called, but nothing happens. Any idea why? Is it not working with today's version of sa-mp? |
new skin[MAX_PLAYERS];
public loadaccount_user(playerid, name[], value[])
{
INI_Int("Skin",skin[playerid]);
SetPlayerSkin(playerid,skin[playerid])
return 1;
}
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"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
INI_WriteInt(File,"Skin",0);
}
}

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][pCash]);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
SetPlayerSkin(playerid,skin[playerid]);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
}
return 1;
}
}
}
return 1;
}
Loads the skin when player connectspublic OnPlayerDisconnect(playerid, reason)
{
skin[playerid] = GetPlayerSkin(playerid);
INI_WriteInt(File,"Skin",skin[playerid]);
return 1;
}

public OnGameModeExit()
{
foreach(Player, i)
{
SavePlayerAccount(i);
}
return 1;
}
public SavePlayerAccount(playerid)
{
new money = GetPlayerMoney(playerid);
new skin = GetPlayerSkin(playerid);
new level = GetPlayerScore(playerid);
if(fexist(UserPath(playerid)))
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File," Balkan Force RolePlay ");
INI_WriteInt(File,"Money",money);
INI_WriteInt(File,"Skin",skin);
INI_WriteInt(File,"Level",level);
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
INI_WriteInt(File,"Sex",PlayerInfo[playerid][pSex]);
INI_WriteInt(File,"Age",PlayerInfo[playerid][pAge]);
INI_WriteInt(File,"Registered",PlayerInfo[playerid][pRegistered]);
INI_WriteInt(File,"GunID",PlayerInfo[playerid][pGunID]);
INI_WriteInt(File,"GunAmmo",PlayerInfo[playerid][pGunAmmo]);
INI_Close(File);
}
return 1;
}
//this is in Login dialog
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
stock UserPath(playerid)
{
new string[128],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),PATH,playername);
return string;
}