Guest User

Untitled

a guest
Feb 1st, 2013
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. CMD:ban(playerid, params[])
  2. {
  3. if(PlayerInfo[playerid][pAdmin] < 2)return NisiAdmin(playerid);
  4. new stringe[128], ID, razlog[128];
  5. new Godina, Mjesec, Dan;
  6. getdate(Godina, Mjesec, Dan);
  7. new pIP[16];
  8. GetPlayerIp(playerid, pIP, sizeof(pIP));
  9. if(sscanf(params, "us[128]", ID, razlog))return Koristi(playerid, "/ban [player id] [razlog]" );
  10. else if(ID == INVALID_PLAYER_ID)return PogresanID(playerid);
  11. else
  12. {
  13.  
  14. new fak[30];
  15. format(fak,sizeof(fak),BAN_FILE,PlayerName(ID));
  16. new INI:iniFile = INI_Open(fak);
  17. if( !fexist(fak) )
  18. {
  19. INI_SetTag(iniFile, "BANNED");
  20. INI_WriteString(iniFile, "Razlog", razlog);
  21. INI_WriteString(iniFile, "Admin", PlayerName(playerid));
  22. INI_Close(iniFile);
  23.  
  24. SendClientMessage(playerid, COLOR_TOMATO, "____________________________________________________________");
  25. SendClientMessage(playerid, COLOR_RED, "____________________________________________________________");
  26. SendClientMessage(playerid, COLOR_ORANGERED, "ISKLJUCENI STE SA SERVERA(Banani)! Pozorno procitaj tekst!");
  27. format(stringe, sizeof(stringe), "%s(ID:%d) iskljucen(Banan) si sa servera od %s", PlayerName(ID), ID, PlayerName(playerid));
  28. SendClientMessage(playerid, COLOR_WHITE, stringe);
  29. format(stringe, sizeof(stringe), "Razlog iskljucenja: %s",razlog);
  30. SendClientMessage(playerid, COLOR_WHITE, stringe);
  31. format(stringe, sizeof(stringe), "Datum: %d-%d-%d | Vasa IP adresa je: %s", Dan, Mjesec, Godina, pIP);
  32. SendClientMessage(playerid, COLOR_WHITE, stringe);
  33. SendClientMessage(playerid, COLOR_WHITE, "Sa ovim banomn, vas korisnicki racun je suspendiran na neodredjeno!");
  34. SendClientMessage(playerid, COLOR_YELLOW, "Ukoliko mislis da je doslo do greske slikaj ovo(F8) i zatrazi unban na forumu!");
  35. format(stringe, sizeof(stringe), "BAN | %s, Admin: %s",PlayerName(ID),PlayerName(playerid));
  36. SendClientMessageToAll(COLOR_ORANGERED,stringe);
  37. new File:lFile = fopen("Logovi/Banani.txt", io_append),
  38. logData[512],
  39. fyear, fmonth, fday,
  40. fhour, fminute, fsecond;
  41. getdate(fyear, fmonth, fday);
  42. gettime(fhour, fminute, fsecond);
  43. format(logData, sizeof(logData),"[%02d/%02d/%04d %02d:%02d:%02d] %s je banao igraca %s, Razlog: %s \r\n", fday, fmonth, fyear, fhour, fminute, fsecond, PlayerName(playerid), PlayerName(ID), razlog);
  44. fwrite(lFile, logData);
  45. fclose(lFile);
  46. return Kick( ID );
  47. }
  48.  
  49. }
  50. return 1;
Advertisement
Add Comment
Please, Sign In to add comment