Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <dini>
- #include <ocmd>
- forward Pruefen(playerid);
- #define BLAU 0x0087FFFF
- #define ROT 0xFF0000FF
- #define WEIß 0xFFFFFFFF
- #define GRÜN 0x00FF00FF
- #define DIALOG_TUTORIAL 1
- #define DIALOG_REGISTER 2
- #define DIALOG_LOGIN 3
- //Fraktionsnamen
- #define fraktname1 "POLICE"
- #define fraktname2 "MAFIA"
- #define fraktname3 "NORMAL"
- //Mafia
- #define mafiaspawn 2491.1350,2769.8381,10.6701
- //Police
- #define policespawn 2337.7813,2442.9785,6.2993
- //Normal
- #define normalspawn 1520.0,1568.0,1510.0
- forward testtimer();
- new policedachenter;
- new policedachexit;
- new waffenladenenter;
- new waffenladenexit;
- new bsnenter;
- new bsnexit;
- new tor[2];
- new botauto;
- new policecar[31];
- new mafiacar[29];//mafiacar[0], mafiacar[1]
- new ak_buypoint;
- new m4_buypoint;
- new rpg_buypoint;
- new mp5_buypoint;
- main()
- {
- print("\n----------------------------------");
- print("AfteeeyyyServer");
- print("----------------------------------\n");
- }
- public OnGameModeInit()
- {
- policedachenter=CreatePickup(1559,1,2315.1289,2475.0708,-7.4531);
- policedachexit=CreatePickup(1559,1,2296.3000488281,2461.6000976563,38.700000762939);
- waffenladenenter=CreatePickup(1559,1,2539.5393,2084.0183,10.8203);
- waffenladenexit=CreatePickup(1559,1,285.7899,-86.7247,1001.5229);
- DisableInteriorEnterExits();
- ConnectNPC("TutorialBot","tutorialbot");
- ConnectNPC("TutorialBot2","tutorialbot2");
- UsePlayerPedAnims();
- bsnexit=CreatePickup(1559,1,362.8524,-75.1179,1001.5078);
- bsnenter=CreatePickup(1559,1,1199.2235,-918.1543,43.1233);
- Create3DTextLabel("BSN\n Eingang",BLAU,1199.2235,-918.1543,43.1233,10,0);
- DisableInteriorEnterExits();
- SetGameModeText("TutorialMode");
- AddPlayerClass(0,2047.4270,1336.5569,10.6719,188.9284,25,100,0,0,0,0); // position;
- CreateObject(3629,2498.69995117,2774.00000000,2.59999990,0.00000000,0.00000000,180.00000000); //object(arhang_las) (1)
- CreateObject(6976,2576.69995117,2733.50000000,15.10000038,0.00000000,0.00000000,0.00000000); //object(shamheliprt04) (1)
- CreateObject(6976,2559.69995117,2733.50000000,5.19999981,0.00000000,0.00000000,0.00000000); //object(shamheliprt04) (2)
- CreateObject(6976,2583.39990234,2787.19995117,17.89999962,0.00000000,0.00000000,90.00000000); //object(shamheliprt04) (3)
- CreateObject(6976,2583.50000000,2773.69995117,10.60000038,0.00000000,0.00000000,90.00000000); //object(shamheliprt04) (4)
- CreateObject(7096,2281.39990234,2461.30004883,44.20000076,0.00000000,0.00000000,270.00000000); //object(vrockstairs) (1)
- CreateObject(7096,2274.50000000,2464.69995117,37.20000076,0.00000000,0.00000000,87.99499512); //object(vrockstairs) (2)
- CreateObject(1383,2580.89990234,2825.39990234,-8.59999990,0.00000000,0.00000000,0.00000000); //object(twrcrane_m_04) (1)
- CreateObject(1383,2309.19995117,2454.39990234,-32.89999962,0.00000000,0.00000000,0.00000000); //object(twrcrane_m_04) (2)
- botauto=CreateVehicle(401,1227.1797,-914.0590,42.6812,99.6721,126,126,1);
- SetVehicleNumberPlate(botauto,"Auto 1");
- AddStaticVehicle(409,1226.2432,-905.7473,42.6997,10.2423,151,151); // auto2
- //fraktautos
- mafiacar[28]=AddStaticVehicleEx(425,2610.80004883,2722.60009766,37.40000153,0.00000000,-1,-1,15); //Hunter
- mafiacar[27]=AddStaticVehicleEx(425,2622.50000000,2722.60009766,37.40000153,0.00000000,-1,-1,15); //Hunter
- mafiacar[26]=AddStaticVehicleEx(520,2609.69995117,2812.50000000,28.70000076,90.00000000,-1,-1,15); //Hydra
- mafiacar[25]=AddStaticVehicleEx(520,2609.69995117,2841.00000000,28.70000076,90.00000000,-1,-1,15); //Hydra
- mafiacar[24]=AddStaticVehicleEx(513,2610.60009766,2821.89990234,28.60000038,90.00000000,-1,-1,15); //Stunt
- mafiacar[23]=AddStaticVehicleEx(513,2610.60009766,2831.39990234,28.60000038,90.00000000,-1,-1,15); //Stunt
- mafiacar[22]=AddStaticVehicleEx(520,2595.00000000,2840.89990234,28.70000076,90.00000000,-1,-1,15); //Hydra
- mafiacar[21]=AddStaticVehicleEx(520,2546.89990234,2809.00000000,28.70000076,270.00000000,-1,-1,15); //Hydra
- mafiacar[20]=AddStaticVehicleEx(520,2547.00000000,2840.89990234,28.70000076,270.00000000,-1,-1,15); //Hydra
- mafiacar[19]=AddStaticVehicleEx(520,2593.89990234,2812.39990234,28.70000076,90.00000000,-1,-1,15); //Hydra
- mafiacar[18]=AddStaticVehicleEx(451,2533.00000000,2759.19995117,10.60000038,180.00000000,-1,-1,15); //Turismo
- mafiacar[17]=AddStaticVehicleEx(451,2537.30004883,2759.19995117,10.60000038,180.00000000,-1,-1,15); //Turismo
- mafiacar[16]=AddStaticVehicleEx(451,2528.80004883,2759.19995117,10.60000038,180.00000000,-1,-1,15); //Turismo
- mafiacar[15]=AddStaticVehicleEx(451,2524.30004883,2759.19995117,10.60000038,180.00000000,-1,-1,15); //Turismo
- mafiacar[14]=AddStaticVehicleEx(451,2541.30004883,2759.19995117,10.60000038,180.00000000,-1,-1,15); //Turismo
- mafiacar[13]=AddStaticVehicleEx(541,2524.60009766,2769.89990234,10.50000000,0.00000000,-1,-1,15); //Bullet
- mafiacar[12]=AddStaticVehicleEx(541,2528.80004883,2769.80004883,10.50000000,0.00000000,-1,-1,15); //Bullet
- mafiacar[11]=AddStaticVehicleEx(541,2533.30004883,2769.69995117,10.50000000,0.00000000,-1,-1,15); //Bullet
- mafiacar[10]=AddStaticVehicleEx(541,2537.30004883,2769.60009766,10.50000000,0.00000000,-1,-1,15); //Bullet
- mafiacar[9]=AddStaticVehicleEx(541,2541.30004883,2769.50000000,10.50000000,0.00000000,-1,-1,15); //Bullet
- mafiacar[8]=AddStaticVehicleEx(461,2541.30004883,2789.39990234,10.50000000,180.00000000,-1,-1,15); //PCJ-600
- mafiacar[7]=AddStaticVehicleEx(461,2545.00000000,2789.19995117,10.50000000,180.00000000,-1,-1,15); //PCJ-600
- mafiacar[6]=AddStaticVehicleEx(461,2549.69995117,2789.00000000,10.50000000,180.00000000,-1,-1,15); //PCJ-600
- mafiacar[5]=AddStaticVehicleEx(461,2553.30004883,2789.10009766,10.50000000,180.00000000,-1,-1,15); //PCJ-600
- mafiacar[4]=AddStaticVehicleEx(409,2529.89990234,2747.50000000,10.69999981,90.00000000,-1,-1,15); //Stretch
- mafiacar[3]=AddStaticVehicleEx(409,2540.69995117,2747.39990234,10.69999981,90.00000000,-1,-1,15); //Stretch
- mafiacar[2]=AddStaticVehicleEx(405,2489.80004883,-1677.09997559,13.30000019,0.00000000,-1,-1,15); //Sentinel
- mafiacar[1]=AddStaticVehicle(411,1245.5562,-921.0884,42.5210,100.3385,64,1); // fraktauto 1
- mafiacar[0]=AddStaticVehicle(560,1237.1934,-922.9166,42.4760,101.1390,9,39); // fraktauto 3
- policecar[30]=AddStaticVehicleEx(520,2267.80004883,2439.00000000,47.90000153,270.00000000,-1,-1,15); //Hydra
- policecar[29]=AddStaticVehicleEx(520,2267.69995117,2450.80004883,47.90000153,270.00000000,-1,-1,15); //Hydra
- policecar[28]=AddStaticVehicleEx(513,2339.69995117,2479.60009766,39.50000000,90.00000000,-1,-1,15); //Stunt
- policecar[27]=AddStaticVehicleEx(513,2348.80004883,2480.00000000,39.50000000,90.00000000,-1,-1,15); //Stunt
- policecar[26]=AddStaticVehicleEx(513,2329.50000000,2479.30004883,39.50000000,90.00000000,-1,-1,15); //Stunt
- policecar[25]=AddStaticVehicleEx(425,2293.60009766,2450.00000000,47.79999924,0.00000000,-1,-1,15); //Hunter
- policecar[24]=AddStaticVehicleEx(425,2281.30004883,2449.89990234,47.79999924,0.00000000,-1,-1,15); //Hunter
- policecar[23]=AddStaticVehicleEx(598,2299.60009766,2459.89990234,3.09999990,270.00000000,-1,-1,15); //Police Car (LVPD)
- policecar[22]=AddStaticVehicleEx(598,2299.69995117,2464.60009766,3.09999990,270.00000000,-1,-1,15); //Police Car (LVPD)
- policecar[20]=AddStaticVehicleEx(598,2299.50000000,2451.80004883,3.09999990,270.00000000,-1,-1,15); //Police Car (LVPD)
- policecar[19]=AddStaticVehicleEx(598,2299.69995117,2456.00000000,3.09999990,270.00000000,-1,-1,15); //Police Car (LVPD)
- policecar[18]=AddStaticVehicleEx(596,2312.19995117,2432.39990234,3.09999990,0.00000000,-1,-1,15); //Police Car (LSPD)
- policecar[17]=AddStaticVehicleEx(596,2308.19995117,2432.50000000,3.09999990,0.00000000,-1,-1,15); //Police Car (LSPD)
- policecar[16]=AddStaticVehicleEx(596,2303.19995117,2432.69995117,3.09999990,0.00000000,-1,-1,15); //Police Car (LSPD)
- policecar[15]=AddStaticVehicleEx(596,2299.00000000,2432.80004883,3.09999990,0.00000000,-1,-1,15); //Police Car (LSPD)
- policecar[14]=AddStaticVehicleEx(596,2295.00000000,2432.89990234,3.09999990,0.00000000,-1,-1,15); //Police Car (LSPD)
- policecar[13]=AddStaticVehicleEx(596,2316.10009766,2432.19995117,3.09999990,0.00000000,-1,-1,15); //Police Car (LSPD)
- policecar[12]=AddStaticVehicleEx(597,2251.00000000,2432.50000000,3.09999990,0.00000000,-1,-1,15); //Police Car (SFPD)
- policecar[11]=AddStaticVehicleEx(597,2246.80004883,2432.30004883,3.09999990,0.00000000,-1,-1,15); //Police Car (SFPD)
- policecar[10]=AddStaticVehicleEx(597,2241.19995117,2437.50000000,3.09999990,270.00000000,-1,-1,15); //Police Car (SFPD)
- policecar[9]=AddStaticVehicleEx(597,2241.30004883,2442.30004883,3.09999990,270.00000000,-1,-1,15); //Police Car (SFPD)
- policecar[8]=AddStaticVehicleEx(597,2241.39990234,2447.00000000,3.09999990,270.00000000,-1,-1,15); //Police Car (SFPD)
- policecar[7]=AddStaticVehicleEx(597,2241.50000000,2452.00000000,3.09999990,270.00000000,-1,-1,15); //Police Car (SFPD)
- policecar[6]=AddStaticVehicleEx(597,2241.60009766,2456.00000000,3.09999990,270.00000000,-1,-1,15); //Police Car (SFPD)
- policecar[5]=AddStaticVehicleEx(601,2312.60009766,2500.19995117,-7.50000000,90.00000000,-1,-1,15); //S.W.A.T. Van
- policecar[4]=AddStaticVehicleEx(601,2312.69995117,2495.69995117,-7.50000000,90.00000000,-1,-1,15); //S.W.A.T. Van
- policecar[3]=AddStaticVehicleEx(601,2312.80004883,2489.89990234,-7.50000000,90.00000000,-1,-1,15); //S.W.A.T. Van
- policecar[2]=AddStaticVehicleEx(601,2312.89990234,2485.39990234,-7.50000000,90.00000000,-1,-1,15); //S.W.A.T. Van
- policecar[1]=AddStaticVehicleEx(420,2456.69995117,2745.80004883,10.69999981,0.00000000,-1,-1,15); //Taxi
- //zäune
- CreateObject(987, 1184.3666992188, -949.98992919922, 41.657981872559, 0, 0, 10);
- CreateObject(987, 1195.0812988281, -937.03753662109, 41.745170593262, 0, 0, 187.99755859375);
- tor[0]=CreateObject(3629, 2498.6999511719, 2774, 2.5999999046326, 0, 0, 180);
- tor[1]=CreateObject(971,2335.10009766,2443.50000000,7.09999990,0.00000000,0.00000000,58.00000000); //object(subwaygate) (1)
- SetTimer("testtimer",1000*60*10,true);
- //wafenkauf
- //AK-47
- ak_buypoint=CreatePickup(1559,1,287.9801,-76.5869,1001.5156);
- Create3DTextLabel("AK-47 Kauf.\nPreis:{FFFFFF} 8999$",ROT,287.9801,-76.5869,1001.5156,359.6821,0);
- //M4
- m4_buypoint=CreatePickup(1559,1,288.0056,-74.8985,1001.5156);
- Create3DTextLabel("M4 Kauf.\nPreis:{FFFFFF} 8999$",ROT,288.0056,-74.8985,1001.5156,176.6937,0);
- //RPG
- rpg_buypoint=CreatePickup(1559,1,288.1072,-72.7516,1001.5156);
- Create3DTextLabel("RPG Kauf.\nPreis:{FFFFFF} 11999$",ROT,288.1072,-72.7516,1001.5156,2.5021,0);
- //MP5
- mp5_buypoint=CreatePickup(1559,1,288.1670,-71.0682,1001.5156);
- Create3DTextLabel("MP5 Kauf.\nPreis:{FFFFFF} 6999$",ROT,288.1670,-71.0682,1001.5156,177.9471,0);
- return 1;
- }
- public testtimer()
- {
- SetTimer("Pruefen",1000,0);
- return 1;
- }
- public Pruefen(playerid)
- {
- if(IsPlayerInRangeOfPoint(playerid, 30.0, -2029.3141,-101.2577,35.1641))
- {
- new string[80];
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, MAX_PLAYER_NAME);
- format(string,sizeof(string),"Spieler %s war in der nähe der Mafia Base",name(playerid));
- SendClientMessageToAll(ROT,string);
- }
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- if(IsPlayerNPC(playerid))return 1;
- SetPlayerPos(playerid,2047.4270,1336.5569,10.6719);
- SetPlayerFacingAngle(playerid,188.9284);
- SetPlayerCameraPos(playerid,2047.6205,1333.3314,10.6719);
- SetPlayerCameraLookAt(playerid,2047.4270,1336.5569,10.6719);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- if(IsPlayerNPC(playerid))return 1;
- new Spielerdatei[64];
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,sizeof(name));
- format(Spielerdatei,sizeof(Spielerdatei),"/Accounts/%s.txt",name);
- if(dini_Exists(Spielerdatei))
- {
- ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Dein Account wurde gefunden. Gib bitte das Passwort ein.","Login","Abbrechen");
- }
- else
- {
- ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Registrieren","Gib bitte das gewünschte Passwort ein:","Register","Abbrechen");
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(GetPVarInt(playerid,"loggedin")==1)
- {
- SpielerSpeichern(playerid);
- }
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(!strcmp(SpielerName(playerid),"TutorialBot",true))
- {
- PutPlayerInVehicle(playerid,botauto,0);
- }
- if(IsPlayerNPC(playerid))return 1;
- switch(GetPVarInt(playerid,"Fraktion"))
- {
- case 0:{}
- case 1:{SetPlayerPos(playerid,policespawn);GivePlayerMoney(playerid,4000);GivePlayerWeapon(playerid,24,100);SetPlayerColor(playerid,BLAU);SetPlayerSkin(playerid,266);SetPlayerArmour(playerid,100.0);}
- case 2:{SetPlayerPos(playerid,mafiaspawn);GivePlayerMoney(playerid,4000);GivePlayerWeapon(playerid,24,100);SetPlayerSkin(playerid,107);SetPlayerArmour(playerid,100.0);}
- case 3:{SetPlayerPos(playerid,normalspawn);GivePlayerMoney(playerid,4000);GivePlayerWeapon(playerid,24,100);SetPlayerColor(playerid,ROT);SetPlayerSkin(playerid,1);SetPlayerArmour(playerid,100.0);}
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(killerid !=255) // wenn man nicht selber der täter ist
- {
- GivePlayerMoney(killerid, 5000);
- }
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- ocmd:f(playerid,params[])
- {
- new text[128];
- if(sscanf(params,"s",text))return SendClientMessage(playerid,ROT,"/f [text]");
- format(text,sizeof(text),"Member %s: %s",SpielerName(playerid),text);
- for(new i=0; i<GetMaxPlayers(); i++)
- {
- if(IsPlayerConnected(i))
- {
- if(isPlayerInFrakt(i,GetPVarInt(playerid,"Fraktion")))
- {
- SendClientMessage(i,BLAU,text);
- }
- }
- }
- return 1;
- }
- ocmd:tban(playerid,params[])
- {
- if(!isPlayerAnAdmin(playerid,3))return SendClientMessage(playerid,ROT,"Rang zu Niedrig.");
- new pID, time, grund[128];
- if(sscanf(params,"uis",pID,time,grund))return SendClientMessage(playerid,BLAU,"/tban [playerid] [zeit] [grund]");
- if(IsPlayerConnected(pID))
- {
- if(time>0&&time<1000)
- {
- new string[128];
- format(string,sizeof(string),"AdmCdm: %s wurde von %s für %i Minuten gebannt. Grund: %s",SpielerName(pID),SpielerName(playerid),time,grund);
- SendClientMessageToAll(ROT,string);
- new wert;
- wert=gettime()+(60*time);
- SetPVarInt(pID,"timeban",wert);
- Kick(pID);
- return 1;
- }
- SendClientMessage(playerid,ROT,"Ungültige Zeit.");
- return 1;
- }
- SendClientMessage(playerid,ROT,"Spieler ist nicht online.");
- return 1;
- }
- ocmd:makeleader(playerid,params[])
- {
- if(!isPlayerAnAdmin(playerid,3))return SendClientMessage(playerid,ROT,"Rang zu Niedrig.");
- new pID,fID;
- if(sscanf(params,"ui",pID,fID))return SendClientMessage(playerid,BLAU,"/makeleader [playerid] [fraktionsid]");
- SetPVarInt(pID,"Fraktion",fID);
- SendClientMessage(playerid,BLAU,"Erfolgreich.");
- return 1;
- }
- ocmd:stealmoneyfrompolice(playerid,params[])
- {
- if(!IsPlayerInRangeOfPoint(playerid,100,2309.19995117,2454.39990234,-8.89999962)) return SendClientMessage(playerid,ROT,"Du bist nicht in der nähe von der Polizei Station´s Säule.");
- {
- if(isPlayerInFrakt(playerid,2))
- {
- GivePlayerMoney(playerid,350);
- return 1;
- }
- return 1;
- }
- }
- ocmd:stealmoneyfrommafia(playerid,params[])
- {
- if(!IsPlayerInRangeOfPoint(playerid,100,2580.89990234,2825.39990234,0.59999990)) return SendClientMessage(playerid,ROT,"Du bist nicht in der nähe von der Säule.");
- {
- if(isPlayerInFrakt(playerid,1))
- {
- GivePlayerMoney(playerid,350);
- return 1;
- }
- return 1;
- }
- }
- ocmd:aufmafia(playerid,params[])
- {
- if(!IsPlayerInRangeOfPoint(playerid,50,2498.6999511719, 2774, 2.5999999046326)) return SendClientMessage(playerid,ROT,"Du bist nicht in der nähe vom Tor.");
- {
- if(isPlayerInFrakt(playerid,2))
- {
- MoveObject(tor[0],2498.6999511719, 2774, 15.89999961853,5);
- return 1;
- }
- return SendClientMessage(playerid,ROT,"Du bist nicht in der Mafia.");
- }
- }
- ocmd:aufpolice(playerid,params[])
- {
- if(!IsPlayerInRangeOfPoint(playerid,50,2337.7813,2442.9785,6.2993)) return SendClientMessage(playerid,ROT,"Du bist nicht in der nähe vom Tor.");
- {
- if(isPlayerInFrakt(playerid,1))
- {
- MoveObject(tor[1],2335.10009766,2443.50000000,7.09999990-10,5);
- return 1;
- }
- return SendClientMessage(playerid,ROT,"Du bist nicht bei der Polizei.");
- }
- }
- ocmd:zupolice(playerid,params[])
- {
- if(!IsPlayerInRangeOfPoint(playerid,50,2337.7813,2442.9785,6.2993)) return SendClientMessage(playerid,ROT,"Du bist nicht in der nähe vom Tor.");
- {
- if(isPlayerInFrakt(playerid,1))
- {
- MoveObject(tor[1],2335.10009766,2443.50000000,7.09999990,5);
- return 1;
- }
- return SendClientMessage(playerid,ROT,"Du bist nicht bei der Polizei.");
- }
- }
- ocmd:zumafia(playerid,params[])
- {
- if(!IsPlayerInRangeOfPoint(playerid,50,2498.6999511719, 2774, 2.5999999046326)) return SendClientMessage(playerid,ROT,"Du bist nicht in der nähe vom Tor.");
- {
- if(isPlayerInFrakt(playerid,2))
- {
- MoveObject(tor[0],2498.6999511719, 2774, 2.5999999046326,5);
- return 1;
- }
- return SendClientMessage(playerid,ROT,"Du bist nicht in der Mafia.");
- }
- }
- ocmd:setadmin(playerid,params[])
- {
- if(!isPlayerAnAdmin(playerid,5))return SendClientMessage(playerid,ROT,"Du bist kein Admin.");
- new pID, rank;
- if(sscanf(params,"ui",pID,rank))return SendClientMessage(playerid,ROT,"/setadmin [spieler] [level]");
- if(rank<1||rank>5)return SendClientMessage(playerid,ROT,"Bitte gültigen Rang angeben.");
- SetPVarInt(pID,"Adminlevel",rank);
- SpielerSpeichern(pID);
- SendClientMessageToAll(BLAU,"Es wurde jemand zu Admin gemacht.");
- return 1;
- }
- ocmd:ban(playerid,params[])
- {
- if(!isPlayerAnAdmin(playerid,2))return SendClientMessage(playerid,ROT,"Du bist kein Admin.");
- new pID, reason[128],string[128];
- if(sscanf(params,"us",pID,reason))return SendClientMessage(playerid,BLAU,"/ban [id] [grund]");
- format(string,sizeof(string),"AdmCmd: %s wurde von %s gebannt. Grund: %s",SpielerName(pID),SpielerName(playerid),reason);
- SendClientMessageToAll(ROT,string);
- SetPVarInt(pID,"Baned",1);
- Kick(pID);
- return 1;
- }
- ocmd:kick(playerid,params[])
- {
- if(!isPlayerAnAdmin(playerid,2))return SendClientMessage(playerid,ROT,"Du bist kein Admin.");
- new pID, reason[128],string[128];
- if(sscanf(params,"us",pID,reason))return SendClientMessage(playerid,BLAU,"/kick [id] [grund]");
- format(string,sizeof(string),"AdmCmd: %s wurde von %s gekickt. Grund: %s",SpielerName(pID),SpielerName(playerid),reason);
- SendClientMessageToAll(ROT,string);
- Kick(pID);
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp(cmdtext,"/mafia",true)==0)
- {
- SetPlayerPos(playerid,2491.1350,2769.8381,10.6701);
- }
- if(strcmp(cmdtext,"/police",true)==0)
- {
- SetPlayerPos(playerid,2337.7813,2442.9785,6.2993);
- }
- if(strcmp(cmdtext,"/waffenladen",true)==0)
- {
- SetPlayerPos(playerid,2535.6316,2083.7988,10.8203);
- }
- if(strcmp(cmdtext,"/bsn",true)==0)
- {
- if(isPlayerAnAdmin(playerid,3))
- {
- ShowPlayerDialog(playerid,DIALOG_TUTORIAL,DIALOG_STYLE_MSGBOX,"BSN","Möchten sie wirklich zum BSN?","JA","NEIN");
- return 1;
- }
- SendClientMessage(playerid,BLAU,"Du bist kein Admin.");
- return 1;
- }
- if(strcmp(cmdtext,"/kill",true)==0)
- {
- SetPlayerHealth(playerid,0);
- return 1;
- }
- if(strcmp(cmdtext,"/restart",true)==0)
- {
- if(isPlayerAnAdmin(playerid,5))
- {
- SendRconCommand("gmx");
- return 1;
- }
- SendClientMessage(playerid,BLAU,"Du bist kein Admin.");
- return 1;
- }
- if(strcmp(cmdtext,"/stats",true)==0)
- {
- new string[128];
- new fraktname[64];
- switch(GetPVarInt(playerid,"Fraktion"))
- {
- case 0:{fraktname="Keine";}
- case 1:{fraktname=fraktname1;}
- case 2:{fraktname=fraktname2;}
- case 3:{fraktname=fraktname3;}
- }
- //1 reihe
- format(string,sizeof(string),"[Name: %s] [Level: %i] [Adminlevel: %i] [Fraktion: %s]",SpielerName(playerid),GetPlayerScore(playerid),GetPVarInt(playerid,"Adminlevel"),fraktname);
- SendClientMessage(playerid,BLAU,string);
- //2 reihe
- return 1;
- }
- if(strcmp(cmdtext,"/nschild",true)==0)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new vehicleid;
- vehicleid=GetPlayerVehicleID(playerid);
- SetVehicleNumberPlate(vehicleid,"Test");
- SetVehicleToRespawn(vehicleid);
- PutPlayerInVehicle(playerid,vehicleid,0);
- }
- return 1;
- }
- return 0;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if(newstate==PLAYER_STATE_DRIVER)
- {
- for(new i=0; i<sizeof(policecar); i++)
- {
- if(GetPlayerVehicleID(playerid)==policecar[i])
- {
- if(GetPVarInt(playerid,"Fraktion")!=1)
- {
- RemovePlayerFromVehicle(playerid);
- SendClientMessage(playerid,ROT,"Du darfst dieses Fahrzeug nicht fahren.");
- }
- }
- }
- }
- if(newstate==PLAYER_STATE_DRIVER)
- {
- for(new i=0; i<sizeof(mafiacar); i++)
- {
- if(GetPlayerVehicleID(playerid)==mafiacar[i])
- {
- if(GetPVarInt(playerid,"Fraktion")!=2)
- {
- RemovePlayerFromVehicle(playerid);
- SendClientMessage(playerid,ROT,"Du darfst dieses Fahrzeug nicht fahren.");
- }
- }
- }
- }
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- if(!IsPlayerInRangeOfPoint(playerid,100,2580.89990234,2825.39990234,0.59998990))
- {
- SendClientMessageToAll(ROT,"Jemand stiehlt Geld von der Mafia!!!");
- }
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- if(pickupid==policedachenter)
- {
- SetPlayerPos(playerid,2296.3000488281,2466.3999023438,38.700000762939);
- SetPlayerInterior(playerid,0);
- }
- if(pickupid==policedachexit)
- {
- SetPlayerPos(playerid,2310.3596,2474.6931,-7.4531);
- SetPlayerInterior(playerid,0);
- }
- if(pickupid==waffenladenenter)
- {
- SetPlayerPos(playerid,286.800994,-82.547599,1001.515625);
- SetPlayerInterior(playerid,4);
- }
- if(pickupid==waffenladenexit)
- {
- SetPlayerPos(playerid,2535.6316,2083.7988,10.8203);
- SetPlayerFacingAngle(playerid,91.4661);
- SetCameraBehindPlayer(playerid);
- SetPlayerInterior(playerid,0);
- }
- if(pickupid==bsnenter)
- {
- SetPlayerPos(playerid,375.962463,-65.816848,1001.507812);
- SetPlayerInterior(playerid,10);
- GameTextForPlayer(playerid,"~w~Du ~r~hast ~b~den ~n~~g~BSN betreten.",3000,3);
- }
- if(pickupid==bsnexit)
- {
- SetPlayerPos(playerid,1199.4618,-920.8215,43.1059);
- SetPlayerFacingAngle(playerid,185.7090);
- SetCameraBehindPlayer(playerid);
- SetPlayerInterior(playerid,0);
- }
- if(pickupid==rpg_buypoint)
- {
- if(GetPlayerMoney(playerid)>11999)
- {
- GivePlayerMoney(playerid,-11999);
- SendClientMessage(playerid,GRÜN,"Danke für ihren Einkauf! (gekauft: RPG)");
- GivePlayerWeapon(playerid,35,25);
- }
- else
- {
- SendClientMessage(playerid,ROT,"Du hast nicht genug Geld!");
- }
- }
- if(pickupid==mp5_buypoint)
- {
- if(GetPlayerMoney(playerid)>6999)
- {
- GivePlayerMoney(playerid,-6999);
- SendClientMessage(playerid,GRÜN,"Danke für ihren Einkauf! (gekauft: MP5)");
- GivePlayerWeapon(playerid,29,150);
- }
- else
- {
- SendClientMessage(playerid,ROT,"Du hast nicht genug Geld!");
- }
- }
- if(pickupid==m4_buypoint)
- {
- if(GetPlayerMoney(playerid)>8999)
- {
- GivePlayerMoney(playerid,-8999);
- SendClientMessage(playerid,GRÜN,"Danke für ihren Einkauf! (gekauft: AK M4)");
- GivePlayerWeapon(playerid,31,150);
- }
- else
- {
- SendClientMessage(playerid,ROT,"Du hast nicht genug Geld!");
- }
- }
- if(pickupid==ak_buypoint)
- {
- if(GetPlayerMoney(playerid)>8999)
- {
- GivePlayerMoney(playerid,-9000);
- SendClientMessage(playerid,GRÜN,"Danke für ihren Einkauf! (gekauft: AK 47)");
- GivePlayerWeapon(playerid,30,150);
- }
- else
- {
- SendClientMessage(playerid,ROT,"Du hast nicht genug Geld!");
- }
- }
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid==DIALOG_LOGIN)
- {
- if(response==0)
- {
- SendClientMessage(playerid,BLAU,"Du hast den Vorgang abgebrochen.");
- Kick(playerid);
- return 1;
- }
- if(response==1)
- {
- if(!strlen(inputtext))
- {
- SendClientMessage(playerid,BLAU,"Das Passwort war nicht lang genug.");
- ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Dein Account wurde gefunden. Gib bitte das Passwort ein.","Login","Abbrechen");
- return 1;
- }
- else
- {
- Login(playerid,inputtext);
- return 1;
- }
- }
- }
- if(dialogid==DIALOG_REGISTER)
- {
- if(response==0)
- {
- SendClientMessage(playerid,BLAU,"Du hast den Vorgang abgebrochen.");
- Kick(playerid);
- return 1;
- }
- if(response==1)
- {
- if(!strlen(inputtext))
- {
- SendClientMessage(playerid,BLAU,"Das Passwort war nicht lang genug.");
- ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Registrieren","Gib bitte das gewünschte Passwort ein:","Register","Abbrechen");
- return 1;
- }
- else
- {
- Register(playerid,inputtext);
- return 1;
- }
- }
- }
- if(dialogid==DIALOG_TUTORIAL)
- {
- if(response==1)
- {
- SetPlayerPos(playerid,1227.1797,-914.0590,42.6812);
- SendClientMessage(playerid,0xFFFF00FF,"Du wurdest Teleportiert");
- }
- if(response==0)
- {
- SendClientMessage(playerid,BLAU,"Ok dann halt nicht...");
- }
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- stock SpielerName(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,sizeof(name));
- return name;
- }
- stock Register(playerid,key[])
- {
- new Spielerdatei[64];
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,sizeof(name));
- format(Spielerdatei,sizeof(Spielerdatei),"/Accounts/%s.txt",name);
- dini_Create(Spielerdatei);
- dini_Set(Spielerdatei,"Passwort",key);
- SendClientMessage(playerid,BLAU,"Erfolgreich registriert.");
- SetPlayerScore(playerid,0);
- SetPVarInt(playerid,"loggedin",1);
- return 1;
- }
- stock Login(playerid,key[])
- {
- new Spielerdatei[64];
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,sizeof(name));
- format(Spielerdatei,sizeof(Spielerdatei),"/Accounts/%s.txt",name);
- if(gettime()<dini_Int(Spielerdatei,"timeban"))
- {
- SendClientMessage(playerid,ROT,"Du bist noch gebannt. Komm später wieder.");
- Kick(playerid);
- return 1;
- }
- if(!strcmp(key,dini_Get(Spielerdatei,"Passwort"),false))
- {
- LoadAccount(playerid);
- SendClientMessage(playerid,BLAU,"Erfolgreich eingeloggt.");
- return 1;
- }
- else
- {
- SendClientMessage(playerid,BLAU,"Falsches Passwort.");
- ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Dein Account wurde gefunden. Gib bitte das Passwort ein.","Login","Abbrechen");
- return 1;
- }
- }
- stock LoadAccount(playerid)
- {
- new Spielerdatei[64];
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,sizeof(name));
- format(Spielerdatei,sizeof(Spielerdatei),"/Accounts/%s.txt",name);
- SetPlayerScore(playerid,dini_Int(Spielerdatei,"Level"));
- GivePlayerMoney(playerid,dini_Int(Spielerdatei,"Geld"));
- SetPVarInt(playerid,"Adminlevel",dini_Int(Spielerdatei,"Adminlevel"));
- SetPVarInt(playerid,"Fraktion",dini_Int(Spielerdatei,"Fraktion"));
- SetPVarInt(playerid,"Baned",dini_Int(Spielerdatei,"Baned"));
- if(GetPVarInt(playerid,"Baned")==1)
- {
- SendClientMessage(playerid,ROT,"Du bist vom Server gebannt.");
- Kick(playerid);
- }
- SetPVarInt(playerid,"loggedin",1);
- return 1;
- }
- stock SpielerSpeichern(playerid)
- {
- if(GetPVarInt(playerid,"loggedin")==1)
- {
- new Spielerdatei[64];
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,sizeof(name));
- format(Spielerdatei,sizeof(Spielerdatei),"/Accounts/%s.txt",name);
- dini_IntSet(Spielerdatei,"Level",GetPlayerScore(playerid));
- dini_IntSet(Spielerdatei,"Geld",GetPlayerMoney(playerid));
- dini_IntSet(Spielerdatei,"Adminlevel",GetPVarInt(playerid,"Adminlevel"));
- dini_IntSet(Spielerdatei,"Fraktion",GetPVarInt(playerid,"Fraktion"));
- dini_IntSet(Spielerdatei,"Baned",GetPVarInt(playerid,"Baned"));
- dini_IntSet(Spielerdatei,"timeban",GetPVarInt(playerid,"timeban"));
- }
- return 1;
- }
- stock isPlayerInFrakt(playerid,fraktid)
- {
- if(GetPVarInt(playerid,"Fraktion")==fraktid)return 1;
- return 0;
- }
- stock isPlayerAnAdmin(playerid,rang)
- {
- if(GetPVarInt(playerid,"Adminlevel")>=rang)return 1;
- return 0;
- }
- stock sscanf(sstring[], format[], {Float,_}:...)
- {
- #if defined isnull
- if (isnull(sstring))
- #else
- if (sstring[0] == 0 || (sstring[0] == 1 && sstring[1] == 0))
- #endif
- {
- return format[0];
- }
- #pragma tabsize 4
- new
- formatPos = 0,
- sstringPos = 0,
- paramPos = 2,
- paramCount = numargs(),
- delim = ' ';
- while (sstring[sstringPos] && sstring[sstringPos] <= ' ')
- {
- sstringPos++;
- }
- while (paramPos < paramCount && sstring[sstringPos])
- {
- switch (format[formatPos++])
- {
- case '\0':
- {
- return 0;
- }
- case 'i', 'd':
- {
- new
- neg = 1,
- num = 0,
- ch = sstring[sstringPos];
- if (ch == '-')
- {
- neg = -1;
- ch = sstring[++sstringPos];
- }
- do
- {
- sstringPos++;
- if ('0' <= ch <= '9')
- {
- num = (num * 10) + (ch - '0');
- }
- else
- {
- return -1;
- }
- }
- while ((ch = sstring[sstringPos]) > ' ' && ch != delim);
- setarg(paramPos, 0, num * neg);
- }
- case 'h', 'x':
- {
- new
- num = 0,
- ch = sstring[sstringPos];
- do
- {
- sstringPos++;
- switch (ch)
- {
- case 'x', 'X':
- {
- num = 0;
- continue;
- }
- case '0' .. '9':
- {
- num = (num << 4) | (ch - '0');
- }
- case 'a' .. 'f':
- {
- num = (num << 4) | (ch - ('a' - 10));
- }
- case 'A' .. 'F':
- {
- num = (num << 4) | (ch - ('A' - 10));
- }
- default:
- {
- return -1;
- }
- }
- }
- while ((ch = sstring[sstringPos]) > ' ' && ch != delim);
- setarg(paramPos, 0, num);
- }
- case 'c':
- {
- setarg(paramPos, 0, sstring[sstringPos++]);
- }
- case 'f':
- {
- new changestr[16], changepos = 0, strpos = sstringPos;
- while(changepos < 16 && sstring[strpos] && sstring[strpos] != delim)
- {
- changestr[changepos++] = sstring[strpos++];
- }
- changestr[changepos] = '\0';
- setarg(paramPos,0,_:floatstr(changestr));
- }
- case 'p':
- {
- delim = format[formatPos++];
- continue;
- }
- case '\'':
- {
- new
- end = formatPos - 1,
- ch;
- while ((ch = format[++end]) && ch != '\'') {}
- if (!ch)
- {
- return -1;
- }
- format[end] = '\0';
- if ((ch = strfind(sstring, format[formatPos], false, sstringPos)) == -1)
- {
- if (format[end + 1])
- {
- return -1;
- }
- return 0;
- }
- format[end] = '\'';
- sstringPos = ch + (end - formatPos);
- formatPos = end + 1;
- }
- case 'u':
- {
- new
- end = sstringPos - 1,
- id = 0,
- bool:num = true,
- ch;
- while ((ch = sstring[++end]) && ch != delim)
- {
- if (num)
- {
- if ('0' <= ch <= '9')
- {
- id = (id * 10) + (ch - '0');
- }
- else
- {
- num = false;
- }
- }
- }
- if (num && IsPlayerConnected(id))
- {
- setarg(paramPos, 0, id);
- }
- else
- {
- #if !defined foreach
- #define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
- #define __SSCANF_FOREACH__
- #endif
- sstring[end] = '\0';
- num = false;
- new
- name[MAX_PLAYER_NAME];
- id = end - sstringPos;
- foreach (Player, playerid)
- {
- GetPlayerName(playerid, name, sizeof (name));
- if (!strcmp(name, sstring[sstringPos], true, id))
- {
- setarg(paramPos, 0, playerid);
- num = true;
- break;
- }
- }
- if (!num)
- {
- setarg(paramPos, 0, INVALID_PLAYER_ID);
- }
- sstring[end] = ch;
- #if defined __SSCANF_FOREACH__
- #undef foreach
- #undef __SSCANF_FOREACH__
- #endif
- }
- sstringPos = end;
- }
- case 's', 'z':
- {
- new
- i = 0,
- ch;
- if (format[formatPos])
- {
- while ((ch = sstring[sstringPos++]) && ch != delim)
- {
- setarg(paramPos, i++, ch);
- }
- if (!i)
- {
- return -1;
- }
- }
- else
- {
- while ((ch = sstring[sstringPos++]))
- {
- setarg(paramPos, i++, ch);
- }
- }
- sstringPos--;
- setarg(paramPos, i, '\0');
- }
- default:
- {
- continue;
- }
- }
- while (sstring[sstringPos] && sstring[sstringPos] != delim && sstring[sstringPos] > ' ')
- {
- sstringPos++;
- }
- while (sstring[sstringPos] && (sstring[sstringPos] == delim || sstring[sstringPos] <= ' '))
- {
- sstringPos++;
- }
- paramPos++;
- }
- do
- {
- if ((delim = format[formatPos++]) > ' ')
- {
- if (delim == '\'')
- {
- while ((delim = format[formatPos++]) && delim != '\'') {}
- }
- else if (delim != 'z')
- {
- return delim;
- }
- }
- }
- while (delim > ' ');
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement