Quote:
Originally Posted by Shoulen
What does the code look like?
|
public OnPlayerConnect(playerid)
{
new pname[MAX_PLAYER_NAME];
new playerfile[100];
GetPlayerName(playerid, pname, sizeof(pname));
format(playerfile, sizeof(playerfile), "BAdmin/Users/%s.ini",pname);
if(!dini_Exists(playerfile)) SendClientMessage(playerid, orange, "This username is available! Type /register to make an account.");
else if(dini_Exists(playerfile)) SendClientMessage(playerid, orange, "This username is registered! Type /login to log into your account.");
if(dini_Int(playerfile, "Banned") == 1)
{
new string1[126];
format(string1, sizeof(string1), "%s has been kicked for ban evading.", pname);
SendClientMessageToAll(red, string1);
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if(logged[playerid] == 1)
{
new playerfile[100], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(playerfile, sizeof(playerfile), "BAdmin/Users/%s.ini",pname);
dini_IntSet(playerfile, "Level", level[playerid]);
dini_IntSet(playerfile, "Cash", GetPlayerMoney(playerid));
dini_IntSet(playerfile, "Score", GetPlayerScore(playerid));
}
level[playerid] = 0;
logged[playerid] = 0;
muted[playerid] = 0;
return 1;
}