Guest User

Heures & Date

a guest
Jul 8th, 2011
394
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. #include <a_samp>
  3.  
  4. #define FILTERSCRIPT
  5.  
  6. #define BLANC 0xFFFFFFFF
  7.  
  8. new Text:Temps;
  9. new Text:Date;
  10.  
  11. forward Heure(playerid);
  12.  
  13. public OnFilterScriptInit()
  14. {
  15.     print("Heures Loaded Succes.");
  16.     print("By Xolokos(Sanctus) Jeffrey Payne.");
  17.    
  18.     Date = TextDrawCreate(547.000000,10.000000,"--");
  19.  
  20.     TextDrawFont(Date,2);
  21.     TextDrawAlignment(Date, 1);
  22.     TextDrawLetterSize(Date, 0.300, 0.800);
  23.     TextDrawColor(Date, BLANC);
  24.     TextDrawSetOutline(Date, 1);
  25.     TextDrawTextSize (Date,  3.0, 3.0) ;
  26.    
  27.    
  28.     Temps = TextDrawCreate(547.000000,20.000000,"--");
  29.  
  30.     TextDrawFont(Temps,2);
  31.     TextDrawAlignment(Temps, 1);
  32.     TextDrawLetterSize(Temps, 0.300, 0.800);
  33.     TextDrawColor(Temps, BLANC);
  34.     TextDrawSetOutline(Temps, 1);
  35.     TextDrawTextSize (Temps,  3.0, 3.0) ;
  36.  
  37.  
  38.     SetTimer("Heure",500,true);
  39.     return 1;
  40. }
  41.  
  42. public OnFilterScriptExit()
  43. {
  44.     print("Heures Unloaded.");
  45.     return 1;
  46. }
  47.  
  48. public OnPlayerSpawn(playerid)
  49. {
  50.     TextDrawShowForPlayer(playerid, Temps);
  51.     TextDrawShowForPlayer(playerid, Date);
  52.     return 1;
  53. }
  54.  
  55. public OnPlayerDisconnect(playerid, reason)
  56. {
  57.     TextDrawHideForPlayer(playerid, Temps);
  58.     TextDrawHideForPlayer(playerid, Date);
  59.     return 1;
  60. }
  61.  
  62. public Heure(playerid)
  63. {
  64.     new String[256],Anner,Mois,Jour,Heures,Minutes,Secondes;
  65.     getdate(Anner, Mois, Jour);
  66.     gettime(Heures, Minutes, Secondes);
  67.  
  68.     format(String, sizeof String, "%d/%d/%d", Jour,Mois,Anner);
  69.     TextDrawSetString(Date, String);
  70.  
  71.     format(String, sizeof String, "%d:%d:%d",Heures,Minutes,Secondes);
  72.     TextDrawSetString(Temps, String);
  73. }
RAW Paste Data