28.12.2017, 02:35
I'm created a /ban command and i'm not know how to save timer and banned player with dini...
THANKS!
Код:
dcmd_ban(playerid, params[]) { if(AccountInfo[playerid][aLevel] < 1) SendClientMessage(playerid, COLOR_RED, "Ai nevoie de admin 1 pentru a folosii aceasta comanda!"); else { new ore = 60000; new ID, reason[100], name[60], name2[60], string4[256], string5[256], string6[256], string2[256]; if(sscanf(params, "iis", ID, ore, reason)) SendClientMessage(playerid, COLOR_WHITE, "Scrie: /ban [id/nume] [zile] [motiv]"); else if(IsPlayerConnected(ID) == 0) SendClientMessage(playerid, COLOR_RED, "Player-ul nu este conectat"); else { AccountInfo[ID][pBanned] = 1; new zi = floatround(float(ore)/24.0); SetTimer("ban1",zi,1); SetTimer("kicktimer",2500,1); GetPlayerName(playerid, name, 60); GetPlayerName(playerid, name2, 60); format(string2, 256, "Admin %s[%d] ia dat ban lui %s pentru %s zile. (Motiv: %s)", name, playerid, name2, zi, reason); SendClientMessageToAll(COLOR_LIGHTRED, string2); format(string4, 256, "Admin %s[%d] ti-a dat ban pentru %s zile. (Motiv: %s)", name, playerid, zi, reason); SCM(ID, COLOR_YELLOW, string4); format(string5, 256, "Daca crezi ca ai luat ban degeaba poti face o cerere de unban pe:"); SCM(ID, COLOR_YELLOW, string5); format(string6, 256, "http://cnrromania.1to.us/index.php?topic=3.0"); SCM(ID, COLOR_YELLOW, string6); FixedBan(ID); } } return 1; }