12.03.2010, 14:15
Well i coded it again and now it works.
You will also need this stock for that.
Using stock when you need to get players name is much easier than using GetPlayerName.
pawn Код:
#define UserPath "VIP"
pawn Код:
public OnPlayerConnect(playerid)
{
new FilePath[32];
new Ip[16];
GetPlayerIp(playerid,Ip,sizeof(Ip));
format(FilePath, sizeof(FilePath), "%s/%s.ini", UserPath, PlayerName(playerid));
if(!dini_Exists(FilePath)) {
dini_Create(FilePath);
dini_Set(FilePath, "Name", PlayerName(playerid));
dini_Set(FilePath, "Ip", Ip);
dini_IntSet(FilePath, "VIP", 0);
}
return 1;
}
Using stock when you need to get players name is much easier than using GetPlayerName.
pawn Код:
stock PlayerName(playerid) {
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
return name;
}