Advertisement
Guest User

Mein Gamemode

a guest
Jul 4th, 2012
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 22.66 KB | None | 0 0
  1. //----------------------------------------------------------
  2. //
  3. //  Multicraft hoch SAMP  Beta
  4. //  Ein Gamemode im Wolksschulalteralter
  5. //
  6. //----------------------------------------------------------
  7.  
  8. //Includes
  9. #include <a_samp>
  10. #include <core>
  11. #include <float>
  12. #include <dini>
  13. #include <md5>
  14. //#include <sscanf2>
  15. //
  16. //DCMD
  17. //#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd)
  18. //#include "../include/cmd.inc"
  19. //#include "../include/zcmd.inc"
  20. #include "../include/gl_common.inc"
  21.  
  22. #pragma tabsize 0
  23.  
  24. //----------------------------------------------------------
  25.  
  26. //Farben
  27. #define COLOR_WHITE         0xFFFFFFFF
  28. #define COLOR_NORMAL_PLAYER 0xFFBB7777
  29. #define RED 0xFF000FFF
  30. #define COLOR_RED 0xFF000FFF
  31. #define GREEN 0x00CA00FF
  32. #define ORANGE 0xFFDC00FF
  33. #define BLUE 0x00C3FFFF
  34.  
  35. //Dialoge
  36. #define REGISTER 1
  37. #define LOGIN 2
  38. #define KAUFEN 3 //Ammunation
  39.  
  40. //Fraktionsdefines
  41.  
  42. #define sFraktion "LSPD"
  43. #define sFraktion2 "FBI"
  44. #define sFraktion3 "Army"
  45. #define sFraktion4 "Ballas"
  46. #define sFraktion5 "MS13"
  47. #define sFraktion6 "Aztekas"
  48. #define sFraktion7 "Yakuzza"
  49.  
  50. //Enum
  51. enum SpielerDaten
  52. {
  53.     Adminlevel,
  54.     Level,
  55.     Geld,
  56.     Fraktion,
  57.     Team,
  58.     Job,
  59.     sLogin
  60. };
  61.  
  62. new sSpieler[MAX_PLAYERS][SpielerDaten];
  63.  
  64. new total_vehicles_from_files=0;
  65. new waffenp;
  66. new waffenp1;
  67. new waffenp2;
  68. new waffenp3;
  69. new waffenp4;
  70. new waffenp5;
  71. new health;
  72. new armour;
  73. new ammunationp;
  74. new spawnp;
  75. new stadthallep;
  76. new airportp;
  77. new bsnp;
  78. new bsnein, bsnaus;
  79. new pdein, pdaus;
  80. new halleein, halleaus;
  81. new pdhintenein, pdhintenaus;
  82.  
  83. main()
  84. {
  85.     print("\n---------------------------------------");
  86.     print("     startradeirrers Gamemode 1.0\n");
  87.     print("         Grundlage: grandlarc\n");
  88.     print("---------------------------------------\n");
  89. }
  90.  
  91. //----------------------------------------------------------
  92.  
  93. public OnPlayerConnect(playerid)
  94. {
  95.     new Spieler[64];
  96.     new Sname[MAX_PLAYER_NAME];
  97.     GetPlayerName(playerid,Sname,sizeof(Sname));
  98.     format(Spieler,sizeof(Spieler),"/Spieler/%s.txt",Sname);
  99.     if(dini_Exists(Spieler))
  100.     {
  101.         SendClientMessage(playerid,GREEN,"Herzlich willkommen zurück!");
  102.         ShowPlayerDialog(playerid,LOGIN,DIALOG_STYLE_PASSWORD,"Login","Bitte logge dich mit deinem Passwort ein.","Login","Abbrechen");
  103.         return 1;
  104.     }
  105.     else
  106.     {
  107.         SendClientMessage(playerid,GREEN,"Wilkommen auf Multicraft hoch SAMP!");
  108.         ShowPlayerDialog(playerid,REGISTER,DIALOG_STYLE_PASSWORD,"Registrieren","Bitte wähle ein Passwort um dir einen Account zu erstellen!","Registrieren","Abbrechen");
  109.         return 1;
  110.     }
  111. }
  112.  
  113. //----------------------------------------------------------
  114.  
  115. public OnPlayerDisconnect(playerid,reason)
  116. {
  117.     sSpieler[playerid][sLogin] = 0;
  118.     SpielerSpeichern(playerid);
  119.     return 1;
  120. }
  121.  
  122. //----------------------------------------------------------
  123.  
  124. public OnPlayerSpawn(playerid)
  125. {
  126.     if(IstSpielerInFraktion(playerid, 0))
  127.     {
  128.     SetPlayerPos(playerid,1544.2471,-1675.5847,13.5580);
  129.     SetPlayerFacingAngle(playerid,90.2913);
  130.     SetPlayerColor(playerid,COLOR_WHITE);
  131.     return 1;
  132.     }
  133.     return 1;
  134. }
  135.  
  136. //----------------------------------------------------------
  137.  
  138. public OnPlayerDeath(playerid, killerid, reason)
  139. {
  140.     SendClientMessage(playerid, RED,"Du bist gestorben und wirst in Kürze wiederbelebt.");
  141.     return 1;
  142. }
  143.  
  144. public OnGameModeInit()
  145. {
  146.     SetGameModeText("Multicraft hoch SAMP v. 1.0");
  147.     ShowPlayerMarkers(PLAYER_MARKERS_MODE_GLOBAL);
  148.     ShowNameTags(1);
  149.     SetNameTagDrawDistance(200.0);
  150.     EnableStuntBonusForAll(0);
  151.     DisableInteriorEnterExits();
  152.     SetWeather(1);
  153.     SetWorldTime(8);
  154.  
  155.     //UsePlayerPedAnims();
  156.     //ManualVehicleEngineAndLights();
  157.     LimitGlobalChatRadius(300.0);
  158.  
  159.     //ClassSel_InitTextDraws();
  160.  
  161.     // Player Class
  162.     AddPlayerClass(0,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  163.    
  164.     //Pickups
  165.     waffenp = CreatePickup(348,2,1455.5518,-633.6309,95.6441,-1); //WaffenID 24
  166.     waffenp1 = CreatePickup(355,2,1452.6099,-633.2449,95.6202,-1); //WaffenID 30
  167.     waffenp2 = CreatePickup(350,2,1449.5490,-632.9955,95.6053,-1); //WaffenID 26
  168.     waffenp3 = CreatePickup(357,2,1447.5753,-633.2326,95.6028,-1); //WaffenID 33
  169.     waffenp4 = CreatePickup(358,2,1445.8457,-632.9443,95.5453,-1); //WaffenID 34
  170.     waffenp5 = CreatePickup(341,2,1449.6918,-635.3456,95.7098,-1); //WaffenID 9
  171.     health = CreatePickup(1240,2,1304.6919,-799.9371,83.9464,-1); //Heilpickup
  172.     armour = CreatePickup(1242,2,1299.2537,-805.5278,83.9458,-1); //Armourpickup
  173.     ammunationp = CreatePickup(1239,2,1364.9880,-1280.9052,13.5469,-1); //Pickup Ammunation
  174.     spawnp = CreatePickup(1239,2,1540.6650,-1675.5867,13.5510,-1); //Pickup Spawn
  175.     stadthallep = CreatePickup(1239,2,1482.6259,-1745.4030,13.5469,-1); //Pickup Stadthalle
  176.     airportp = CreatePickup(1239,2,1958.1447,-2183.0486,13.5469,-1); //Pickup Flughafen
  177.     bsnp = CreatePickup(1239,2,1218.5062,-919.8875,43.0938,-1); //Pickup BSN
  178.     bsnein = CreatePickup(1239,2,1199.3717,-919.7115,43.1106,-1); //BSN Eingangspickup
  179.     bsnaus = CreatePickup(1239,2,362.8491,-75.1472,1001.5078,-1); //BSN Ausgangspickup
  180.     pdein = CreatePickup(1239,2,1553.4125,-1675.6256,16.1953,-1); //PD Eingangspickup
  181.     pdaus = CreatePickup(1239,2,246.7719,63.9181,1003.6406,-1); //PD Ausgangspickup
  182.     pdhintenaus = CreatePickup(1239,2,246.2794,87.7699,1003.6406,-1); //PD Garagenausgangspickup
  183.     pdhintenein = CreatePickup(1239,2,246.7719,63.9181,1003.6406,-1); //PD Garageneingangspickup
  184.     halleein = CreatePickup(1239,2,1480.9960,-1771.5686,18.7958,-1); //Stadthalle Eingangspickup
  185.     halleaus = CreatePickup(1239,2,389.6272,173.6639,1008.3828,-1); //Stadthalle Eingagspickup
  186.    
  187.     //AUTOS
  188.     AddStaticVehicleEx(591,2071.208496,-2259.442138,13.546875,350.782684,-1,-1,1000); //Anhänger 1 bei LS Airport
  189.     AddStaticVehicleEx(435,2082.278564,-2256.433593,13.546875,11.248397,-1,-1,1000); //Anhänger 2 bei LS Airport
  190.     AddStaticVehicleEx(584,2059.922851,-2251.234375,13.546875,13.546986,-1,-1,1000); //Anhänger 3 bei LS Airport
  191.     AddStaticVehicleEx(450,2107.950292,-2226.236816,13.546875,57.786376,-1,-1,500); //Adminanhänger bei LS Airport
  192.     AddStaticVehicleEx(403,2112.409423,-2218.134033,13.546875,43.619686,-1,-1,500); //Adminlkw bei LS Airport
  193.     AddStaticVehicleEx(514,2066.249267,-2231.080078,13.546875,268.677490,-1,-1,1000); //LKW 1 bei LS Airport
  194.     AddStaticVehicleEx(515,2067.681884,-2224.559326,13.546875,266.566467,-1,-1,1000); //LKW 2 bei LS Airport
  195.     AddStaticVehicleEx(497,1566.4586,-1696.1453,28.5729,89.4412,0,1,1000); // Maverick 2
  196.     AddStaticVehicleEx(497,1566.8933,-1654.9128,28.5725,90.9454,0,1,1000); // Maverick 1
  197.     AddStaticVehicleEx(469,1555.7402,-1708.7338,28.4049,91.9640,1,3,1000); // Sparrow
  198.     AddStaticVehicleEx(427,1526.8712,-1644.8733,6.0224,179.8539,0,1,1000); // BigLSPD 1
  199.     AddStaticVehicleEx(427,1530.4648,-1644.6914,6.0206,179.9183,0,1,1000); // BigLSPD 2
  200.     AddStaticVehicleEx(427,1534.2761,-1645.4604,6.0224,179.5744,0,1,1000); // BigLSPD 3
  201.     AddStaticVehicleEx(427,1538.5104,-1645.4598,6.0221,180.5101,0,1,1000); // BigLSPD 4
  202.     AddStaticVehicleEx(599,1529.7079,-1683.9714,6.0870,270.1451,0,1,1000); // Rancher 1
  203.     AddStaticVehicleEx(599,1529.6732,-1688.0631,6.0746,270.0016,0,1,1000); // Rancher 2
  204.     AddStaticVehicleEx(596,1558.7455,-1710.6108,5.6122,1.0313,0,1,1000); // LSPD 1
  205.     AddStaticVehicleEx(596,1574.8055,-1709.8676,5.6093,359.7434,0,1,1000); // LSPD 2
  206.     AddStaticVehicleEx(596,1578.6281,-1710.5074,5.6140,358.9394,0,1,1000); // LSPD 4
  207.     AddStaticVehicleEx(596,1574.6895,-1709.9469,5.6122,357.4922,0,1,1000); // LSPD 3
  208.     AddStaticVehicleEx(596,1583.2200,-1709.5779,5.6112,359.4655,0,1,1000); // LSPD 5
  209.     AddStaticVehicleEx(596,1587.1185,-1709.7668,5.6137,0.0997,0,1,1000); // LSPD 6
  210.     AddStaticVehicleEx(596,1591.4589,-1710.0125,5.6121,358.5331,0,1,1000); // LSPD 7
  211.     AddStaticVehicleEx(596,1595.4803,-1710.3607,5.6119,0.8738,0,1,1000); // LSPD 8
  212.     AddStaticVehicleEx(596,1535.9893,-1667.1741,13.1040,179.8182,0,1,1000); // LSPDreserve 1
  213.     AddStaticVehicleEx(596,1535.9115,-1678.0026,13.1040,359.4956,0,1,1000); // LSPDreserve 2
  214.     AddStaticVehicleEx(528,1585.2532,-1671.6281,5.9389,270.5406,0,0,1000); // SAPD 1
  215.     AddStaticVehicleEx(528,1586.1592,-1667.5050,5.9364,270.3068,0,0,1000); // SAPD 2
  216.     AddStaticVehicleEx(523,1600.3201,-1704.2484,5.4624,91.3720,0,0,1000); // SAPDMoped 1
  217.     AddStaticVehicleEx(523,1600.3588,-1700.0323,5.4547,90.7959,0,0,1000); // SAPDMoped 2
  218.     AddStaticVehicleEx(523,1600.0229,-1696.1625,5.4532,88.2806,0,0,1000); // SAPDMoped 3
  219.     AddStaticVehicleEx(523,1600.7960,-1691.8236,5.4623,93.0030,0,0,1000); // SAPDMoped 4
  220.     AddStaticVehicleEx(490,1546.3872,-1667.9408,6.0185,90.5427,0,0,1000); // FBI 1
  221.     AddStaticVehicleEx(490,1544.7795,-1671.6252,6.0160,90.0605,0,0,1000); // FBI 2
  222.     AddStaticVehicleEx(490,1544.3448,-1676.3895,6.0198,90.6224,0,0,1000); // FBI 3
  223.     AddStaticVehicleEx(490,1544.9325,-1680.3214,6.0172,90.0709,0,0,1000); // FBI 4
  224.     AddStaticVehicleEx(490,1544.5400,-1684.3384,6.0176,89.7572,0,0,1000); // FBI 5
  225.     AddStaticVehicleEx(601,1564.4257,-1710.5500,5.6492,359.4589,1,1,1000); // Wasserpanzer
  226.     AddStaticVehicleEx(522,1244.2286,-2014.1510,59.6829,182.0901,-1,-1,1000); // NRG
  227.     AddStaticVehicleEx(451,1258.8634,-2010.2906,59.2586,180.3729,-1,-1,1000); // Turismo
  228.     AddStaticVehicleEx(541,1561.0652,-2247.6069,13.3545,89.8886,-1,-1,1000); // Bullet
  229.     AddStaticVehicleEx(506,1559.6094,-2254.3352,13.3560,89.8563,-1,-1,1000); // Super GT
  230.     AddStaticVehicleEx(451,1559.7225,-2257.4397,13.3558,89.4232,-1,-1,1000); // Turismo
  231.     AddStaticVehicleEx(463,1560.1416,-2264.1846,13.3525,88.8489,-1,-1,1000); // Freeway
  232.     AddStaticVehicleEx(477,1559.9653,-2315.6958,13.3559,90.4307,-1,-1,1000); // ZR-350
  233.     AddStaticVehicleEx(403,1559.8176,-2321.7371,13.3553,90.2342,-1,-1,1000); // Linerunner
  234.     AddStaticVehicleEx(534,1559.9956,-2334.9595,13.3540,89.6849,-1,-1,1000); // Remington
  235.     AddStaticVehicleEx(407,1549.5879,-2360.7024,13.3616,359.7001,-1,-1,1000); // Firetruck
  236.     AddStaticVehicleEx(413,1539.6403,-2361.7542,13.3624,358.8525,-1,-1,1000); // PKW
  237.     AddStaticVehicleEx(409,1496.8121,-2361.2959,13.3548,91.1301,-1,-1,1000); // Limousine
  238.     AddStaticVehicleEx(431,1490.8409,-2336.4792,13.2686,97.5095,-1,-1,1000); // Bus
  239.     AddStaticVehicleEx(508,1529.3357,-2361.6511,13.3601,0.8585,-1,-1,1000); // Wohnwagen
  240.  
  241.     // SPECIAL
  242.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/trains.txt");
  243.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/pilots.txt");
  244.  
  245.     // LAS VENTURAS
  246.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_law.txt"); //Wahrscheinlich PD
  247.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_airport.txt");
  248.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_gen.txt");
  249.  
  250.     // SAN FIERRO
  251.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_law.txt"); //Wahrscheinlich PD
  252.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_airport.txt");
  253.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_gen.txt");
  254.  
  255.     // LOS SANTOS
  256.     //total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_law.txt"); //Wahrscheinlich PD
  257.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_airport.txt");
  258.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_inner.txt");
  259.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_outer.txt");
  260.  
  261.     // OTHER AREAS
  262.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/whetstone.txt");
  263.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/bone.txt");
  264.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/flint.txt");
  265.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/tierra.txt");
  266.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/red_county.txt");
  267.  
  268.     printf("Total vehicles from files: %d",total_vehicles_from_files);
  269.  
  270.     return 1;
  271. }
  272.  
  273. //----------------------------------------------------------
  274.  
  275. public OnPlayerPickUpPickup(playerid, pickupid)
  276. {
  277.     if(pickupid == waffenp)
  278.     {
  279.         SendClientMessage(playerid,GREEN,"Hier ist deine Desert Eagle.");
  280.         GivePlayerWeapon(playerid,24,10000);
  281.     }
  282.     if(pickupid == waffenp1)
  283.     {
  284.         SendClientMessage(playerid,GREEN,"Hier ist deine AK-47.");
  285.         GivePlayerWeapon(playerid,30,10000);
  286.     }
  287.     if(pickupid == waffenp2)
  288.     {
  289.         SendClientMessage(playerid,GREEN,"Hier ist deine Shotgun.");
  290.         GivePlayerWeapon(playerid,26,10000);
  291.     }
  292.     if(pickupid == waffenp3)
  293.     {
  294.         SendClientMessage(playerid,GREEN,"Hier ist dein Gewehr.");
  295.         GivePlayerWeapon(playerid,33,10000);
  296.     }
  297.     if(pickupid == waffenp4)
  298.     {
  299.         SendClientMessage(playerid,GREEN,"Hier ist deine Sniper.");
  300.         GivePlayerWeapon(playerid,34,10000);
  301.     }
  302.     if(pickupid == waffenp5)
  303.     {
  304.         SendClientMessage(playerid,GREEN,"Hier ist deine Kettensäge.");
  305.         GivePlayerWeapon(playerid,9,10000);
  306.     }
  307.     if(pickupid == health)
  308.     {
  309.         SendClientMessage(playerid,GREEN,"Du hast dich erfolgreich geheilt.");
  310.         SetPlayerHealth(playerid,100.0);
  311.     }
  312.     if(pickupid == armour)
  313.     {
  314.         SendClientMessage(playerid,GREEN,"Du hast dir eine Rüstung angezogen.");
  315.         SetPlayerArmour(playerid,100.0);
  316.     }
  317.     if(pickupid == ammunationp)
  318.     {
  319.         SendClientMessage(playerid,BLUE,"Hier kannst du zukünftig Waffen kaufen.");
  320.         SendClientMessage(playerid,BLUE,"Für diese Waffen benötigst du dann einen Waffenschein, den du ab Lvl 5 machen kannst.");
  321.     }
  322.     if(pickupid == spawnp)
  323.     {
  324.         SendClientMessage(playerid,BLUE,"Du bist so eben in ein Tutorialicon gelaufen.");
  325.         SendClientMessage(playerid,BLUE,"In der Stadt sind noch 4 weitere verteilt. Jeweils bei:");
  326.         SendClientMessage(playerid,BLUE,"Ammunation, Stadthalle, Flughafen, BSN");
  327.         SendClientMessage(playerid,BLUE,"Sie werden dir helfen die Stadt besser kennen zu lernen.");
  328.         SendClientMessage(playerid,BLUE,"Wenn du noch Fragen hast, rufe mit der Taste T den Chat auf und frage einen Admin.");
  329.         SendClientMessage(playerid,BLUE,"Viel Spass am Betaserver ;)");
  330.     }
  331.     if(pickupid == stadthallep)
  332.     {
  333.         SendClientMessage(playerid,BLUE,"Dies ist die Stadthalle.");
  334.         SendClientMessage(playerid,BLUE,"In ihr kannst du bald Jobs annehmen, Arbeitslosengeld erhalten");
  335.         SendClientMessage(playerid,BLUE,"oder Pässe für SF(Linke Stadt) und LV(rechte Stadt) kaufen.");
  336.     }
  337.     if(pickupid == airportp)
  338.     {
  339.         SendClientMessage(playerid,BLUE,"Du bist hier am Flughafen.");
  340.         SendClientMessage(playerid,BLUE,"Wenn du mit einem Admin Anhänger nach LV oder SF bringen willst");
  341.         SendClientMessage(playerid,BLUE,"um Geld zu verdienen, frag einfach im Chat. Zukünftig werden hier auch 2 Jobs zur Verfügung stehen.");
  342.     }
  343.     if(pickupid == bsnp)
  344.     {
  345.         SendClientMessage(playerid,BLUE,"Dies ist der BSN(Burgershot Nord)");
  346.         SendClientMessage(playerid,BLUE,"Zukünftig kannst du hier Werbung machen oder einen Snack zu dir nehmen.");
  347.         SendClientMessage(playerid,BLUE,"Außerdem wird dies der offizielle Notfall-Helikopter-Landeplatz,");
  348.         SendClientMessage(playerid,BLUE,"falls eine Atombombe die Stadt bedrohen sollte.");
  349.     }
  350.     if(pickupid == bsnein)
  351.     {
  352.         SetPlayerPos(playerid,365.7950,-73.5316,1001.5078);
  353.         SetPlayerFacingAngle(playerid,275.1471);
  354.         SetPlayerInterior(playerid,10);
  355.     }
  356.     if(pickupid == bsnaus)
  357.     {
  358.         SetPlayerPos(playerid,1199.9760,-923.5488,43.0196);
  359.         SetPlayerFacingAngle(playerid,185.6288);
  360.         SetPlayerInterior(playerid,0);
  361.     }
  362.     if(pickupid == pdhintenein)
  363.     {
  364.         SetPlayerPos(playerid,246.7840,67.2651,1003.6406);
  365.         SetPlayerFacingAngle(playerid,360.0000);
  366.         SetPlayerInterior(playerid,6);
  367.     }
  368.     if(pickupid == pdhintenaus)
  369.     {
  370.         SetPlayerPos(playerid,246.5622,84.5756,1003.6406);
  371.         SetPlayerFacingAngle(playerid,185.4882);
  372.         SetPlayerInterior(playerid,0);
  373.     }
  374.     if(pickupid == pdein)
  375.     {
  376.         SetPlayerPos(playerid,246.7840,67.2651,1003.6406);
  377.         SetPlayerFacingAngle(playerid,360.0000);
  378.         SetPlayerInterior(playerid,6);
  379.     }
  380.     if(pickupid == pdaus)
  381.     {
  382.         SetPlayerPos(playerid,1549.5044,-1675.7581,14.9966);
  383.         SetPlayerFacingAngle(playerid,101.5772);
  384.         SetPlayerInterior(playerid,0);
  385.     }
  386.     if(pickupid == halleein)
  387.     {
  388.         SetPlayerPos(playerid,384.808624,173.804992,1008.382812);
  389.         SetPlayerFacingAngle(playerid,90.0000);
  390.         SetPlayerInterior(playerid,3);
  391.     }
  392.     if(pickupid == halleaus)
  393.     {
  394.         SetPlayerPos(playerid,390.5121,173.8782,1008.3828);
  395.         SetPlayerFacingAngle(playerid,1.4473);
  396.         SetPlayerInterior(playerid,0);
  397.     }
  398.     return 1;
  399. }
  400.  
  401. //----------------------------------------------------------
  402.  
  403. public OnPlayerCommandText(playerid, cmdtext[])
  404. {
  405.     if (strcmp("/help", cmdtext, true, 10) == 0)
  406.     {
  407.         SendClientMessage(playerid, ORANGE,"/buy um in Ammunation Waffen zu kaufen.");
  408.         SendClientMessage(playerid, ORANGE,"/lapon um deinen Laptop einzuschalten.");
  409.         SendClientMessage(playerid, ORANGE,"/buy-laptop um im 24/7 Shop einen Laptop zu kaufen.");
  410.         SendClientMessage(playerid, ORANGE,"");
  411.         return 1;
  412.     }
  413.  
  414.     if (strcmp("/buy",cmdtext,true, 10) == 0)
  415.     {
  416.         ShowPlayerDialog(playerid,KAUFEN,DIALOG_STYLE_LIST,"Ammunation","Desert Eagle\nCombat Shotgun\nAK-47\nCountry Rifle","Kaufen","Abbrechen");
  417.         return 1;
  418.     }
  419.  
  420.     if (strcmp("/tspawn",cmdtext,true, 10) == 0)
  421.     {
  422.         SetPlayerPos(playerid,1545.0699,-1675.2336,13.5596);
  423.         SendClientMessage(playerid,ORANGE,"Du bist wieder am Spawn.");
  424.         return 1;
  425.     }
  426.  
  427.     if (strcmp("/tflughafen",cmdtext,true, 10) == 0)
  428.     {
  429.         SetPlayerPos(playerid,1961.2206,-2180.3999,13.5469);
  430.         SendClientMessage(playerid,ORANGE,"Du bist nun vor dem LS Airport.");
  431.         return 1;
  432.     }
  433.    
  434.     if (strcmp("/tvilla",cmdtext,true, 10) == 0)
  435.     {
  436.         SetPlayerPos(playerid,1238.2783,-2036.9137,59.8516);
  437.         SendClientMessage(playerid,ORANGE,"Du bist nun beim Präsidentenhaus.");
  438.         return 1;
  439.     }
  440.  
  441.     if (strcmp("/credits", cmdtext, true, 10) == 0)
  442.     {
  443.         SendClientMessage(playerid,BLUE,"Serverversion 1.0/n Gescriptet by startradeirrer/n gehostet by startradeirrer");
  444.         return 1;
  445.     }
  446.  
  447. //----------------------------------------------------------
  448.  
  449. public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[])
  450. {
  451.     if(dialogid == KAUFEN)
  452.     {
  453.         if(response == 0)
  454.             return 1;
  455.             if(response == 1)
  456.             {
  457.                 if(listitem == 1)
  458.                 {
  459.                     GivePlayerWeapon(playerid,24,555);
  460.                     SendClientMessage(playerid,GREEN,"Du hast dir erfolgreich eine Desert Eagle gekauft.");
  461.                 }
  462.                 if(listitem == 2)
  463.                 {
  464.                     GivePlayerWeapon(playerid,27,750);
  465.                     SendClientMessage(playerid,GREEN,"Du hast dir erfolgreich eine Combat Shotgun gekauft.");
  466.                 }
  467.                 if(listitem == 3)
  468.                 {
  469.                     GivePlayerWeapon(playerid,30,555);
  470.                     SendClientMessage(playerid,GREEN,"Du hast dir erfolgreich eine AK-47 gekauft.");
  471.                 }
  472.                 if(listitem == 4)
  473.                 {
  474.                     GivePlayerWeapon(playerid,33,475);
  475.                     SendClientMessage(playerid,GREEN,"Du hast dir erfolgreich eine Country Rifle gekauft.");
  476.                 }
  477.             }
  478.      }
  479.  
  480.     if(dialogid == LOGIN)
  481.     {
  482.         if(response == 0)
  483.         {
  484.             SendClientMessage(playerid,RED,"Du hast den Login abgelehnt.");
  485.             Kick(playerid);
  486.             return 1;
  487.         }
  488.         if(response == 1)
  489.         {
  490.             Login(playerid,MD5_Hash(inputtext));
  491.             return 1;
  492.         }
  493.     }
  494.     if(dialogid == REGISTER)
  495.     {
  496.         if(response == 0)
  497.         {
  498.             SendClientMessage(playerid,RED,"Du hast die Registrierung abgelehnt, daher wurdest du gekickt.");
  499.             Kick(playerid);
  500.             return 1;
  501.         }
  502.         if (response == 1)
  503.         {
  504.             if(!strlen(inputtext))
  505.             {
  506.                 SendClientMessage(playerid,GREEN,"Bitte gib ein Passwort ein.");
  507.                 ShowPlayerDialog(playerid,REGISTER,DIALOG_STYLE_PASSWORD,"Registrieren","Bitte wähle ein Passwort um dir einen Account zu erstellen!","Registrieren","Abbrechen");
  508.                 return 1;
  509.             }
  510.             Register(playerid,MD5_Hash(inputtext));
  511.             return 1;
  512.         }
  513.     }
  514.     return 1;
  515. }
  516.  
  517. //----------------------------------------------------------
  518.  
  519. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  520. {
  521.     return 1;
  522. }
  523. stock Register(playerid,key[])
  524.     {
  525.         new Spieler[64];
  526.         new Sname[MAX_PLAYER_NAME];
  527.         GetPlayerName(playerid,Sname,sizeof(Sname));
  528.         format(Spieler,sizeof(Spieler),"/Spieler/%s.txt",Sname);
  529.         dini_Create(Spieler);
  530.         dini_Set(Spieler,"Passwort",key);
  531.         dini_IntSet(Spieler,"Fraktion",0);
  532.         dini_IntSet(Spieler,"Adminlevel",0);
  533.         dini_IntSet(Spieler,"Level",0);
  534.         dini_IntSet(Spieler,"Geld",1000);
  535.         dini_IntSet(Spieler,"Fraktion",0);
  536.         dini_IntSet(Spieler,"Team",0);
  537.         dini_IntSet(Spieler,"Job",0);
  538.         SendClientMessage(playerid,GREEN,"Du hast dich erfolgreich registriert!");
  539.         SpielerReset(playerid);
  540.         return 1;
  541.     }
  542.    
  543. stock Login(playerid,key[])
  544. {
  545.     new Spieler[64];
  546.     new Sname[MAX_PLAYER_NAME];
  547.     GetPlayerName(playerid,Sname,sizeof(Sname));
  548.     format(Spieler,sizeof(Spieler),"/Spieler/%s.txt",Sname);
  549.     if(!strcmp(key,dini_Get(Spieler,"Passwort"),true))
  550.     {
  551.         SendClientMessage(playerid,GREEN,"Du hast dich erfolgreich eingeloggt.");
  552.         SpielerLaden(playerid);
  553.     }
  554.     else
  555.     {
  556.         SendClientMessage(playerid,GREEN,"Du hast ein falsches Passwort eingegeben!");
  557.         Kick(playerid);
  558.     }
  559.     return 1;
  560. }
  561.  
  562. stock SpielerSpeichern(playerid)
  563. {
  564.     new Spieler[64];
  565.     new Sname[MAX_PLAYER_NAME];
  566.     GetPlayerName(playerid,Sname,sizeof(Sname));
  567.     format(Spieler,sizeof(Spieler),"/Spieler/%s.txt",Sname);
  568.     if(dini_Exists(Spieler))
  569.     {
  570.         dini_IntSet(Spieler,"Adminlevel",sSpieler[playerid][Adminlevel]);
  571.         dini_IntSet(Spieler,"Level",sSpieler[playerid][Level]);
  572.         dini_IntSet(Spieler,"Geld",sSpieler[playerid][Geld]);
  573.         dini_IntSet(Spieler,"Fraktion",sSpieler[playerid][Fraktion]);
  574.         dini_IntSet(Spieler,"Team",sSpieler[playerid][Team]);
  575.         dini_IntSet(Spieler,"Job",sSpieler[playerid][Job]);
  576.     }
  577.     return 1;
  578. }
  579.  
  580. stock SpielerLaden(playerid)
  581. {
  582.     new Spieler[64];
  583.     new Sname[MAX_PLAYER_NAME];
  584.     GetPlayerName(playerid,Sname,sizeof(Sname));
  585.     format(Spieler,sizeof(Spieler),"/Spieler/%s.txt",Sname);
  586.     if(dini_Exists(Spieler))
  587.     {
  588.         SetPlayerScore(playerid,dini_Int(Spieler,"Level"));
  589.         sSpieler[playerid][Adminlevel] = dini_Int(Spieler,"Adminlevel");
  590.         sSpieler[playerid][Level] = dini_Int(Spieler,"Level");
  591.         sSpieler[playerid][Geld] = dini_Int(Spieler,"Geld");
  592.         sSpieler[playerid][Fraktion] = dini_Int(Spieler,"Fraktion");
  593.         sSpieler[playerid][Team] = dini_Int(Spieler,"Team");
  594.         sSpieler[playerid][Job] = dini_Int(Spieler,"Job");
  595.         sSpieler[playerid][sLogin] = 1;
  596.     }
  597.     return 1;
  598. }
  599.  
  600. stock SpielerReset(playerid)
  601. {
  602.     sSpieler[playerid][Adminlevel] = 0;
  603.     sSpieler[playerid][Level] = 0;
  604.     sSpieler[playerid][Geld] = 1000;
  605.     sSpieler[playerid][Fraktion] = 0;
  606.     sSpieler[playerid][Team] = 0;
  607.     sSpieler[playerid][Job] = 0;
  608.     return 1;
  609. }
  610.  
  611. //Login
  612.  
  613. stock IstSpielerLogged(playerid)
  614. {
  615.     if(sSpieler[playerid][Login] == 1) return 1;
  616.     return 0;
  617. }
  618.  
  619. //Fraktionen
  620. stock IstSpielerInFraktion(playerid,fraktionsid)
  621. {
  622.     if(sSpieler[playerid][sFraktion] == fraktionsid) return 1;
  623.     return 0;
  624. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement