Advertisement
Guest User

Drüberfliegen

a guest
Dec 20th, 2012
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 7.18 KB | None | 0 0
  1. #include <a_samp>
  2. #include <dini>
  3.  
  4.  
  5. #define DIALOG_REGISTER1 0
  6. #define DIALOG_REGISTER2 1
  7. #define DIALOG_REGISTER3 2
  8. #define DIALOG_REGISTER4 3
  9. #define DIALOG_LOGIN1 4
  10. #define DIALOG_NOPW1 5
  11. #define DIALOG_NOPW2 6
  12. #define DIALOG_WRONGPW 7
  13.  
  14.  
  15. enum Info
  16. {
  17.    sex,
  18.    age,
  19.    logged,
  20. }
  21. new pInfo[MAX_PLAYERS][Info];
  22.  
  23.  
  24. main()
  25. {
  26.     print("\n----------------------------------");
  27.     print(" Blank Gamemode by your name here");
  28.     print("----------------------------------\n");
  29. }
  30.  
  31.  
  32. public OnGameModeInit()
  33. {
  34.     SetGameModeText("KevRl");
  35.     return 1;
  36. }
  37.  
  38. public OnGameModeExit()
  39. {
  40.     return 1;
  41. }
  42.  
  43. public OnPlayerRequestClass(playerid, classid)
  44. {
  45.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  46.     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  47.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  48.     return 1;
  49. }
  50.  
  51. public OnPlayerConnect(playerid)
  52. {
  53.     new pname[MAX_PLAYER_NAME], path[200];
  54.     GetPlayerName(playerid, pname, sizeof(pname));
  55.     format(path, sizeof(path), "/Spieler/%s.ini", pname);
  56.  
  57.     if(!dini_Exists(path))
  58.     {
  59.         ShowPlayerDialog(playerid, DIALOG_REGISTER1, DIALOG_STYLE_INPUT, "Registrierung", "Geben Sie hier Ihr gewünschtes Passwort ein:", "OK", "Abbrechen");
  60.     }
  61.     else
  62.     {
  63.         ShowPlayerDialog(playerid, DIALOG_LOGIN1, DIALOG_STYLE_INPUT, "Login", "Geben Sie hier Ihr Passwort ein:", "OK", "Abbrechen");
  64.     }
  65.     return 1;
  66. }
  67.  
  68. public OnPlayerDisconnect(playerid, reason)
  69. {
  70.     new pname[MAX_PLAYER_NAME], path[200];
  71.     GetPlayerName(playerid, pname, sizeof(pname));
  72.     format(path, sizeof(path), "/Spieler/%s.ini", pname);
  73.  
  74.     dini_IntSet(path, "sex", pInfo[playerid][sex]);
  75.     dini_IntSet(path, "age", pInfo[playerid][age]);
  76.  
  77.     pInfo[playerid][logged] = 0;
  78.     return 1;
  79. }
  80.  
  81. public OnPlayerSpawn(playerid)
  82. {
  83.     return 1;
  84. }
  85.  
  86. public OnPlayerDeath(playerid, killerid, reason)
  87. {
  88.     return 1;
  89. }
  90.  
  91. public OnVehicleSpawn(vehicleid)
  92. {
  93.     return 1;
  94. }
  95.  
  96. public OnVehicleDeath(vehicleid, killerid)
  97. {
  98.     return 1;
  99. }
  100.  
  101. public OnPlayerText(playerid, text[])
  102. {
  103.     return 1;
  104. }
  105.  
  106. public OnPlayerCommandText(playerid, cmdtext[])
  107. {
  108.     if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  109.     {
  110.         // Do something here
  111.         return 1;
  112.     }
  113.     return 0;
  114. }
  115.  
  116. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  117. {
  118.     return 1;
  119. }
  120.  
  121. public OnPlayerExitVehicle(playerid, vehicleid)
  122. {
  123.     return 1;
  124. }
  125.  
  126. public OnPlayerStateChange(playerid, newstate, oldstate)
  127. {
  128.     return 1;
  129. }
  130.  
  131. public OnPlayerEnterCheckpoint(playerid)
  132. {
  133.     return 1;
  134. }
  135.  
  136. public OnPlayerLeaveCheckpoint(playerid)
  137. {
  138.     return 1;
  139. }
  140.  
  141. public OnPlayerEnterRaceCheckpoint(playerid)
  142. {
  143.     return 1;
  144. }
  145.  
  146. public OnPlayerLeaveRaceCheckpoint(playerid)
  147. {
  148.     return 1;
  149. }
  150.  
  151. public OnRconCommand(cmd[])
  152. {
  153.     return 1;
  154. }
  155.  
  156. public OnPlayerRequestSpawn(playerid)
  157. {
  158.     return 1;
  159. }
  160.  
  161. public OnObjectMoved(objectid)
  162. {
  163.     return 1;
  164. }
  165.  
  166. public OnPlayerObjectMoved(playerid, objectid)
  167. {
  168.     return 1;
  169. }
  170.  
  171. public OnPlayerPickUpPickup(playerid, pickupid)
  172. {
  173.     return 1;
  174. }
  175.  
  176. public OnVehicleMod(playerid, vehicleid, componentid)
  177. {
  178.     return 1;
  179. }
  180.  
  181. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  182. {
  183.     return 1;
  184. }
  185.  
  186. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  187. {
  188.     return 1;
  189. }
  190.  
  191. public OnPlayerSelectedMenuRow(playerid, row)
  192. {
  193.     return 1;
  194. }
  195.  
  196. public OnPlayerExitedMenu(playerid)
  197. {
  198.     return 1;
  199. }
  200.  
  201. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  202. {
  203.     return 1;
  204. }
  205.  
  206. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  207. {
  208.     return 1;
  209. }
  210.  
  211. public OnRconLoginAttempt(ip[], password[], success)
  212. {
  213.     return 1;
  214. }
  215.  
  216. public OnPlayerUpdate(playerid)
  217. {
  218.     return 1;
  219. }
  220.  
  221. public OnPlayerStreamIn(playerid, forplayerid)
  222. {
  223.     return 1;
  224. }
  225.  
  226. public OnPlayerStreamOut(playerid, forplayerid)
  227. {
  228.     return 1;
  229. }
  230.  
  231. public OnVehicleStreamIn(vehicleid, forplayerid)
  232. {
  233.     return 1;
  234. }
  235.  
  236. public OnVehicleStreamOut(vehicleid, forplayerid)
  237. {
  238.     return 1;
  239. }
  240.  
  241. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  242. {
  243.     new pname[MAX_PLAYER_NAME], path[200];
  244.     GetPlayerName(playerid, pname, sizeof(pname));
  245.     format(path, sizeof(path), "/Spieler/%s.ini", pname);
  246.  
  247.     switch(dialogid)
  248.     {
  249.         case DIALOG_REGISTER1:
  250.     {
  251.         if(!response)
  252.         {
  253.         Kick(playerid);
  254.         }
  255.             else
  256.         {
  257.         new pwlength = strlen(inputtext);
  258.         if(pwlength > 0)
  259.         {
  260.             dini_Create(path);
  261.             dini_Set(path, "password", inputtext);
  262.             ShowPlayerDialog(playerid,DIALOG_REGISTER2,DIALOG_STYLE_LIST,"Dein Geschlecht:","Männlich\r\nWeiblich","Bestätigen","Abbrechen");
  263.         }
  264.         else
  265.         {
  266.             ShowPlayerDialog(playerid, DIALOG_NOPW1, DIALOG_STYLE_MSGBOX, "Registrierung", "Sie müssen ein Passwort angeben!", "OK", "Abbrechen");
  267.         }
  268.     }
  269.    }
  270.    case DIALOG_REGISTER2:
  271.    {
  272.     if(!response)
  273.     {
  274.         dini_Remove(path);
  275.         Kick(playerid);
  276.     }
  277.     else
  278.     {
  279.             dini_IntSet(path, "sex", listitem);
  280.             ShowPlayerDialog(playerid, DIALOG_REGISTER3, DIALOG_STYLE_INPUT, "Registrierung", "Geben Sie hier Ihr Alter an: (z.B. 22):", "OK", "Abbrechen");
  281.     }
  282. }
  283.     case DIALOG_REGISTER3:
  284.    {
  285.     if(!response)
  286.     {
  287.         dini_Remove(path);
  288.         Kick(playerid);
  289.     }
  290.     else
  291.       {
  292.         dini_Set(path, "age", inputtext);
  293.         ShowPlayerDialog(playerid, DIALOG_REGISTER4, DIALOG_STYLE_MSGBOX, "Registrierung", "Ihre Registrierung ist nun abgeschlossen!", "OK", "OK");
  294.       }
  295.    }
  296.    case DIALOG_REGISTER4:
  297.    {
  298.     pInfo[playerid][sex] = dini_Int(path, "sex");
  299.     pInfo[playerid][age] = dini_Int(path, "age");
  300.     pInfo[playerid][logged] = 1;
  301.    }
  302.    case DIALOG_LOGIN1:
  303.    {
  304.     if(!response)
  305.     {
  306.         Kick(playerid);
  307.     }
  308.     else
  309.     {
  310.         new pwlength = strlen(inputtext);
  311.         if(pwlength > 0)
  312.         {
  313.             new pw[200];
  314.             format(pw, sizeof(pw), "%s", dini_Get(path, "password"));
  315.             if(strcmp(inputtext, pw) == 0)
  316.             {
  317.             pInfo[playerid][sex] = dini_Int(path, "sex");
  318.             pInfo[playerid][age] = dini_Int(path, "age");
  319.             pInfo[playerid][logged] = 1;
  320.             }
  321.             else
  322.             {
  323.             ShowPlayerDialog(playerid, DIALOG_WRONGPW, DIALOG_STYLE_MSGBOX, "Login", "Sie haben ein inkorrektes Passwort angegen!", "OK", "Abbrechen");
  324.             }
  325.         }
  326.         else
  327.         {
  328.             ShowPlayerDialog(playerid, DIALOG_NOPW2, DIALOG_STYLE_MSGBOX,  "Login", "Sie müssen ein Passwort angeben!", "OK", "Abbrechen");
  329.         }
  330.     }
  331.    }
  332.   case DIALOG_NOPW1:
  333.   {
  334.     if(!response)
  335.     {
  336.         Kick(playerid);
  337.     }
  338.     else
  339.     {
  340.         ShowPlayerDialog(playerid, DIALOG_REGISTER1, DIALOG_STYLE_INPUT,  "Registrierung", "Geben Sie hier Ihr gewünschtes Passwort ein:", "OK",  "Abbrechen");
  341.     }
  342.   }
  343.   case DIALOG_NOPW2:
  344.   {
  345.     if(!response)
  346.     {
  347.         Kick(playerid);
  348.     }
  349.     else
  350.     {
  351.          ShowPlayerDialog(playerid, DIALOG_LOGIN1, DIALOG_STYLE_INPUT,   "Login", "Geben Sie hier Ihr Passwort ein:", "OK",   "Abbrechen");
  352.     }
  353.   }
  354.   case DIALOG_WRONGPW:
  355.   {
  356.     if(!response)
  357.     {
  358.         Kick(playerid);
  359.     }
  360.     else
  361.     {
  362.          ShowPlayerDialog(playerid, DIALOG_LOGIN1, DIALOG_STYLE_INPUT,    "Login", "Geben Sie hier Ihr Passwort ein:", "OK",   "Abbrechen");
  363.     }
  364.   }
  365. }
  366.     return 1;
  367. }
  368.  
  369. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  370. {
  371.     return 1;
  372. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement