Advertisement
Guest User

KickEx

a guest
Oct 23rd, 2010
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.25 KB | None | 0 0
  1. /* KickEx Function
  2.  *
  3.  * (c) Copyright 2009-2010, TheHoodRat SA:MP
  4.  * This file is provided as is (no warranties).
  5.  */
  6.  
  7. #include <a_samp>
  8. #include <file>
  9.  
  10. #if defined _KickEx_included
  11. #endinput
  12. #endif
  13. #define _KickEx_included
  14.  
  15. forward NewLine();
  16.  
  17. stock KickEx(playerid, reason[]) // KickEx is our handy function.
  18. {//Let's see the code then!
  19.    #pragma tabsize 0
  20.     new PlayerName[24]; // Define the player's name.
  21.     GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
  22.     new year, month, day; // We want to know the date that the user got kicked, right?
  23.     getdate(year, month, day); // Now we know the real date because of this handy function.
  24.     { // Then...
  25.     new text[128]; // Length of the text (128 characters)
  26.     new File:log = fopen("KickEx.txt", io_write); // Open the file.
  27.     format(text, sizeof(text), "[%d/%d/%d] %s kicked for: %s\r\n",day,month,year,PlayerName,reason); // Displayed in the file.
  28.     fwrite(log, text); // Write to the file.
  29.     fclose(log); // Close the file.
  30.     NewLine();
  31.     Kick(playerid); // Kick the player.
  32. } // Curly brace to close the script.
  33.     return 1;
  34. }
  35.  
  36. public NewLine()
  37. {
  38.     new File:hFile;
  39.     hFile = fopen("KickEx.txt", io_append);
  40.     fwrite(hFile, "\n");
  41.     fclose(hFile);
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement