25.06.2012, 22:00
So I'm trying to get a script going that bans a person's account if they're offline. However, I do not know what to put for the name of the account to edit. Let me show you.
See, on the Stats[?][Banned] = 1;, I don't know what to put for the ?. Any help would be, well, helpful.
pawn Код:
command(banname,playerid,params[])
{
if(Stats[playerid][AdminLevel] >= 5) {
new name, namestring[24], string[128], sendername[MAX_PLAYER_NAME];
if(unformat(params,"s[24]",name)) return SendClientMessage(playerid, COLOR_WHITE,"{777777}[SYNTAX]{FFFFFF} /BanName [Player Name]");
format(namestring, sizeof(string), "%s", name);
if(dini_Exists(namestring)) {
Stats[namestring][Banned] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "{00FF00}[SERVER]{FFFFFF} Admin %s has banned the account named %s.", sendername, namestring);
SendClientMessageToAll(COLOR_WHITE, string);
} else {
format(string, sizeof(string), "{FF0000}[ERROR]{FFFFFF} %s is not a registered account.", namestring);
SendClientMessage(playerid, COLOR_WHITE, string);
}
} else {
SendClientMessage(playerid, COLOR_WHITE, "{FF0000}[ERROR]{FFFFFF} You can't use this command, stop trying to be cool.");
}
return 1;
}