Advertisement
kazlik

Moje Země

Jan 6th, 2012
473
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 5.39 KB | None | 0 0
  1. #include <a_samp>
  2. #include <dini>
  3. #define file "moje_zeme/%s.cfg"
  4. #define login 0
  5. #define SCM SendClientMessage
  6. #define LBLUE 0x33CCFFAA
  7. #define BLUE 0x0000FFAA
  8. #define GREEN 0x33AA33AA
  9. #define RED 0xFF0000FF
  10. #define WHITE 0xFFFFFFAA
  11. #define ORANGE 0xFF9933AA
  12. #define PINK 0xFF66FFAA
  13. #define BLACK 0x000000AA
  14.  
  15.  
  16. new stringX[256];
  17. new stringY[256];
  18. new prihlasen[MAX_PLAYERS];
  19.  
  20.  
  21. #pragma tabsize 0
  22. main()
  23. {
  24.     print("\n----------------------------------");
  25.     print("           Moje země              ");
  26.     print("----------------------------------\n");
  27. }
  28.  
  29. public OnGameModeInit()
  30. {
  31.     SetGameModeText("Moje země");
  32.     AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  33.     return 1;
  34. }
  35.  
  36. public OnGameModeExit()
  37. {
  38.     return 1;
  39. }
  40.  
  41. public OnPlayerRequestClass(playerid, classid)
  42. {
  43.     SetPlayerInterior(playerid, 1);
  44.     SetPlayerPos(playerid, -792.55279541,509.08712769,1371.39135742);
  45.     SetPlayerCameraPos(playerid, -792.55279541,509.08712769,1371.39135742);
  46.     SetPlayerCameraLookAt(playerid, -789.44763184,503.70260620,1371.70458984);
  47.       if(prihlasen[playerid]==0){
  48.     format(stringX, 256, file, PlayerName(playerid));
  49.     if(dini_Exists(stringX) == 1){
  50.       ShowPlayerDialog(playerid,login,DIALOG_STYLE_INPUT,"Přihlášení","Vaše heslo:","Přihlásit","");
  51.     }else{
  52.       ShowPlayerDialog(playerid,login,DIALOG_STYLE_INPUT,"Registrace","Zaregistrujte se:","Registrovat","");
  53.     }
  54.   }
  55.  
  56.  
  57.     return 1;
  58. }
  59.  
  60. public OnPlayerConnect(playerid)
  61. {
  62.     return 1;
  63. }
  64.  
  65. public OnPlayerDisconnect(playerid, reason)
  66. {
  67.     return 1;
  68. }
  69.  
  70. public OnPlayerSpawn(playerid)
  71. {
  72.     SetPlayerInterior(playerid, 0);
  73.     return 1;
  74. }
  75.  
  76. public OnPlayerDeath(playerid, killerid, reason)
  77. {
  78.     return 1;
  79. }
  80.  
  81. public OnVehicleSpawn(vehicleid)
  82. {
  83.     return 1;
  84. }
  85.  
  86. public OnVehicleDeath(vehicleid, killerid)
  87. {
  88.     return 1;
  89. }
  90.  
  91. public OnPlayerText(playerid, text[])
  92. {
  93.     return 1;
  94. }
  95.  
  96. public OnPlayerCommandText(playerid, cmdtext[])
  97. {
  98.     if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  99.     {
  100.         // Do something here
  101.         return 1;
  102.     }
  103.     return 0;
  104. }
  105.  
  106. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  107. {
  108.     return 1;
  109. }
  110.  
  111. public OnPlayerExitVehicle(playerid, vehicleid)
  112. {
  113.     return 1;
  114. }
  115.  
  116. public OnPlayerStateChange(playerid, newstate, oldstate)
  117. {
  118.     return 1;
  119. }
  120.  
  121. public OnPlayerEnterCheckpoint(playerid)
  122. {
  123.     return 1;
  124. }
  125.  
  126. public OnPlayerLeaveCheckpoint(playerid)
  127. {
  128.     return 1;
  129. }
  130.  
  131. public OnPlayerEnterRaceCheckpoint(playerid)
  132. {
  133.     return 1;
  134. }
  135.  
  136. public OnPlayerLeaveRaceCheckpoint(playerid)
  137. {
  138.     return 1;
  139. }
  140.  
  141. public OnRconCommand(cmd[])
  142. {
  143.     return 1;
  144. }
  145.  
  146. public OnPlayerRequestSpawn(playerid)
  147. {
  148.     if(prihlasen[playerid] == 1){
  149.     return 1;
  150.     }
  151.     return 0;
  152. }
  153.  
  154. public OnObjectMoved(objectid)
  155. {
  156.     return 1;
  157. }
  158.  
  159. public OnPlayerObjectMoved(playerid, objectid)
  160. {
  161.     return 1;
  162. }
  163.  
  164. public OnPlayerPickUpPickup(playerid, pickupid)
  165. {
  166.     return 1;
  167. }
  168.  
  169. public OnVehicleMod(playerid, vehicleid, componentid)
  170. {
  171.     return 1;
  172. }
  173.  
  174. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  175. {
  176.     return 1;
  177. }
  178.  
  179. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  180. {
  181.     return 1;
  182. }
  183.  
  184. public OnPlayerSelectedMenuRow(playerid, row)
  185. {
  186.     return 1;
  187. }
  188.  
  189. public OnPlayerExitedMenu(playerid)
  190. {
  191.     return 1;
  192. }
  193.  
  194. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  195. {
  196.     return 1;
  197. }
  198.  
  199. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  200. {
  201.     return 1;
  202. }
  203.  
  204. public OnRconLoginAttempt(ip[], password[], success)
  205. {
  206.     return 1;
  207. }
  208.  
  209. public OnPlayerUpdate(playerid)
  210. {
  211.     return 1;
  212. }
  213.  
  214. public OnPlayerStreamIn(playerid, forplayerid)
  215. {
  216.     return 1;
  217. }
  218.  
  219. public OnPlayerStreamOut(playerid, forplayerid)
  220. {
  221.     return 1;
  222. }
  223.  
  224. public OnVehicleStreamIn(vehicleid, forplayerid)
  225. {
  226.     return 1;
  227. }
  228.  
  229. public OnVehicleStreamOut(vehicleid, forplayerid)
  230. {
  231.     return 1;
  232. }
  233.  
  234. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  235. {
  236.  
  237.   if(dialogid == login){
  238.     if(response == 1){
  239.       format(stringX, 256, file, PlayerName(playerid));
  240.       if(dini_Exists(stringX) == 1){
  241.         new heslo[256];
  242.         heslo = dini_Get(stringX,"Heslo");
  243.         format(stringY, 256, "%s", heslo);
  244.         if(strlen(inputtext) != 0){
  245.           if(!strcmp(dini_Get(stringX,"Heslo"), inputtext)){
  246.             prihlasen[playerid] = 1;
  247.           }else{
  248.             SCM(playerid, RED, "[#] Špatné heslo");
  249.             ShowPlayerDialog(playerid,login,DIALOG_STYLE_INPUT,"Přihlášení","Vaše heslo:","Přihlásit","Storno");
  250.           }
  251.         }else{
  252.           SCM(playerid, RED, "[#] Špatné heslo");
  253.           ShowPlayerDialog(playerid,login,DIALOG_STYLE_INPUT,"Přihlášení","Vaše heslo:","Přihlásit","Storno");
  254.         }
  255.       }else{
  256.         if(strlen(inputtext) != 0){
  257.           dini_Create(stringX);
  258.           format(stringY, 256, "%s", inputtext);
  259.           dini_Set(stringX,"Heslo",stringY);
  260.           dini_IntSet(stringX,"Povolani", 0);
  261.           dini_IntSet(stringX,"ALevel", 0);
  262.           dini_IntSet(stringX,"Penize", 0);
  263.           prihlasen[playerid] = 1;
  264.         }else{
  265.         SCM(playerid, RED, "[#] Heslo nesmí zůstat prázdné");
  266.         ShowPlayerDialog(playerid,0,DIALOG_STYLE_INPUT,"Registrace","Zaregistrujte se:","Registrovat","Kick");
  267.         }
  268.       }
  269.     }else{
  270.       Kick(playerid);
  271.     }
  272.   }
  273.  
  274.     return 1;
  275. }
  276.  
  277. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  278. {
  279.     return 1;
  280. }
  281.  
  282. stock PlayerName(playerid)
  283. {
  284.   new name[255];
  285.   GetPlayerName(playerid, name, 255);
  286.   return name;
  287. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement