09.03.2014, 15:58
I've been trying to make an offline ban cmd and it's not working so here's what i did till now i know it's fucked up but i would appreciate any help:
I want it to ban the player name given and I don't know how to do it i tried things like Playerinfo[name][pBanned] = 1; and it didn't work.
Код:
CMD:oban(playerid, params[]) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pAdmin] >= 3) { new name[MAX_PLAYER_NAME],sendername[MAX_PLAYER_NAME], result[60], string[100], logstring[100]; if(sscanf(params, "s[24]s[32]",name,result)) return SendClientMessage(playerid,RED,"USAGE: /oban [Name] [reason]"); new year, month, day; getdate(year, month, day); if(dini_Exists(SERVER_USER_FILE)) { dini_IntSet("lost/accounts/%s.ini","pBanned",1); format(string, sizeof(string), "{AA3333}AdmCmd{FFFF00}: %s was offline banned by %s, reason: %s", name, sendername, (result)); SendClientMessageToAll(RED, string); format(logstring, sizeof(logstring), "[%d/%d/%d] Name: %s Banned by: %s Reason: %s (/oban)",day, month, year,name, sendername, (result)); SaveIn("BanLog.txt",string); } else { SendClientMessage(playerid,RED, "invalid player name"); } return 1; } } return 1; }