11.02.2013, 11:12
i got this OnPlayerConnect
And this on the command that gives me the error:
pawn Код:
public OnPlayerConnect(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
if(!fexist(user_ini_file(playerid)))
{
new INI:ini=INI_Open(user_ini_file(playerid));
INI_WriteString(ini,"Name",name);
INI_WriteString(ini,"Registered:","-1");
INI_WriteString(ini,"Password:","");
INI_WriteString(ini,"Admin:","-1");
INI_WriteString(ini,"Logged in:","-1");
INI_Close(ini);
}
}
pawn Код:
new pass[128];
INI_Load(user_ini_file(playerid));
INI_Int("Registered:",PlayerInfo[playerid][PLAYER_REGGED]);
if(PlayerInfo[playerid][PLAYER_REGGED]==1) return SendClientMessage(playerid,0x00FF00FF,"You are already registered");
if(sscanf(params,"s",pass))SendClientMessage(playerid,0x00FF00FF,"/register pass");
else
{
new INI:ini=INI_Open(user_ini_file(playerid));
INI_WriteString(ini,"Password:",pass);
INI_RemoveEntry(ini,"Registered:");
INI_WriteInt(ini,"Registered:",1);
INI_Close(ini);
PlayerInfo[playerid][PLAYER_REGGED]=1;
PlayerInfo[playerid][PLAYER_LOGGED]=1;
format(PlayerInfo[playerid][PLAYER_PASS],50,"%s",pass);
}
return 1;