15.02.2014, 17:53
So, I writestring how I think it's suppose to be done, get no errors, but doesn't write the string, just leaves the space blank, no numbers, nothing. I'm close to suicidal
So here's my code:
So here's my code:
pawn Код:
//rank defines
#define hobo 1
#define poor_guy 2
#define sweeper 3
#define rookie 4
#define druggie 5
#define underdog 6
#define drug dealer 7
#define rich_guy 8
#define underboss 9
#define boss 10
//enums
enum pInfo
{
pPass[129],
pCash,
pAdmin,
pScore,
pRank[129],
pKills,
pDeaths,
pKicked,
pBanned,
pWarned
}
//saving the shit
public OnPlayerDisconnect(playerid,reason)
{
//loogin/register
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
INI_WriteInt(File,"Kicked",PlayerInfo[playerid][pKicked]);
INI_WriteInt(File,"Banned",PlayerInfo[playerid][pBanned]);
INI_WriteInt(File,"Warned",PlayerInfo[playerid][pWarned]);
INI_WriteInt(File,"Score",GetPlayerScore(playerid));
INI_WriteString(File,"Rank",PlayerInfo[playerid][pRank]);
INI_Close(File);
return 1;
}
//the register dialog
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,""c_white"Register:",""c_white"Type your desired password below!","Register","Quit");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
new HashPass[129];
WP_Hash(HashPass, sizeof(HashPass), inputtext);
INI_WriteString(File, "Password", HashPass);
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_WriteInt(File,"Kicked",0);
INI_WriteInt(File,"Banned",0);
INI_WriteInt(File,"Warned",0);
INI_WriteInt(File,"Score",0);
INI_WriteString(File,"Rank","hobo");
//loading the user
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
INI_String("Password",PlayerInfo[playerid][pPass], 129);
INI_Int("Cash",PlayerInfo[playerid][pCash]);
INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
INI_Int("Kills",PlayerInfo[playerid][pKills]);
INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
INI_Int("Kicked",PlayerInfo[playerid][pKicked]);
INI_Int("Banned",PlayerInfo[playerid][pBanned]);
INI_Int("Warned",PlayerInfo[playerid][pWarned]);
INI_Int("Score",PlayerInfo[playerid][pScore]);
INI_String("Rank",PlayerInfo[playerid][pRank], 129);
return 1;
}