24.03.2012, 21:27
Hello guys I have one problem.I have register system with Dini and why when I register with nick Pein and when I reconnect with nickname peiN it says I need to register this nickname again ?
|
I will try to explain:
Player [NCS]Pein join to my server and attemps to register.Then he make 5 kills nad then he left.Then he join with nick [NCS]PeiN and the server says you need to register but with [NCS]Pein he is registered.How I can fix this bug ? |
#include <a_samp>
#include <utils>
#include <Dini>
#include <dutils>
public OnPlayerRegister(playerid, password[])
{
if(IsPlayerConnected(playerid))
{
new string3[64];
new playername3[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername3, sizeof(playername3));
format(string3, sizeof(string3), "Users/%s.ini", playername3);
dini_Create(string3);
new password2 = num_hash(password);
PlayerInfo[playerid][pKey] = password2;
dini_IntSet(string3, "Password",password2);
dini_IntSet(string3, "AdminLevel",PlayerInfo[playerid][pAdmin]);
dini_IntSet(string3, "Registered",PlayerInfo[playerid][pAdmin]);
if ((PlayerInfo[playerid][pPos_x]==0.0 && PlayerInfo[playerid][pPos_y]==0.0 && PlayerInfo[playerid][pPos_z]==0.0))
{
PlayerInfo[playerid][pPos_x] = 1684.9;
PlayerInfo[playerid][pPos_y] = -2244.5;
PlayerInfo[playerid][pPos_z] = 13.5;
}
dini_FloatSet(string3, "Pos_x",PlayerInfo[playerid][pPos_x]);
dini_FloatSet(string3, "Pos_y",PlayerInfo[playerid][pPos_y]);
dini_FloatSet(string3, "Pos_z",PlayerInfo[playerid][pPos_z]);
dini_IntSet(string3, "Banned",PlayerInfo[playerid][pBanned]);
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Welcome to <insert server name>", "Your account is now registered.\n\nIn order to play here, you need to log in!", "Login", "Quit");
PlayerInfo[playerid][pReg] = 0;
}
return 1;
}