Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //----------------------------------------------------------
- //
- // Multicraft hoch SAMP Beta
- // Ein Gamemode im Wolksschulalteralter
- //
- //----------------------------------------------------------
- //Includes
- #include <a_samp>
- #include <core>
- #include <float>
- #include <dini>
- #include <md5>
- //#include <sscanf2>
- //
- //DCMD
- //#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd)
- //#include "../include/cmd.inc"
- //#include "../include/zcmd.inc"
- #include "../include/gl_common.inc"
- #pragma tabsize 0
- //----------------------------------------------------------
- //Farben
- #define COLOR_WHITE 0xFFFFFFFF
- #define COLOR_NORMAL_PLAYER 0xFFBB7777
- #define RED 0xFF000FFF
- #define COLOR_RED 0xFF000FFF
- #define GREEN 0x00CA00FF
- #define ORANGE 0xFFDC00FF
- #define BLUE 0x00C3FFFF
- //Dialoge
- #define REGISTER 1
- #define LOGIN 2
- #define KAUFEN 3 //Ammunation
- //Fraktionsdefines
- #define sFraktion "LSPD"
- #define sFraktion2 "FBI"
- #define sFraktion3 "Army"
- #define sFraktion4 "Ballas"
- #define sFraktion5 "MS13"
- #define sFraktion6 "Aztekas"
- #define sFraktion7 "Yakuzza"
- //Enum
- enum SpielerDaten
- {
- Adminlevel,
- Level,
- Geld,
- Fraktion,
- Team,
- Job,
- sLogin
- };
- new sSpieler[MAX_PLAYERS][SpielerDaten];
- new total_vehicles_from_files=0;
- new waffenp;
- new waffenp1;
- new waffenp2;
- new waffenp3;
- new waffenp4;
- new waffenp5;
- new health;
- new armour;
- new ammunationp;
- new spawnp;
- new stadthallep;
- new airportp;
- new bsnp;
- new bsnein, bsnaus;
- new pdein, pdaus;
- new halleein, halleaus;
- new pdhintenein, pdhintenaus;
- main()
- {
- print("\n---------------------------------------");
- print(" startradeirrers Gamemode 1.0\n");
- print(" Grundlage: grandlarc\n");
- print("---------------------------------------\n");
- }
- //----------------------------------------------------------
- public OnPlayerConnect(playerid)
- {
- new Spieler[64];
- new Sname[MAX_PLAYER_NAME];
- GetPlayerName(playerid,Sname,sizeof(Sname));
- format(Spieler,sizeof(Spieler),"/Spieler/%s.txt",Sname);
- if(dini_Exists(Spieler))
- {
- SendClientMessage(playerid,GREEN,"Herzlich willkommen zurück!");
- ShowPlayerDialog(playerid,LOGIN,DIALOG_STYLE_PASSWORD,"Login","Bitte logge dich mit deinem Passwort ein.","Login","Abbrechen");
- return 1;
- }
- else
- {
- SendClientMessage(playerid,GREEN,"Wilkommen auf Multicraft hoch SAMP!");
- ShowPlayerDialog(playerid,REGISTER,DIALOG_STYLE_PASSWORD,"Registrieren","Bitte wähle ein Passwort um dir einen Account zu erstellen!","Registrieren","Abbrechen");
- return 1;
- }
- }
- //----------------------------------------------------------
- public OnPlayerDisconnect(playerid,reason)
- {
- sSpieler[playerid][sLogin] = 0;
- SpielerSpeichern(playerid);
- return 1;
- }
- //----------------------------------------------------------
- public OnPlayerSpawn(playerid)
- {
- if(IstSpielerInFraktion(playerid, 0))
- {
- SetPlayerPos(playerid,1544.2471,-1675.5847,13.5580);
- SetPlayerFacingAngle(playerid,90.2913);
- SetPlayerColor(playerid,COLOR_WHITE);
- return 1;
- }
- return 1;
- }
- //----------------------------------------------------------
- public OnPlayerDeath(playerid, killerid, reason)
- {
- SendClientMessage(playerid, RED,"Du bist gestorben und wirst in Kürze wiederbelebt.");
- return 1;
- }
- public OnGameModeInit()
- {
- SetGameModeText("Multicraft hoch SAMP v. 1.0");
- ShowPlayerMarkers(PLAYER_MARKERS_MODE_GLOBAL);
- ShowNameTags(1);
- SetNameTagDrawDistance(200.0);
- EnableStuntBonusForAll(0);
- DisableInteriorEnterExits();
- SetWeather(1);
- SetWorldTime(8);
- //UsePlayerPedAnims();
- //ManualVehicleEngineAndLights();
- LimitGlobalChatRadius(300.0);
- //ClassSel_InitTextDraws();
- // Player Class
- AddPlayerClass(0,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- //Pickups
- waffenp = CreatePickup(348,2,1455.5518,-633.6309,95.6441,-1); //WaffenID 24
- waffenp1 = CreatePickup(355,2,1452.6099,-633.2449,95.6202,-1); //WaffenID 30
- waffenp2 = CreatePickup(350,2,1449.5490,-632.9955,95.6053,-1); //WaffenID 26
- waffenp3 = CreatePickup(357,2,1447.5753,-633.2326,95.6028,-1); //WaffenID 33
- waffenp4 = CreatePickup(358,2,1445.8457,-632.9443,95.5453,-1); //WaffenID 34
- waffenp5 = CreatePickup(341,2,1449.6918,-635.3456,95.7098,-1); //WaffenID 9
- health = CreatePickup(1240,2,1304.6919,-799.9371,83.9464,-1); //Heilpickup
- armour = CreatePickup(1242,2,1299.2537,-805.5278,83.9458,-1); //Armourpickup
- ammunationp = CreatePickup(1239,2,1364.9880,-1280.9052,13.5469,-1); //Pickup Ammunation
- spawnp = CreatePickup(1239,2,1540.6650,-1675.5867,13.5510,-1); //Pickup Spawn
- stadthallep = CreatePickup(1239,2,1482.6259,-1745.4030,13.5469,-1); //Pickup Stadthalle
- airportp = CreatePickup(1239,2,1958.1447,-2183.0486,13.5469,-1); //Pickup Flughafen
- bsnp = CreatePickup(1239,2,1218.5062,-919.8875,43.0938,-1); //Pickup BSN
- bsnein = CreatePickup(1239,2,1199.3717,-919.7115,43.1106,-1); //BSN Eingangspickup
- bsnaus = CreatePickup(1239,2,362.8491,-75.1472,1001.5078,-1); //BSN Ausgangspickup
- pdein = CreatePickup(1239,2,1553.4125,-1675.6256,16.1953,-1); //PD Eingangspickup
- pdaus = CreatePickup(1239,2,246.7719,63.9181,1003.6406,-1); //PD Ausgangspickup
- pdhintenaus = CreatePickup(1239,2,246.2794,87.7699,1003.6406,-1); //PD Garagenausgangspickup
- pdhintenein = CreatePickup(1239,2,246.7719,63.9181,1003.6406,-1); //PD Garageneingangspickup
- halleein = CreatePickup(1239,2,1480.9960,-1771.5686,18.7958,-1); //Stadthalle Eingangspickup
- halleaus = CreatePickup(1239,2,389.6272,173.6639,1008.3828,-1); //Stadthalle Eingagspickup
- //AUTOS
- AddStaticVehicleEx(591,2071.208496,-2259.442138,13.546875,350.782684,-1,-1,1000); //Anhänger 1 bei LS Airport
- AddStaticVehicleEx(435,2082.278564,-2256.433593,13.546875,11.248397,-1,-1,1000); //Anhänger 2 bei LS Airport
- AddStaticVehicleEx(584,2059.922851,-2251.234375,13.546875,13.546986,-1,-1,1000); //Anhänger 3 bei LS Airport
- AddStaticVehicleEx(450,2107.950292,-2226.236816,13.546875,57.786376,-1,-1,500); //Adminanhänger bei LS Airport
- AddStaticVehicleEx(403,2112.409423,-2218.134033,13.546875,43.619686,-1,-1,500); //Adminlkw bei LS Airport
- AddStaticVehicleEx(514,2066.249267,-2231.080078,13.546875,268.677490,-1,-1,1000); //LKW 1 bei LS Airport
- AddStaticVehicleEx(515,2067.681884,-2224.559326,13.546875,266.566467,-1,-1,1000); //LKW 2 bei LS Airport
- AddStaticVehicleEx(497,1566.4586,-1696.1453,28.5729,89.4412,0,1,1000); // Maverick 2
- AddStaticVehicleEx(497,1566.8933,-1654.9128,28.5725,90.9454,0,1,1000); // Maverick 1
- AddStaticVehicleEx(469,1555.7402,-1708.7338,28.4049,91.9640,1,3,1000); // Sparrow
- AddStaticVehicleEx(427,1526.8712,-1644.8733,6.0224,179.8539,0,1,1000); // BigLSPD 1
- AddStaticVehicleEx(427,1530.4648,-1644.6914,6.0206,179.9183,0,1,1000); // BigLSPD 2
- AddStaticVehicleEx(427,1534.2761,-1645.4604,6.0224,179.5744,0,1,1000); // BigLSPD 3
- AddStaticVehicleEx(427,1538.5104,-1645.4598,6.0221,180.5101,0,1,1000); // BigLSPD 4
- AddStaticVehicleEx(599,1529.7079,-1683.9714,6.0870,270.1451,0,1,1000); // Rancher 1
- AddStaticVehicleEx(599,1529.6732,-1688.0631,6.0746,270.0016,0,1,1000); // Rancher 2
- AddStaticVehicleEx(596,1558.7455,-1710.6108,5.6122,1.0313,0,1,1000); // LSPD 1
- AddStaticVehicleEx(596,1574.8055,-1709.8676,5.6093,359.7434,0,1,1000); // LSPD 2
- AddStaticVehicleEx(596,1578.6281,-1710.5074,5.6140,358.9394,0,1,1000); // LSPD 4
- AddStaticVehicleEx(596,1574.6895,-1709.9469,5.6122,357.4922,0,1,1000); // LSPD 3
- AddStaticVehicleEx(596,1583.2200,-1709.5779,5.6112,359.4655,0,1,1000); // LSPD 5
- AddStaticVehicleEx(596,1587.1185,-1709.7668,5.6137,0.0997,0,1,1000); // LSPD 6
- AddStaticVehicleEx(596,1591.4589,-1710.0125,5.6121,358.5331,0,1,1000); // LSPD 7
- AddStaticVehicleEx(596,1595.4803,-1710.3607,5.6119,0.8738,0,1,1000); // LSPD 8
- AddStaticVehicleEx(596,1535.9893,-1667.1741,13.1040,179.8182,0,1,1000); // LSPDreserve 1
- AddStaticVehicleEx(596,1535.9115,-1678.0026,13.1040,359.4956,0,1,1000); // LSPDreserve 2
- AddStaticVehicleEx(528,1585.2532,-1671.6281,5.9389,270.5406,0,0,1000); // SAPD 1
- AddStaticVehicleEx(528,1586.1592,-1667.5050,5.9364,270.3068,0,0,1000); // SAPD 2
- AddStaticVehicleEx(523,1600.3201,-1704.2484,5.4624,91.3720,0,0,1000); // SAPDMoped 1
- AddStaticVehicleEx(523,1600.3588,-1700.0323,5.4547,90.7959,0,0,1000); // SAPDMoped 2
- AddStaticVehicleEx(523,1600.0229,-1696.1625,5.4532,88.2806,0,0,1000); // SAPDMoped 3
- AddStaticVehicleEx(523,1600.7960,-1691.8236,5.4623,93.0030,0,0,1000); // SAPDMoped 4
- AddStaticVehicleEx(490,1546.3872,-1667.9408,6.0185,90.5427,0,0,1000); // FBI 1
- AddStaticVehicleEx(490,1544.7795,-1671.6252,6.0160,90.0605,0,0,1000); // FBI 2
- AddStaticVehicleEx(490,1544.3448,-1676.3895,6.0198,90.6224,0,0,1000); // FBI 3
- AddStaticVehicleEx(490,1544.9325,-1680.3214,6.0172,90.0709,0,0,1000); // FBI 4
- AddStaticVehicleEx(490,1544.5400,-1684.3384,6.0176,89.7572,0,0,1000); // FBI 5
- AddStaticVehicleEx(601,1564.4257,-1710.5500,5.6492,359.4589,1,1,1000); // Wasserpanzer
- AddStaticVehicleEx(522,1244.2286,-2014.1510,59.6829,182.0901,-1,-1,1000); // NRG
- AddStaticVehicleEx(451,1258.8634,-2010.2906,59.2586,180.3729,-1,-1,1000); // Turismo
- AddStaticVehicleEx(541,1561.0652,-2247.6069,13.3545,89.8886,-1,-1,1000); // Bullet
- AddStaticVehicleEx(506,1559.6094,-2254.3352,13.3560,89.8563,-1,-1,1000); // Super GT
- AddStaticVehicleEx(451,1559.7225,-2257.4397,13.3558,89.4232,-1,-1,1000); // Turismo
- AddStaticVehicleEx(463,1560.1416,-2264.1846,13.3525,88.8489,-1,-1,1000); // Freeway
- AddStaticVehicleEx(477,1559.9653,-2315.6958,13.3559,90.4307,-1,-1,1000); // ZR-350
- AddStaticVehicleEx(403,1559.8176,-2321.7371,13.3553,90.2342,-1,-1,1000); // Linerunner
- AddStaticVehicleEx(534,1559.9956,-2334.9595,13.3540,89.6849,-1,-1,1000); // Remington
- AddStaticVehicleEx(407,1549.5879,-2360.7024,13.3616,359.7001,-1,-1,1000); // Firetruck
- AddStaticVehicleEx(413,1539.6403,-2361.7542,13.3624,358.8525,-1,-1,1000); // PKW
- AddStaticVehicleEx(409,1496.8121,-2361.2959,13.3548,91.1301,-1,-1,1000); // Limousine
- AddStaticVehicleEx(431,1490.8409,-2336.4792,13.2686,97.5095,-1,-1,1000); // Bus
- AddStaticVehicleEx(508,1529.3357,-2361.6511,13.3601,0.8585,-1,-1,1000); // Wohnwagen
- // SPECIAL
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/trains.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/pilots.txt");
- // LAS VENTURAS
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_law.txt"); //Wahrscheinlich PD
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_airport.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_gen.txt");
- // SAN FIERRO
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_law.txt"); //Wahrscheinlich PD
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_airport.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_gen.txt");
- // LOS SANTOS
- //total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_law.txt"); //Wahrscheinlich PD
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_airport.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_inner.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_outer.txt");
- // OTHER AREAS
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/whetstone.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/bone.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/flint.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/tierra.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/red_county.txt");
- printf("Total vehicles from files: %d",total_vehicles_from_files);
- return 1;
- }
- //----------------------------------------------------------
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- if(pickupid == waffenp)
- {
- SendClientMessage(playerid,GREEN,"Hier ist deine Desert Eagle.");
- GivePlayerWeapon(playerid,24,10000);
- }
- if(pickupid == waffenp1)
- {
- SendClientMessage(playerid,GREEN,"Hier ist deine AK-47.");
- GivePlayerWeapon(playerid,30,10000);
- }
- if(pickupid == waffenp2)
- {
- SendClientMessage(playerid,GREEN,"Hier ist deine Shotgun.");
- GivePlayerWeapon(playerid,26,10000);
- }
- if(pickupid == waffenp3)
- {
- SendClientMessage(playerid,GREEN,"Hier ist dein Gewehr.");
- GivePlayerWeapon(playerid,33,10000);
- }
- if(pickupid == waffenp4)
- {
- SendClientMessage(playerid,GREEN,"Hier ist deine Sniper.");
- GivePlayerWeapon(playerid,34,10000);
- }
- if(pickupid == waffenp5)
- {
- SendClientMessage(playerid,GREEN,"Hier ist deine Kettensäge.");
- GivePlayerWeapon(playerid,9,10000);
- }
- if(pickupid == health)
- {
- SendClientMessage(playerid,GREEN,"Du hast dich erfolgreich geheilt.");
- SetPlayerHealth(playerid,100.0);
- }
- if(pickupid == armour)
- {
- SendClientMessage(playerid,GREEN,"Du hast dir eine Rüstung angezogen.");
- SetPlayerArmour(playerid,100.0);
- }
- if(pickupid == ammunationp)
- {
- SendClientMessage(playerid,BLUE,"Hier kannst du zukünftig Waffen kaufen.");
- SendClientMessage(playerid,BLUE,"Für diese Waffen benötigst du dann einen Waffenschein, den du ab Lvl 5 machen kannst.");
- }
- if(pickupid == spawnp)
- {
- SendClientMessage(playerid,BLUE,"Du bist so eben in ein Tutorialicon gelaufen.");
- SendClientMessage(playerid,BLUE,"In der Stadt sind noch 4 weitere verteilt. Jeweils bei:");
- SendClientMessage(playerid,BLUE,"Ammunation, Stadthalle, Flughafen, BSN");
- SendClientMessage(playerid,BLUE,"Sie werden dir helfen die Stadt besser kennen zu lernen.");
- SendClientMessage(playerid,BLUE,"Wenn du noch Fragen hast, rufe mit der Taste T den Chat auf und frage einen Admin.");
- SendClientMessage(playerid,BLUE,"Viel Spass am Betaserver ;)");
- }
- if(pickupid == stadthallep)
- {
- SendClientMessage(playerid,BLUE,"Dies ist die Stadthalle.");
- SendClientMessage(playerid,BLUE,"In ihr kannst du bald Jobs annehmen, Arbeitslosengeld erhalten");
- SendClientMessage(playerid,BLUE,"oder Pässe für SF(Linke Stadt) und LV(rechte Stadt) kaufen.");
- }
- if(pickupid == airportp)
- {
- SendClientMessage(playerid,BLUE,"Du bist hier am Flughafen.");
- SendClientMessage(playerid,BLUE,"Wenn du mit einem Admin Anhänger nach LV oder SF bringen willst");
- SendClientMessage(playerid,BLUE,"um Geld zu verdienen, frag einfach im Chat. Zukünftig werden hier auch 2 Jobs zur Verfügung stehen.");
- }
- if(pickupid == bsnp)
- {
- SendClientMessage(playerid,BLUE,"Dies ist der BSN(Burgershot Nord)");
- SendClientMessage(playerid,BLUE,"Zukünftig kannst du hier Werbung machen oder einen Snack zu dir nehmen.");
- SendClientMessage(playerid,BLUE,"Außerdem wird dies der offizielle Notfall-Helikopter-Landeplatz,");
- SendClientMessage(playerid,BLUE,"falls eine Atombombe die Stadt bedrohen sollte.");
- }
- if(pickupid == bsnein)
- {
- SetPlayerPos(playerid,365.7950,-73.5316,1001.5078);
- SetPlayerFacingAngle(playerid,275.1471);
- SetPlayerInterior(playerid,10);
- }
- if(pickupid == bsnaus)
- {
- SetPlayerPos(playerid,1199.9760,-923.5488,43.0196);
- SetPlayerFacingAngle(playerid,185.6288);
- SetPlayerInterior(playerid,0);
- }
- if(pickupid == pdhintenein)
- {
- SetPlayerPos(playerid,246.7840,67.2651,1003.6406);
- SetPlayerFacingAngle(playerid,360.0000);
- SetPlayerInterior(playerid,6);
- }
- if(pickupid == pdhintenaus)
- {
- SetPlayerPos(playerid,246.5622,84.5756,1003.6406);
- SetPlayerFacingAngle(playerid,185.4882);
- SetPlayerInterior(playerid,0);
- }
- if(pickupid == pdein)
- {
- SetPlayerPos(playerid,246.7840,67.2651,1003.6406);
- SetPlayerFacingAngle(playerid,360.0000);
- SetPlayerInterior(playerid,6);
- }
- if(pickupid == pdaus)
- {
- SetPlayerPos(playerid,1549.5044,-1675.7581,14.9966);
- SetPlayerFacingAngle(playerid,101.5772);
- SetPlayerInterior(playerid,0);
- }
- if(pickupid == halleein)
- {
- SetPlayerPos(playerid,384.808624,173.804992,1008.382812);
- SetPlayerFacingAngle(playerid,90.0000);
- SetPlayerInterior(playerid,3);
- }
- if(pickupid == halleaus)
- {
- SetPlayerPos(playerid,390.5121,173.8782,1008.3828);
- SetPlayerFacingAngle(playerid,1.4473);
- SetPlayerInterior(playerid,0);
- }
- return 1;
- }
- //----------------------------------------------------------
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/help", cmdtext, true, 10) == 0)
- {
- SendClientMessage(playerid, ORANGE,"/buy um in Ammunation Waffen zu kaufen.");
- SendClientMessage(playerid, ORANGE,"/lapon um deinen Laptop einzuschalten.");
- SendClientMessage(playerid, ORANGE,"/buy-laptop um im 24/7 Shop einen Laptop zu kaufen.");
- SendClientMessage(playerid, ORANGE,"");
- return 1;
- }
- if (strcmp("/buy",cmdtext,true, 10) == 0)
- {
- ShowPlayerDialog(playerid,KAUFEN,DIALOG_STYLE_LIST,"Ammunation","Desert Eagle\nCombat Shotgun\nAK-47\nCountry Rifle","Kaufen","Abbrechen");
- return 1;
- }
- if (strcmp("/tspawn",cmdtext,true, 10) == 0)
- {
- SetPlayerPos(playerid,1545.0699,-1675.2336,13.5596);
- SendClientMessage(playerid,ORANGE,"Du bist wieder am Spawn.");
- return 1;
- }
- if (strcmp("/tflughafen",cmdtext,true, 10) == 0)
- {
- SetPlayerPos(playerid,1961.2206,-2180.3999,13.5469);
- SendClientMessage(playerid,ORANGE,"Du bist nun vor dem LS Airport.");
- return 1;
- }
- if (strcmp("/tvilla",cmdtext,true, 10) == 0)
- {
- SetPlayerPos(playerid,1238.2783,-2036.9137,59.8516);
- SendClientMessage(playerid,ORANGE,"Du bist nun beim Präsidentenhaus.");
- return 1;
- }
- if (strcmp("/credits", cmdtext, true, 10) == 0)
- {
- SendClientMessage(playerid,BLUE,"Serverversion 1.0/n Gescriptet by startradeirrer/n gehostet by startradeirrer");
- return 1;
- }
- //----------------------------------------------------------
- public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[])
- {
- if(dialogid == KAUFEN)
- {
- if(response == 0)
- return 1;
- if(response == 1)
- {
- if(listitem == 1)
- {
- GivePlayerWeapon(playerid,24,555);
- SendClientMessage(playerid,GREEN,"Du hast dir erfolgreich eine Desert Eagle gekauft.");
- }
- if(listitem == 2)
- {
- GivePlayerWeapon(playerid,27,750);
- SendClientMessage(playerid,GREEN,"Du hast dir erfolgreich eine Combat Shotgun gekauft.");
- }
- if(listitem == 3)
- {
- GivePlayerWeapon(playerid,30,555);
- SendClientMessage(playerid,GREEN,"Du hast dir erfolgreich eine AK-47 gekauft.");
- }
- if(listitem == 4)
- {
- GivePlayerWeapon(playerid,33,475);
- SendClientMessage(playerid,GREEN,"Du hast dir erfolgreich eine Country Rifle gekauft.");
- }
- }
- }
- if(dialogid == LOGIN)
- {
- if(response == 0)
- {
- SendClientMessage(playerid,RED,"Du hast den Login abgelehnt.");
- Kick(playerid);
- return 1;
- }
- if(response == 1)
- {
- Login(playerid,MD5_Hash(inputtext));
- return 1;
- }
- }
- if(dialogid == REGISTER)
- {
- if(response == 0)
- {
- SendClientMessage(playerid,RED,"Du hast die Registrierung abgelehnt, daher wurdest du gekickt.");
- Kick(playerid);
- return 1;
- }
- if (response == 1)
- {
- if(!strlen(inputtext))
- {
- SendClientMessage(playerid,GREEN,"Bitte gib ein Passwort ein.");
- ShowPlayerDialog(playerid,REGISTER,DIALOG_STYLE_PASSWORD,"Registrieren","Bitte wähle ein Passwort um dir einen Account zu erstellen!","Registrieren","Abbrechen");
- return 1;
- }
- Register(playerid,MD5_Hash(inputtext));
- return 1;
- }
- }
- return 1;
- }
- //----------------------------------------------------------
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- stock Register(playerid,key[])
- {
- new Spieler[64];
- new Sname[MAX_PLAYER_NAME];
- GetPlayerName(playerid,Sname,sizeof(Sname));
- format(Spieler,sizeof(Spieler),"/Spieler/%s.txt",Sname);
- dini_Create(Spieler);
- dini_Set(Spieler,"Passwort",key);
- dini_IntSet(Spieler,"Fraktion",0);
- dini_IntSet(Spieler,"Adminlevel",0);
- dini_IntSet(Spieler,"Level",0);
- dini_IntSet(Spieler,"Geld",1000);
- dini_IntSet(Spieler,"Fraktion",0);
- dini_IntSet(Spieler,"Team",0);
- dini_IntSet(Spieler,"Job",0);
- SendClientMessage(playerid,GREEN,"Du hast dich erfolgreich registriert!");
- SpielerReset(playerid);
- return 1;
- }
- stock Login(playerid,key[])
- {
- new Spieler[64];
- new Sname[MAX_PLAYER_NAME];
- GetPlayerName(playerid,Sname,sizeof(Sname));
- format(Spieler,sizeof(Spieler),"/Spieler/%s.txt",Sname);
- if(!strcmp(key,dini_Get(Spieler,"Passwort"),true))
- {
- SendClientMessage(playerid,GREEN,"Du hast dich erfolgreich eingeloggt.");
- SpielerLaden(playerid);
- }
- else
- {
- SendClientMessage(playerid,GREEN,"Du hast ein falsches Passwort eingegeben!");
- Kick(playerid);
- }
- return 1;
- }
- stock SpielerSpeichern(playerid)
- {
- new Spieler[64];
- new Sname[MAX_PLAYER_NAME];
- GetPlayerName(playerid,Sname,sizeof(Sname));
- format(Spieler,sizeof(Spieler),"/Spieler/%s.txt",Sname);
- if(dini_Exists(Spieler))
- {
- dini_IntSet(Spieler,"Adminlevel",sSpieler[playerid][Adminlevel]);
- dini_IntSet(Spieler,"Level",sSpieler[playerid][Level]);
- dini_IntSet(Spieler,"Geld",sSpieler[playerid][Geld]);
- dini_IntSet(Spieler,"Fraktion",sSpieler[playerid][Fraktion]);
- dini_IntSet(Spieler,"Team",sSpieler[playerid][Team]);
- dini_IntSet(Spieler,"Job",sSpieler[playerid][Job]);
- }
- return 1;
- }
- stock SpielerLaden(playerid)
- {
- new Spieler[64];
- new Sname[MAX_PLAYER_NAME];
- GetPlayerName(playerid,Sname,sizeof(Sname));
- format(Spieler,sizeof(Spieler),"/Spieler/%s.txt",Sname);
- if(dini_Exists(Spieler))
- {
- SetPlayerScore(playerid,dini_Int(Spieler,"Level"));
- sSpieler[playerid][Adminlevel] = dini_Int(Spieler,"Adminlevel");
- sSpieler[playerid][Level] = dini_Int(Spieler,"Level");
- sSpieler[playerid][Geld] = dini_Int(Spieler,"Geld");
- sSpieler[playerid][Fraktion] = dini_Int(Spieler,"Fraktion");
- sSpieler[playerid][Team] = dini_Int(Spieler,"Team");
- sSpieler[playerid][Job] = dini_Int(Spieler,"Job");
- sSpieler[playerid][sLogin] = 1;
- }
- return 1;
- }
- stock SpielerReset(playerid)
- {
- sSpieler[playerid][Adminlevel] = 0;
- sSpieler[playerid][Level] = 0;
- sSpieler[playerid][Geld] = 1000;
- sSpieler[playerid][Fraktion] = 0;
- sSpieler[playerid][Team] = 0;
- sSpieler[playerid][Job] = 0;
- return 1;
- }
- //Login
- stock IstSpielerLogged(playerid)
- {
- if(sSpieler[playerid][Login] == 1) return 1;
- return 0;
- }
- //Fraktionen
- stock IstSpielerInFraktion(playerid,fraktionsid)
- {
- if(sSpieler[playerid][sFraktion] == fraktionsid) return 1;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement