02.06.2012, 05:30
Hi there,
I have been working steady on a new admin system/registration system using y_ini. And i was trying to make a /unban command, i have tryed diffrent ways and none of them worked or gave tons of errors.
What i am wondering is how would i store the players info in an array/enum so then the /unban command can unban the player and then save the info all while the player is offline and possibly use the info for something such as /stats <name of offline player>?
I have the actuall /unban command done its self just mission the loading part for the player's file...
Hoping for a little assistance on this so i can get a idea on how to do it.
If anyone needs anymore info let me know.
Thanks
I have been working steady on a new admin system/registration system using y_ini. And i was trying to make a /unban command, i have tryed diffrent ways and none of them worked or gave tons of errors.
What i am wondering is how would i store the players info in an array/enum so then the /unban command can unban the player and then save the info all while the player is offline and possibly use the info for something such as /stats <name of offline player>?
I have the actuall /unban command done its self just mission the loading part for the player's file...
pawn Код:
COMMAND:unban(playerid, params[])
{
new PlayerToUnban[24], Msg[128], Name[24];
new string[50];
if (PlayerInfo[playerid][pLoggedIn] == 1)
{
if (PlayerInfo[playerid][pAdmin] >= 3)
{
print("before sscanf");
if (sscanf(params, "s[24]", PlayerToUnban)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/unban <PlayerToUnban>\"");
{
print("after sscanf");
format(string,sizeof(string),PATH,PlayerToUnban);
if(fexist(string))
{
//==========================================================
//unban code/loading info here
//==========================================================
GetPlayerName(playerid, Name, sizeof(Name));
format(Msg, 128, "Admin %s has un-banned %s", Name, PlayerToUnban);
SendClientMessageToAll(0x808080FF, Msg);
}
else
{
print(string);
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}There is no account with that playername");
print("There was no account");
}
}
}
else
{
print("player isnt admin");
return 0;
}
}
else
{
print("player isnt logged in");
return 0;
}
return 1;
}
If anyone needs anymore info let me know.
Thanks