Advertisement
Guest User

Your Script

a guest
May 6th, 2014
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.95 KB | None | 0 0
  1. //Edited by Kaliber
  2. #include <a_samp>
  3. #include <dini>
  4. #undef MAX_PLAYERS
  5. #define MAX_PLAYERS 100
  6. #define COLOR_RED 0xFF0000FF
  7. #define COLOR_ORANGE 0xFFB400FF
  8.  
  9. #define MaxLoginTrys 3
  10.  
  11. #define DIALOG_LOGIN 0
  12. #define DIALOG_REG 1
  13.  
  14. enum Info {
  15.     Passwort[32],
  16.     Adminlevel,
  17.     LoginVersuche
  18. };
  19.  
  20. new pInfo[MAX_PLAYERS][Info],pName[MAX_PLAYERS][MAX_PLAYER_NAME];
  21.  
  22.  
  23. main()
  24. {
  25.     print("\n----------------------------------");
  26.     print(" German Reallife Script by MaixHD");
  27.     print("----------------------------------\n");
  28. }
  29.  
  30. public OnGameModeInit()
  31. {
  32.     SetGameModeText("German Reallife by MaiexHD");
  33.     AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  34.     return 1;
  35. }
  36.  
  37. public OnGameModeExit()
  38. {
  39.     return 1;
  40. }
  41.  
  42. public OnPlayerRequestClass(playerid, classid)
  43. {
  44.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  45.     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  46.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  47.     return 1;
  48. }
  49.  
  50. public OnPlayerConnect(playerid)
  51. {
  52.     new string[144],playerfile[13 + MAX_PLAYER_NAME];
  53.     GetPlayerName(playerid,pName[playerid],MAX_PLAYER_NAME);
  54.     format(string,sizeof(string),"Wilkommen %s, das Team heisst dich Herzlich Willkommen",pName[playerid]);
  55.     SendClientMessage(playerid,COLOR_ORANGE,string);
  56.     format(playerfile,sizeof(playerfile),"Spieler/%s.ini",pName[playerid]);
  57.     if(fexist(playerfile)) return ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Bitte Logge dich ein!","Login"," ");
  58.     return ShowPlayerDialog(playerid,DIALOG_REG,DIALOG_STYLE_INPUT,"Registrieren","Bitte Registriere dich nun!","Registrieren"," ");
  59. }
  60.  
  61. public OnPlayerDisconnect(playerid, reason)
  62. {
  63.     return 1;
  64. }
  65.  
  66. public OnPlayerSpawn(playerid)
  67. {
  68.     return 1;
  69. }
  70.  
  71. public OnPlayerDeath(playerid, killerid, reason)
  72. {
  73.     return 1;
  74. }
  75.  
  76. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  77. {
  78.     switch(dialogid) {
  79.         case DIALOG_LOGIN: {
  80.             if(!response) return ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Bitte Logge dich ein!","Login"," ");
  81.             if(pInfo[playerid][LoginVersuche] >= MaxLoginTrys) return SendClientMessage(playerid,COLOR_RED,"Du hast das Passwort zu oft falsch eingegeben, somit wirst du gekickt!"),Kick(playerid);
  82.             new playerfile[13 + MAX_PLAYER_NAME];
  83.             format(playerfile,sizeof(playerfile),"Spieler/%s.ini",pName[playerid]);
  84.             dini_Create(playerfile);
  85.             dini_Set(playerfile,"Passwort",inputtext);
  86.             dini_IntSet(playerfile,"Adminlevel",0);
  87.             if(strcmp(inputtext,pInfo[playerid][Passwort],false)) {
  88.                 pInfo[playerid][Adminlevel] = dini_get(playerfile,"Adminlevel");
  89.             } else {
  90.                 ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Bitte Logge dich ein!","Login"," ");
  91.                 new str[45];
  92.                 format(str,sizeof(str),"Das Passwort war Falsch! (Verusch %i / %i)",pInfo[playerid][LoginVersuche],MaxLoginTrys);
  93.                 SendClientMessage(playerid,COLOR_RED,str);
  94.             }
  95.                
  96.         }
  97.         case DIALOG_REG: {
  98.             if(!response) return ShowPlayerDialog(playerid,DIALOG_REG,DIALOG_STYLE_INPUT,"Registrieren","Bitte Registriere dich nun!","Registrieren"," ");
  99.             new playerfile[13 + MAX_PLAYER_NAME];
  100.             format(playerfile,sizeof(playerfile),"Spieler/%s.ini",pName[playerid]);
  101.         }
  102.     }
  103.     return 1;
  104. }
  105.  
  106. public OnVehicleSpawn(vehicleid)
  107. {
  108.     return 1;
  109. }
  110.  
  111. public OnVehicleDeath(vehicleid, killerid)
  112. {
  113.     return 1;
  114. }
  115.  
  116. public OnPlayerText(playerid, text[])
  117. {
  118.     return 1;
  119. }
  120.  
  121. public OnPlayerCommandText(playerid, cmdtext[])
  122. {
  123.     if(strcmp(strget(cmdtext, 0), "/money",true) == 0)
  124.     {
  125.         GivePlayerMoney(playerid,99999);
  126.     }
  127.     return 0;
  128. }
  129.  
  130. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  131. {
  132.     return 1;
  133. }
  134.  
  135. public OnPlayerExitVehicle(playerid, vehicleid)
  136. {
  137.     return 1;
  138. }
  139.  
  140. public OnPlayerStateChange(playerid, newstate, oldstate)
  141. {
  142.     return 1;
  143. }
  144.  
  145. public OnPlayerEnterCheckpoint(playerid)
  146. {
  147.     return 1;
  148. }
  149.  
  150. public OnPlayerLeaveCheckpoint(playerid)
  151. {
  152.     return 1;
  153. }
  154.  
  155. public OnPlayerEnterRaceCheckpoint(playerid)
  156. {
  157.     return 1;
  158. }
  159.  
  160. public OnPlayerLeaveRaceCheckpoint(playerid)
  161. {
  162.     return 1;
  163. }
  164.  
  165. public OnRconCommand(cmd[])
  166. {
  167.     return 1;
  168. }
  169.  
  170. public OnPlayerRequestSpawn(playerid)
  171. {
  172.     return 1;
  173. }
  174.  
  175. public OnObjectMoved(objectid)
  176. {
  177.     return 1;
  178. }
  179.  
  180. public OnPlayerObjectMoved(playerid, objectid)
  181. {
  182.     return 1;
  183. }
  184.  
  185. public OnPlayerPickUpPickup(playerid, pickupid)
  186. {
  187.     return 1;
  188. }
  189.  
  190. public OnVehicleMod(playerid, vehicleid, componentid)
  191. {
  192.     return 1;
  193. }
  194.  
  195. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  196. {
  197.     return 1;
  198. }
  199.  
  200. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  201. {
  202.     return 1;
  203. }
  204.  
  205. public OnPlayerSelectedMenuRow(playerid, row)
  206. {
  207.     return 1;
  208. }
  209.  
  210. public OnPlayerExitedMenu(playerid)
  211. {
  212.     return 1;
  213. }
  214.  
  215. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  216. {
  217.     return 1;
  218. }
  219.  
  220. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  221. {
  222.     return 1;
  223. }
  224.  
  225. public OnRconLoginAttempt(ip[], password[], success)
  226. {
  227.     return 1;
  228. }
  229.  
  230. public OnPlayerUpdate(playerid)
  231. {
  232.     return 1;
  233. }
  234.  
  235. public OnPlayerStreamIn(playerid, forplayerid)
  236. {
  237.     return 1;
  238. }
  239.  
  240. public OnPlayerStreamOut(playerid, forplayerid)
  241. {
  242.     return 1;
  243. }
  244.  
  245. public OnVehicleStreamIn(vehicleid, forplayerid)
  246. {
  247.     return 1;
  248. }
  249.  
  250. public OnVehicleStreamOut(vehicleid, forplayerid)
  251. {
  252.     return 1;
  253. }
  254.  
  255.  
  256. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  257. {
  258.     return 1;
  259. }
  260.  
  261. stock strget(strx[], pos, search = ' ') {
  262.         new arg, ret[128], idxx;
  263.         for (new i = 0; i < strlen(strx); i++) {
  264.                 if(strx[i] == search || i == strlen(strx) || strx[i + 1] == 10) {
  265.                         arg++;
  266.                         if (arg == pos + 1){
  267.                                 ret[i-idxx] = EOS;
  268.                                 return ret;
  269.                         } else if (arg == pos)
  270.                                 idxx= i+1;
  271.                 }
  272.                 else if (arg == pos)
  273.                         ret[i - idxx] = strx[i];
  274.         }
  275.         return ret;
  276. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement