daily pastebin goal
44%
SHARE
TWEET

Untitled

a guest Dec 12th, 2018 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //SELFMADE BY CANNN (C)
  2. //DAS SCRIPT DARF NUR CANNN AKA Master147 benutzen
  3.  
  4. //Includes
  5. #include <a_samp>
  6. #include <a_mysql>
  7. #include <ocmd>
  8.  
  9. //MYSQL
  10. #define MYSQL_HOST "localhost"
  11. #define MYSQL_USER "sql15"
  12. #define MYSQL_DB "sql15"
  13. #define MYSQL_PW "WAxqf67nYq"
  14.  
  15. //Defines
  16. #define MAX_FRAKTIONEN 11
  17. #define MAX_CHATRADIUS 40
  18. #define MAX_FRAKVEHICLE 500
  19. #define MAX_DRIVEINS 2
  20.  
  21. //Enums
  22. enum SpielerDaten
  23. {
  24.     pDB,
  25.     pEingeloggt,
  26.     pAlter,
  27.     pGeschlecht,
  28.     pLevel,
  29.     pGeld,
  30.     pAdmin,
  31.     pFraktion,
  32.     pLeader,
  33.     pRang,
  34.     pSkin,
  35.     pFSkin,
  36.     pTot,
  37.     pFriedhofzeit,
  38.     Float:ptX,
  39.     Float:ptY,
  40.     Float:ptZ,
  41.     pAduty,
  42.     pDuty,
  43.     pWanteds,
  44.     Text3D:pAdutyLabel,
  45.     pSupmobil,
  46.     pSupID,
  47.     pSupErstellt,
  48.     pJailed
  49. }
  50. enum FrakSpawns
  51. {
  52.     Float:fSpawnX,
  53.     Float:fSpawnY,
  54.     Float:fSpawnZ,
  55.     Float:fAngle,
  56.     fInterior
  57. }
  58. enum FrakDaten
  59. {
  60.     fMats,
  61.     fGeld,
  62.     fDrogen,
  63.     fRangName0[32],
  64.     fRangName1[32],
  65.     fRangName2[32],
  66.     fRangName3[32],
  67.     fRangName4[32],
  68.     fRangName5[32],
  69.     fRangName6[32],
  70.     Text3D:fWLabel
  71. }
  72. enum FrakCarDaten
  73. {
  74.     fcID,
  75.     fvfrakid,
  76.     Float:fvX,
  77.     Float:fvY,
  78.     Float:fvZ,
  79.     Float:fvA,
  80.     fvmodelid,
  81.     fvcolor1,
  82.     fvcolor2,
  83.     fvpaintjob,
  84.     fvnitro,
  85.     fvwheels,
  86.     fvfrontbumper,
  87.     fvrearbumper,
  88.     fvhydraulics,
  89.     fvventright,
  90.     fvventleft,
  91.     fvexhaust,
  92.     fvlamps,
  93.     fvhood,
  94.     fvroof,
  95.     fvstereo,
  96.     fvsideskirt,
  97.     fvspoiler,
  98.     fvCar,
  99.     fvAbgeschlossen
  100. }
  101. enum DriveInDaten
  102. {
  103.     drBeschreibung[64],
  104.     Float:drX,
  105.     Float:drY,
  106.     Float:drZ
  107. }
  108. enum
  109. {
  110.     DIALOG_REGISTER,
  111.     DIALOG_LOGIN,
  112.     DIALOG_GESCHLECHT,
  113.     DIALOG_ALTER,
  114.     DIALOG_BANNED
  115. }
  116.  
  117. //Farben
  118. #define COLOR_FCHAT 0x00FFFFFF
  119. #define COLOR_HELLRED 0xFF6347AA
  120. #define COLOR_GELB 0xFFFF00FF
  121. #define COLOR_GRUN 0x00FF00FF
  122. #define COLOR_BLAU 0x008CFFFF
  123. #define COLOR_WEISS 0xFFFFFFFF
  124. #define COLOR_GRAU 0xB4B4B4FF
  125. #define COLOR_ORANGE 0xFF9100FF
  126. #define COLOR_PDBLAU 0x8D8DFF00
  127. #define COLOR_MEFARBE 0xC2A2DAAA
  128.  
  129. #define HTML_GELB "{FFFF00}"
  130. #define HTML_GRUN "{00FF00}"
  131. #define HTML_ORANGE "{FF9100}"
  132. #define HTML_WHITE "{FFFFFF}"
  133. #define HTML_BLAU "{008CFF}"
  134. #define HTML_ROT "{FF0000}"
  135. #define HTML_FCHAT "{00FFFF}"
  136. #define HTML_BRAUN "{351107}"
  137. #define HTML_LILA "{CF00CC}"
  138.  
  139. //Arrays
  140. new sInfo[MAX_PLAYERS][SpielerDaten];
  141. new MYSQLConnect;
  142. new Eingang[10];
  143. new Ausgang[9];
  144. new FrakSpawn[MAX_FRAKTIONEN][FrakSpawns] =
  145. {
  146.     {0.0,0.0,0.0,0.0,0},//Zivi
  147.     {219.4022,69.7227,1005.0391,269.3878,6},//LSPD
  148.     {1172.8494,-1323.4645,15.3998,268.2082,0},//Medic
  149.     {914.9569,-1235.3580,17.2109,86.9549,0},//Ordnungsamt
  150.     {0.0,0.0,5.0,0.0,0},//News Reporter
  151.     {1336.0000,57.1983,1004.6094,179.4671,3},//Grove Street
  152.     {2817.1501,-1166.5499,1029.1719,88.9502,8},//Ballas Familie
  153.     {-2666.5310,1428.6108,906.4609,136.2709,3},//Yakuza
  154.     {1726.9073,-1638.6433,20.2233,175.3114,18},//Triaden
  155.     {2451.3828,-1687.0472,1013.5078,159.1541,2},//Los Aztecas
  156.     {958.9485,2099.3567,1011.0247,0.7586,1}//Hitman
  157. };
  158. new fInfo[MAX_FRAKTIONEN][FrakDaten];
  159. new Text3D:AusrustungsLabel[MAX_FRAKTIONEN];
  160. new fvInfo[MAX_FRAKVEHICLE][FrakCarDaten];
  161. new engine,lights,doors,bonnet,alarm,boot,objective;
  162. new bool:motor[MAX_VEHICLES];
  163. new bool:licht[MAX_VEHICLES];
  164. new Float:MarkX[MAX_PLAYERS],
  165.     Float:MarkY[MAX_PLAYERS],
  166.     Float:MarkZ[MAX_PLAYERS],
  167.     MarkInt[MAX_PLAYERS],
  168.     MarkStatus[MAX_PLAYERS];
  169. new DriveInInfo[MAX_DRIVEINS][DriveInDaten] =
  170. {
  171.     {"Burger Shot Nord",1214.3571,-905.0054,42.9211},
  172.     {"Burger Shot S¸d",800.5970,-1629.7184,12.9535}
  173. };
  174. new driveintimer[MAX_PLAYERS];
  175. new Float:ConnectScreen[][12] =
  176. {
  177.     {1131.192138, -1690.832641, 79.757575, 1131.578613, -1579.767822, 51.070774,1131.208862, -1686.012207, 78.429939, 1131.595458, -1574.926147, 49.822402},
  178.     {1404.944213, -2197.988525, 94.882888, 1473.446533, -2212.892333, 55.090850, 1407.467895, -2200.531982, 91.395492, 1473.514892, -2217.087646, 52.371677},
  179.     {1344.704711, -950.040222, 75.134803, 1394.961425, -885.238403, 72.249008,1347.684204, -946.062683, 74.585136, 1396.077636, -880.411926, 72.926605}
  180. };
  181. new Float:Knastzellen[][3] =
  182. {
  183.     {264.3430,86.7852,1001.0391},
  184.     {264.2431,81.8529,1001.0391}
  185. };
  186.  
  187. //TextDraws
  188. new Text:Uhr;
  189. new Text:Datum;
  190. new Text:LR_OBEN;
  191. new Text:LR_UNTEN;
  192.  
  193. //forward
  194. forward OnSpielerCheck(playerid);
  195. forward OnSpielerRegister(playerid);
  196. forward OnSpielerLoad(playerid);
  197. forward OnSpielerBanned(playerid);
  198. forward UpdateServer();
  199. forward KickPlayer(playerid);
  200. forward FrakVehicleSaved(i);
  201. forward OnFrakVehicleLoad();
  202. forward OnFraktionenLoad();
  203. forward AntiCheat();
  204. forward UpdateDriveIn(playerid);
  205. forward SetPlayerConnect(playerid);
  206. forward ShowLoginRegister(playerid);
  207.  
  208. main()
  209. {
  210.     print("\n----------------------------------");
  211.     print("Selfmade wurde geladen!");
  212.     print("----------------------------------\n");
  213. }
  214.  
  215. public OnGameModeInit()
  216. {
  217.     //Allgemein
  218.     MYSQLConnect = mysql_connect(MYSQL_HOST,MYSQL_USER,MYSQL_DB,MYSQL_PW);
  219.     SetGameModeText("Selfmade");
  220.     DisableInteriorEnterExits();
  221.     EnableStuntBonusForAll(0);
  222.     ShowPlayerMarkers(0);
  223.     ManualVehicleEngineAndLights();
  224.     UsePlayerPedAnims();
  225.     AntiDeAMX();
  226.     LoadFrakVehicle();
  227.     LoadFraktionen();
  228.  
  229.     //Timer
  230.     SetTimer("UpdateServer",1000,true);
  231.     SetTimer("AntiCheat",1000,true);
  232.  
  233.     //Fraktion Base
  234.     Eingang[0] = CreatePickup(1559,1,1554.8467,-1675.6138,16.1953);//Los Santos Police Department Eingag
  235.     Ausgang[0] = CreatePickup(1559,1,246.7710,62.9697,1003.6406);//Los Santos Police Department Ausgang
  236.     Create3DTextLabel(""#HTML_BLAU".::"#HTML_WHITE"Los Santos Police Department"#HTML_BLAU"::.",COLOR_WEISS,1554.8467,-1675.6138,16.1953,20,0);//Los Santos Police Department Eingag
  237.     Eingang[1] = CreatePickup(1559,1,288.6967,-1604.8640,17.8593);//Hitman Eingang
  238.     Ausgang[1] = CreatePickup(1559,1,964.6661,2107.8538,1011.0303);//Hitman Ausgang
  239.     Eingang[2] = CreatePickup(1559,1,2495.3694,-1690.7284,14.7656);//Grove Street Eingang
  240.     Ausgang[2] = CreatePickup(1559,1,1339.6687,67.1766,1001.0078);//Grove Street Ausgang
  241.     Create3DTextLabel(""#HTML_GRUN".::"#HTML_WHITE"Grove Street"#HTML_GRUN"::.",COLOR_WEISS,2495.3694,-1690.7284,14.7656,20,0);//Grove Street Eingang
  242.     Eingang[3] = CreatePickup(1559,1,1905.9600,-1112.9438,26.6641);//Ballas Familie Eingang
  243.     Ausgang[3] = CreatePickup(1559,1,2807.6194,-1174.2587,1025.5703);//Ballas Familie Ausgang
  244.     Create3DTextLabel(""#HTML_LILA".::"#HTML_WHITE"Ballas Familie"#HTML_LILA"::.",COLOR_WEISS,1905.9600,-1112.9438,26.6641,20,0);//Ballas Familie Eingang
  245.     Eingang[4] = CreatePickup(1559,1,919.4680,-1252.1660,16.2109);//Ordnungsamt Eingang
  246.     Ausgang[4] = CreatePickup(1559,1,0,0,0);//Ordnungsamt Ausgang
  247.     Create3DTextLabel(".::Ordnungsamt::.",COLOR_WEISS,919.4680,-1252.1660,16.2109,20,0);//Ordnungsamt Eingang
  248.     Eingang[5] = CreatePickup(1559,1,300.2671,-1154.4735,81.3913);//Yakuza Eingang
  249.     Ausgang[5] = CreatePickup(1559,1,-2636.7070,1402.6381,906.4609);//Yakuza Ausgang
  250.     Create3DTextLabel(".::Yakuza::.",COLOR_WEISS,300.2671,-1154.4735,81.3913,20,0);//Yakuza Eingang
  251.     Eingang[6] = CreatePickup(1559,1,1496.9625,-687.8925,95.5633);//Triaden Eingang
  252.     Ausgang[6] = CreatePickup(1559,1,1701.0804,-1667.8890,20.2188);//Triaden Ausgang
  253.     Create3DTextLabel(""#HTML_BRAUN".::"#HTML_WHITE"Triaden"#HTML_BRAUN"::.",COLOR_WEISS,1496.9625,-687.8925,95.5633,20,0);//Triaden Eingang
  254.     Eingang[7] = CreatePickup(1559,1,2751.8171,-1962.9017,13.5469);//Aztecas Eingang
  255.     Ausgang[7] = CreatePickup(1559,1,2468.5837,-1698.3329,1013.5078);//Aztecas Ausgang
  256.     Create3DTextLabel(""#HTML_FCHAT".::"#HTML_WHITE"Los Aztecas"#HTML_FCHAT"::.",COLOR_WEISS,2751.8171,-1962.9017,13.5469,20,0);//Aztecas Eingang
  257.     Eingang[8] = CreatePickup(1559,1,1219.1655,-1812.1086,16.5938);//News Reporter Eingang
  258.     Create3DTextLabel(".::News Reporter::.",COLOR_WEISS,1219.1655,-1812.1086,16.5938,20,0);//News Reporter Eingang
  259.  
  260.     //LSPD
  261.     CreatePickup(1247,1,252.1830,70.1469,1003.6406);//Su vergabe Stern
  262.     CreatePickup(1247,1,254.4515,76.7813,1003.6406);//Dienstpunkt Stern
  263.     Create3DTextLabel("Dienstpunkt\n"#HTML_WHITE"/equip || Taste: N",COLOR_GELB,254.4515,76.7813,1003.6406,10,0,1);//Dienstpunkt Stern
  264.     CreatePickup(1239,1,246.4084,87.7833,1003.6406);//Garage Aufzug Interior
  265.     Create3DTextLabel(""#HTML_ORANGE"LSPD Aufzug\n"#HTML_WHITE"Taste: N",COLOR_WEISS,246.4084,87.7833,1003.6406,10,0,1);//Garage Aufzug Interior
  266.     CreatePickup(1239,1,1568.6493,-1689.9703,6.2188);//Garage Aufzug Garage
  267.     Create3DTextLabel(""#HTML_ORANGE"LSPD Aufzug\n"#HTML_WHITE"Taste: N",COLOR_WEISS,1568.6493,-1689.9703,6.2188,10,0,1);//Garage Aufzug Interior
  268.  
  269.     //DriveIn
  270.     new drstring[128];
  271.     for(new d = 0; d < sizeof(DriveInInfo); d++)
  272.     {
  273.         CreatePickup(1240,1,DriveInInfo[d][drX],DriveInInfo[d][drY],DriveInInfo[d][drZ]);
  274.         format(drstring,sizeof(drstring),""#HTML_ORANGE"%s\n"#HTML_WHITE"/drivein zum bestellen",DriveInInfo[d][drBeschreibung]);
  275.         Create3DTextLabel(drstring,COLOR_WEISS,DriveInInfo[d][drX],DriveInInfo[d][drY],DriveInInfo[d][drZ],20,0,1);
  276.     }
  277.  
  278.     //Grove Street Interior
  279.     CreateObject(14476,1337.70,60.45,1000.00, 0.00,0.00,0.00);
  280.     CreateObject(14471,1340.13,50.79,1001.75, 0.00,0.00,180.00);
  281.     CreateObject(14477,1345.03,61.83,1002.41, 0.00,0.00,0.00);
  282.     CreateObject(2830,1336.56,56.30,1000.86, 0.00,0.00,0.00);
  283.     CreateObject(14489,1334.09,64.82,1001.90, 0.00,0.00,0.00);
  284.     CreateObject(14491,1345.01,61.90,1002.39, 0.00,0.00,0.00);
  285.     CreateObject(2028,1335.45,64.56,1000.09, 0.00,0.00,0.00);
  286.     CreateObject(1498,1338.90,68.07,999.98, 0.00,0.00,0.00);
  287.     CreateObject(2827,1341.66,62.23,1001.01, 0.00,0.00,90.00);
  288.     CreateObject(14472,1341.54,50.69,1001.49, 0.00,0.00,180.00);
  289.     CreateObject(2028,1335.15,58.77,1003.68, 0.00,0.00,0.00);
  290.     CreateObject(2827,1337.51,59.24,1003.61, 0.00,0.00,0.00);
  291.     CreateObject(2821,1344.10,54.03,1001.12, 0.00,0.00,0.00);
  292.     CreateObject(1567,1335.29,50.72,1003.61, 0.00,0.00,0.00);
  293.     CreateObject(2073,1337.00,56.59,1006.79, 0.00,0.00,0.00);
  294.     CreateObject(1740,1339.09,55.18,1003.61, 0.00,0.00,-135.00);
  295.     CreateObject(1740,1335.52,58.54,1003.61, 0.00,0.00,45.00);
  296.     CreateObject(2272,1337.93,59.41,1005.09, 0.00,0.00,0.00);
  297.     CreateObject(1794,1336.90,57.69,1003.59, 0.00,0.00,-90.00);
  298.     CreateObject(2816,1339.10,57.24,1004.27, 0.00,0.00,0.00);
  299.     CreateObject(2247,1339.85,54.45,1004.87, 0.00,0.00,0.00);
  300.  
  301.  
  302.     //TextDraws
  303.     Uhr = TextDrawCreate(576.000000, 21.000000, "00:00");
  304.     TextDrawAlignment(Uhr, 2);
  305.     TextDrawBackgroundColor(Uhr, 255);
  306.     TextDrawFont(Uhr, 3);
  307.     TextDrawLetterSize(Uhr, 0.569998, 1.799999);
  308.     TextDrawColor(Uhr, COLOR_BLAU);
  309.     TextDrawSetOutline(Uhr, 1);
  310.     TextDrawSetProportional(Uhr, 0);
  311.  
  312.     Datum = TextDrawCreate(546.000000, 10.000000, "31.12.2015");
  313.     TextDrawBackgroundColor(Datum, 255);
  314.     TextDrawFont(Datum, 3);
  315.     TextDrawLetterSize(Datum, 0.280000, 1.200000);
  316.     TextDrawColor(Datum, COLOR_BLAU);
  317.     TextDrawSetOutline(Datum, 1);
  318.     TextDrawSetProportional(Datum, 0);
  319.    
  320.     LR_OBEN = TextDrawCreate(686.500000, 1.500000, "usebox");
  321.     TextDrawLetterSize(LR_OBEN, 0.000000, 13.510495);
  322.     TextDrawTextSize(LR_OBEN, -2.000000, 0.000000);
  323.     TextDrawAlignment(LR_OBEN, 1);
  324.     TextDrawColor(LR_OBEN, 0);
  325.     TextDrawUseBox(LR_OBEN, true);
  326.     TextDrawBoxColor(LR_OBEN, 255);
  327.     TextDrawSetShadow(LR_OBEN, 0);
  328.     TextDrawSetOutline(LR_OBEN, 0);
  329.     TextDrawFont(LR_OBEN, 0);
  330.  
  331.     LR_UNTEN = TextDrawCreate(701.500000, 319.455566, "usebox");
  332.     TextDrawLetterSize(LR_UNTEN, 0.000000, 15.813579);
  333.     TextDrawTextSize(LR_UNTEN, -2.000000, 0.000000);
  334.     TextDrawAlignment(LR_UNTEN, 1);
  335.     TextDrawColor(LR_UNTEN, 0);
  336.     TextDrawUseBox(LR_UNTEN, true);
  337.     TextDrawBoxColor(LR_UNTEN, 255);
  338.     TextDrawSetShadow(LR_UNTEN, 0);
  339.     TextDrawSetOutline(LR_UNTEN, 0);
  340.     TextDrawFont(LR_UNTEN, 0);
  341.     return 1;
  342. }
  343.  
  344. public OnGameModeExit()
  345. {
  346.     mysql_close(MYSQLConnect);
  347.     return 1;
  348. }
  349.  
  350. public OnPlayerRequestClass(playerid, classid)
  351. {
  352.     SetSpawnInfo( playerid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 );
  353.     if(sInfo[playerid][pEingeloggt] == 0)
  354.     {
  355.         SetTimerEx("SetPlayerConnect",100,false,"i",playerid);
  356.     }
  357.     return 1;
  358. }
  359.  
  360. public OnPlayerConnect(playerid)
  361. {
  362.     SetPlayerColor(playerid,COLOR_GRAU);
  363.     return 1;
  364. }
  365.  
  366. public OnPlayerDisconnect(playerid, reason)
  367. {
  368.     SaveSpieler(playerid);
  369.     ResetSpieler(playerid);
  370.     TextDrawHideForPlayer(playerid,Uhr);
  371.     TextDrawHideForPlayer(playerid,Datum);
  372.     TextDrawHideForPlayer(playerid,LR_OBEN);
  373.     TextDrawHideForPlayer(playerid,LR_UNTEN);
  374.     return 1;
  375. }
  376.  
  377. public OnPlayerSpawn(playerid)
  378. {
  379.     if(sInfo[playerid][pEingeloggt] == 0)return 1;
  380.     //TextDraws
  381.     TextDrawShowForPlayer(playerid,Uhr);
  382.     TextDrawShowForPlayer(playerid,Datum);
  383.     TextDrawHideForPlayer(playerid,LR_OBEN);
  384.     TextDrawHideForPlayer(playerid,LR_UNTEN);
  385.     sInfo[playerid][pAdmin] = 4;
  386.     SetPlayerColor(playerid,-1);
  387.     if(!isFrakt(playerid,0))
  388.     {
  389.         SetPlayerPos(playerid,FrakSpawn[sInfo[playerid][pFraktion]][fSpawnX],FrakSpawn[sInfo[playerid][pFraktion]][fSpawnY],FrakSpawn[sInfo[playerid][pFraktion]][fSpawnZ]);
  390.         SetPlayerFacingAngle(playerid,FrakSpawn[sInfo[playerid][pFraktion]][fAngle]);
  391.         SetPlayerInterior(playerid,FrakSpawn[sInfo[playerid][pFraktion]][fInterior]);
  392.     }
  393.     switch(sInfo[playerid][pFraktion])
  394.     {
  395.         case 0:{SetPlayerSkin(playerid,sInfo[playerid][pSkin]);}
  396.         case 1:{SetPlayerSkin(playerid,sInfo[playerid][pSkin]);}
  397.         case 2:{SetPlayerSkin(playerid,sInfo[playerid][pSkin]);}
  398.         case 3:{SetPlayerSkin(playerid,sInfo[playerid][pSkin]);}
  399.         case 4:{SetPlayerSkin(playerid,sInfo[playerid][pFSkin]);}
  400.         case 5:{SetPlayerSkin(playerid,sInfo[playerid][pFSkin]);}
  401.         case 6:{SetPlayerSkin(playerid,sInfo[playerid][pFSkin]);}
  402.         case 7:{SetPlayerSkin(playerid,sInfo[playerid][pFSkin]);}
  403.         case 8:{SetPlayerSkin(playerid,sInfo[playerid][pFSkin]);}
  404.         case 9:{SetPlayerSkin(playerid,sInfo[playerid][pFSkin]);}
  405.         case 10:{SetPlayerSkin(playerid,sInfo[playerid][pFSkin]);}
  406.     }
  407.     return 1;
  408. }
  409.  
  410. public OnPlayerDeath(playerid, killerid, reason)
  411. {
  412.     new Float:X,Float:Y,Float:Z;
  413.     GetPlayerPos(playerid,X,Y,Z);
  414.     sInfo[playerid][pTot] = 1;
  415.     sInfo[playerid][ptX] = X;
  416.     sInfo[playerid][ptY] = Y;
  417.     sInfo[playerid][ptZ] = Z;
  418.     if(killerid != INVALID_PLAYER_ID)
  419.     {
  420.         SendClientMessage(killerid,COLOR_HELLRED,"Du hast ein Verbrechen begangen[Mord]. Reporter: Anonym");
  421.     }
  422.     return 1;
  423. }
  424.  
  425. public OnVehicleSpawn(vehicleid)
  426. {
  427.     motor[vehicleid] = false;
  428.     licht[vehicleid] = false;
  429.     for(new i = 0; i < MAX_FRAKVEHICLE; i++)
  430.     {
  431.         if(fvInfo[i][fvCar] == vehicleid)
  432.         {
  433.             fVehTuning(i);
  434.         }
  435.     }
  436.     return 1;
  437. }
  438.  
  439. public OnVehicleDeath(vehicleid, killerid)
  440. {
  441.     return 1;
  442. }
  443.  
  444. public OnPlayerText(playerid, text[])
  445. {
  446.     new string[128],Float:X,Float:Y,Float:Z,color;
  447.     GetPlayerPos(playerid,X,Y,Z);
  448.     format(string,sizeof(string),"%s sagt: %s",SpielerName(playerid),text);
  449.     for(new i = 0; i < GetMaxPlayers(); i++)
  450.     {
  451.         if(!IsPlayerConnected(i))continue;
  452.         if(sInfo[i][pEingeloggt] == 0)continue;
  453.         if(!IsPlayerInRangeOfPoint(i,MAX_CHATRADIUS,X,Y,Z))continue;
  454.         new Float:distance = GetPlayerDistanceFromPoint(i,X,Y,Z);
  455.         if(distance < MAX_CHATRADIUS)
  456.         {
  457.             color = COLOR_WEISS;
  458.         }
  459.         else if(distance < MAX_CHATRADIUS/2)
  460.         {
  461.             color = COLOR_GRAU;
  462.         }
  463.         SendClientMessage(i,color,string);
  464.     }
  465.     return 0;
  466. }
  467.  
  468. public OnPlayerCommandText(playerid, cmdtext[])
  469. {
  470.     return 1;
  471. }
  472. ocmd:gotocar(playerid,params[])
  473. {
  474.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  475.     if(!isAdmin(playerid,2))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  476.     if(sInfo[playerid][pAduty] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht ADuty.");
  477.     new carid,Float:X,Float:Y,Float:Z;
  478.     if(sscanf(params,"d",carid))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /gotocar [Carid]");
  479.     if(carid == INVALID_VEHICLE_ID)return SendClientMessage(playerid,COLOR_GRAU,"Das Fahrzeug existiert nicht.");
  480.     GetVehiclePos(carid,X,Y,Z);
  481.     SetPlayerPos(playerid,X+2,Y,Z);
  482.     SendClientMessage(playerid,COLOR_GELB,"Du hast dich zu einem Fahrzeug geportet.");
  483.     return 1;
  484. }
  485. ocmd:getcar(playerid,params[])
  486. {
  487.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  488.     if(!isAdmin(playerid,2))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  489.     if(sInfo[playerid][pAduty] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht ADuty.");
  490.     new carid,Float:X,Float:Y,Float:Z;
  491.     if(sscanf(params,"d",carid))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /getcar [Carid]");
  492.     if(carid == INVALID_VEHICLE_ID)return SendClientMessage(playerid,COLOR_GRAU,"Das Fahrzeug existiert nicht.");
  493.     GetPlayerPos(playerid,X,Y,Z);
  494.     SetVehiclePos(carid,X+2,Y,Z);
  495.     SendClientMessage(playerid,COLOR_GELB,"Du hast ein Fahrzeug geportet.");
  496.     return 1;
  497. }
  498. ocmd:gotols(playerid,params[])
  499. {
  500.     #pragma unused params
  501.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  502.     if(!isAdmin(playerid,1))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  503.     if(sInfo[playerid][pAduty] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht ADuty.");
  504.     if(IsPlayerInAnyVehicle(playerid))
  505.     {
  506.         new carid = GetPlayerVehicleID(playerid);
  507.         SetVehiclePos(carid,1512.7789,-1662.6571,13.5469);
  508.         SetPlayerPos(playerid,1512.7789,-1662.6571,13.5469);
  509.         SetPlayerInterior(playerid,0);
  510.         LinkVehicleToInterior(carid, 0);
  511.         PutPlayerInVehicle(playerid,carid,0);
  512.     }
  513.     else
  514.     {
  515.         SetPlayerPos(playerid,1512.7789,-1662.6571,13.5469);
  516.         SetPlayerInterior(playerid,0);
  517.     }
  518.     return 1;
  519. }
  520. ocmd:goto(playerid,params[])
  521. {
  522.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  523.     if(!isAdmin(playerid,1))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  524.     if(sInfo[playerid][pAduty] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht ADuty.");
  525.     new pID,Float:X,Float:Y,Float:Z;
  526.     if(sscanf(params,"u",pID))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /goto [SpielerName/ID]");
  527.     if(!IsPlayerConnected(pID))return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Online.");
  528.     if(sInfo[pID][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Eingeloggt.");
  529.     new interior = GetPlayerInterior(pID);
  530.     GetPlayerPos(pID,X,Y,Z);
  531.     if(IsPlayerInAnyVehicle(playerid))
  532.     {
  533.         new carid = GetPlayerVehicleID(playerid);
  534.         SetVehiclePos(carid,X+2,Y,Z);
  535.         SetPlayerPos(playerid,X+2,Y,Z);
  536.         SetPlayerInterior(playerid,interior);
  537.         LinkVehicleToInterior(carid, interior);
  538.         PutPlayerInVehicle(playerid,carid,0);
  539.     }
  540.     else
  541.     {
  542.         SetPlayerPos(playerid,X+2,Y,Z);
  543.         SetPlayerInterior(playerid,interior);
  544.     }
  545.     return 1;
  546. }
  547. ocmd:gethere(playerid,params[])
  548. {
  549.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  550.     if(!isAdmin(playerid,1))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  551.     if(sInfo[playerid][pAduty] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht ADuty.");
  552.     new pID,Float:X,Float:Y,Float:Z;
  553.     if(sscanf(params,"u",pID))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /gethere [SpielerName/ID]");
  554.     if(!IsPlayerConnected(pID))return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Online.");
  555.     if(sInfo[pID][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Eingeloggt.");
  556.     new interior = GetPlayerInterior(playerid);
  557.     GetPlayerPos(playerid,X,Y,Z);
  558.     if(IsPlayerInAnyVehicle(pID))
  559.     {
  560.         new carid = GetPlayerVehicleID(pID);
  561.         SetVehiclePos(carid,X+2,Y,Z);
  562.         SetPlayerPos(pID,X+2,Y,Z);
  563.         SetPlayerInterior(pID,interior);
  564.         LinkVehicleToInterior(carid, interior);
  565.         PutPlayerInVehicle(pID,carid,0);
  566.         SendClientMessage(pID,COLOR_GELB,"Du wurdest Teleportiert.");
  567.     }
  568.     else
  569.     {
  570.         SetPlayerPos(pID,X+2,Y,Z);
  571.         SetPlayerInterior(pID,interior);
  572.         SendClientMessage(pID,COLOR_GELB,"Du wurdest Teleportiert.");
  573.     }
  574.     return 1;
  575. }
  576. ocmd:makeadmin(playerid,params[])
  577. {
  578.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  579.     if(!isAdmin(playerid,4))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  580.     if(sInfo[playerid][pAduty] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht ADuty.");
  581.     new pID,level,string[128];
  582.     if(sscanf(params,"ud",pID,level))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /makeadmin [SpielerName/ID][Adminlevel]");
  583.     if(!IsPlayerConnected(pID))return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Online.");
  584.     if(sInfo[pID][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Eingeloggt.");
  585.     sInfo[pID][pAdmin] = level;
  586.     format(string,sizeof(string),"*Serverleiter %s hat dich zum %s befˆrdert.",SpielerName(playerid),AdminRang(level));
  587.     SendClientMessage(pID,COLOR_FCHAT,string);
  588.     format(string,sizeof(string),"Du hast %s zum %s befˆrdert.",SpielerName(pID),AdminRang(level));
  589.     SendClientMessage(playerid,COLOR_FCHAT,string);
  590.     return 1;
  591. }
  592. ocmd:freeze(playerid,params[])
  593. {
  594.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  595.     if(!isAdmin(playerid,1))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  596.     if(sInfo[playerid][pAduty] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht ADuty.");
  597.     new pID;
  598.     if(sscanf(params,"u",pID))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /freeze [SpielerName/ID]");
  599.     if(!IsPlayerConnected(pID))return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Online.");
  600.     if(sInfo[pID][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Eingeloggt.");
  601.     FreezeSpieler(pID);
  602.     return 1;
  603. }
  604. ocmd:afrangname(playerid,params[])
  605. {
  606.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  607.     if(!isAdmin(playerid,3))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  608.     if(sInfo[playerid][pAduty] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht ADuty.");
  609.     new fID,rank,rankname[32],string[128];
  610.     if(sscanf(params,"dds",fID,rank,rankname))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /afrangname [Fraktion][Rang][Rangname]");
  611.     if(fID < 1 || fID > 10)return SendClientMessage(playerid,COLOR_GRAU,"Die FrakID muss zwischen 1-10 liegen");
  612.     switch(rank)
  613.     {
  614.         case 0:{format(fInfo[fID][fRangName0],sizeof(rankname),"%s",rankname);}
  615.         case 1:{format(fInfo[fID][fRangName1],sizeof(rankname),"%s",rankname);}
  616.         case 2:{format(fInfo[fID][fRangName2],sizeof(rankname),"%s",rankname);}
  617.         case 3:{format(fInfo[fID][fRangName3],sizeof(rankname),"%s",rankname);}
  618.         case 4:{format(fInfo[fID][fRangName4],sizeof(rankname),"%s",rankname);}
  619.         case 5:{format(fInfo[fID][fRangName5],sizeof(rankname),"%s",rankname);}
  620.         case 6:{format(fInfo[fID][fRangName6],sizeof(rankname),"%s",rankname);}
  621.     }
  622.     format(string,sizeof(string),"Du hast den %d Rang der Fraktion %s auf %s ge‰ndert.",rank,FraktionName(fID),rankname);
  623.     SendClientMessage(playerid,COLOR_GELB,string);
  624.     return 1;
  625. }
  626. ocmd:unfreeze(playerid,params[])
  627. {
  628.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  629.     if(!isAdmin(playerid,1))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  630.     if(sInfo[playerid][pAduty] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht ADuty.");
  631.     new pID;
  632.     if(sscanf(params,"u",pID))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /unfreeze [SpielerName/ID]");
  633.     if(!IsPlayerConnected(pID))return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Online.");
  634.     if(sInfo[pID][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Eingeloggt.");
  635.     UnFreezeSpieler(pID);
  636.     return 1;
  637. }
  638. ocmd:a(playerid,params[])
  639. {
  640.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  641.     if(!isAdmin(playerid,1))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  642.     if(sInfo[playerid][pAduty] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht ADuty.");
  643.     new text[64],string[128];
  644.     if(sscanf(params,"s",text))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /a(chat) [Text]");
  645.     format(string,sizeof(string),"%s %s: %s",AdminRang(sInfo[playerid][pAdmin]),SpielerName(playerid),text);
  646.     SendAdminMessage(COLOR_HELLRED,string);
  647.     return 1;
  648. }
  649. ocmd:makeleader(playerid,params[])
  650. {
  651.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  652.     if(!isAdmin(playerid,3))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  653.     if(sInfo[playerid][pAduty] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht ADuty.");
  654.     new pID,fID,string[128];
  655.     if(sscanf(params,"ud",pID,fID))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /makeleader [SpielerName/ID][Fraktion]");
  656.     if(fID < 1 || fID > 10)return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /makeleader [SpielerName/ID][Fraktion]");
  657.     if(sInfo[pID][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Eingeloggt.");
  658.     if(!IsPlayerConnected(pID))return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Online.");
  659.     sInfo[pID][pFraktion] = fID;
  660.     sInfo[pID][pRang] = 6;
  661.     sInfo[pID][pLeader] = 1;
  662.     switch(fID)
  663.     {
  664.         case 1:{SetPlayerSkin(pID,288),sInfo[pID][pFSkin] = 288;}
  665.         case 2:{SetPlayerSkin(pID,70),sInfo[pID][pFSkin] = 70;}
  666.         case 3:{SetPlayerSkin(pID,71),sInfo[pID][pFSkin] = 71;}
  667.         case 4:{SetPlayerSkin(pID,187),sInfo[pID][pFSkin] = 187;}
  668.         case 5:{SetPlayerSkin(pID,270),sInfo[pID][pFSkin] = 270;}
  669.         case 6:{SetPlayerSkin(pID,103),sInfo[pID][pFSkin] = 103;}
  670.         case 7:{SetPlayerSkin(pID,186),sInfo[pID][pFSkin] = 186;}
  671.         case 8:{SetPlayerSkin(pID,120),sInfo[pID][pFSkin] = 120;}
  672.         case 9:{SetPlayerSkin(pID,46),sInfo[pID][pFSkin] = 46;}
  673.         case 10:{SetPlayerSkin(pID,144),sInfo[pID][pFSkin] = 144;}
  674.     }
  675.     format(string,sizeof(string),"*%s %s hat dich zum Leader der Fraktion %s befˆrdert.",AdminRang(sInfo[playerid][pAdmin]),SpielerName(playerid),FraktionName(fID));
  676.     SendClientMessage(pID,COLOR_BLAU,string);
  677.     format(string,sizeof(string),"Du hast %s zum Leader der Fraktion %s befˆrdert.",SpielerName(pID),FraktionName(fID));
  678.     SendClientMessage(playerid,COLOR_BLAU,string);
  679.     SaveSpieler(pID);
  680.     SpawnPlayerEx(pID);
  681.     return 1;
  682. }
  683. ocmd:setskin(playerid,params[])
  684. {
  685.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  686.     if(!isAdmin(playerid,2))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  687.     if(sInfo[playerid][pAduty] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht ADuty.");
  688.     new pID,skinID,string[128];
  689.     if(sscanf(params,"ud",pID,skinID))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /setskin [SpielerName/ID][SkinID]");
  690.     if(!IsPlayerConnected(pID))return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Online.");
  691.     if(sInfo[pID][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Eingeloggt.");
  692.     if(skinID < 0 || skinID > 311)return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /setskin [SpielerName/ID][SkinID 0-311]");
  693.     SetPlayerSkin(pID,skinID);
  694.     format(string,sizeof(string),"Du hast dem Spieler %s die SkinID %d gesetzt.",SpielerName(pID),skinID);
  695.     SendClientMessage(playerid,COLOR_GELB,string);
  696.     return 1;
  697. }
  698. ocmd:sethp(playerid,params[])
  699. {
  700.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  701.     if(!isAdmin(playerid,2))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  702.     if(sInfo[playerid][pAduty] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht ADuty.");
  703.     new pID,hp;
  704.     if(sscanf(params,"ud",pID,hp))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /sethp [SpielerName/ID][Leben]");
  705.     if(!IsPlayerConnected(pID))return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Online.");
  706.     if(sInfo[pID][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Eingeloggt.");
  707.     if(hp < 0 || hp > 100)return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /setskin [SpielerName/ID][Leben 0-100]");
  708.     SetPlayerHealth(pID,hp);
  709.     return 1;
  710. }
  711. ocmd:setarmor(playerid,params[])
  712. {
  713.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  714.     if(!isAdmin(playerid,2))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  715.     if(sInfo[playerid][pAduty] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht ADuty.");
  716.     new pID,armor;
  717.     if(sscanf(params,"ud",pID,armor))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /setarmor [SpielerName/ID][Armor]");
  718.     if(!IsPlayerConnected(pID))return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Online.");
  719.     if(sInfo[pID][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Eingeloggt.");
  720.     if(armor < 0 || armor > 100)return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /setskin [SpielerName/ID][Armor 0-100]");
  721.     SetPlayerArmour(pID,armor);
  722.     return 1;
  723. }
  724. ocmd:givegun(playerid,params[])
  725. {
  726.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  727.     if(!isAdmin(playerid,3))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  728.     if(sInfo[playerid][pAduty] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht ADuty.");
  729.     new pID,weapon,ammo,string[128];
  730.     if(sscanf(params,"udd",pID,weapon,ammo))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /givegun [SpielerName/ID][Waffenid][Munition]");
  731.     if(!IsPlayerConnected(pID))return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Online.");
  732.     if(sInfo[pID][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Eingeloggt.");
  733.     if(weapon < 0 || weapon > 50)return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /givegun [SpielerName/ID][Waffenid 0-50][Munition]");
  734.     if(ammo < 1 || ammo > 9999)return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /givegun [SpielerName/ID][Waffenid][Munition 1-9999]");
  735.     GivePlayerWeapon(pID,weapon,ammo);
  736.     format(string,sizeof(string),"Du hast dem Spieler %s die WaffenID %d gegeben.",SpielerName(pID),weapon);
  737.     SendClientMessage(playerid,COLOR_GELB,string);
  738.     return 1;
  739. }
  740. ocmd:veh(playerid,params[])
  741. {
  742.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  743.     if(!isAdmin(playerid,4))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  744.     if(sInfo[playerid][pAduty] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht ADuty.");
  745.     new carid,color1,color2,Float:X,Float:Y,Float:Z,car;
  746.     if(sscanf(params,"ddd",carid,color1,color2))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /veh [CarID][Farbe1][Farbe2]");
  747.     if(carid < 400 || carid > 611)return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /veh [CarID 400-611][Farbe1][Farbe2]");
  748.     if(color1 < 0 || color1 > 255)return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /veh [CarID][Farbe1 0-611][Farbe2 0-611]");
  749.     if(color2 < 0 || color2 > 255)return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /veh [CarID][Farbe1 0-611][Farbe2 0-611");
  750.     GetPlayerPos(playerid,X,Y,Z);
  751.     car = CreateVehicle(carid,X,Y,Z,0.0,color1,color2,-1);
  752.     PutPlayerInVehicle(playerid,car,0);
  753.     motor[car] = false;
  754.     licht[car] = false;
  755.     return 1;
  756. }
  757. ocmd:rv(playerid,params[])
  758. {
  759.     #pragma unused params
  760.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  761.     if(!isAdmin(playerid,2))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  762.     if(sInfo[playerid][pAduty] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht ADuty.");
  763.     if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,COLOR_GRAU,"Du bist in keinem Fahrzeug.");
  764.     new vID = GetPlayerVehicleID(playerid);
  765.     SetVehicleToRespawn(vID);
  766.     return 1;
  767. }
  768. ocmd:dv(playerid,params[])
  769. {
  770.     #pragma unused params
  771.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  772.     if(!isAdmin(playerid,3))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  773.     if(sInfo[playerid][pAduty] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht ADuty.");
  774.     if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,COLOR_GRAU,"Du bist in keinem Fahrzeug.");
  775.     new vID = GetPlayerVehicleID(playerid);
  776.     DestroyVehicle(vID);
  777.     return 1;
  778. }
  779. ocmd:fixveh(playerid,params[])
  780. {
  781.     #pragma unused params
  782.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  783.     if(!isAdmin(playerid,2))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  784.     if(sInfo[playerid][pAduty] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht ADuty.");
  785.     if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,COLOR_GRAU,"Du bist in keinem Fahrzeug.");
  786.     new vID = GetPlayerVehicleID(playerid);
  787.     SetVehicleHealth(vID,1000);
  788.     RepairVehicle(vID);
  789.     return 1;
  790. }
  791. ocmd:flip(playerid,params[])
  792. {
  793.     #pragma unused params
  794.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  795.     if(!isAdmin(playerid,2))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  796.     if(sInfo[playerid][pAduty] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht ADuty.");
  797.     if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,COLOR_GRAU,"Du bist in keinem Fahrzeug.");
  798.     new vID = GetPlayerVehicleID(playerid);
  799.     new Float:angle;
  800.     GetVehicleZAngle(vID, angle);
  801.     SetVehicleZAngle(vID, angle);
  802.     return 1;
  803. }
  804. ocmd:setname(playerid,params[])
  805. {
  806.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  807.     if(!isAdmin(playerid,3))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  808.     if(sInfo[playerid][pAduty] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht ADuty.");
  809.     new pID,xname[64],string[128];
  810.     if(sscanf(params,"us",pID,xname))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /SetName [SpielerName/ID][Neuer Name]");
  811.     if(!IsPlayerConnected(pID))return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Online.");
  812.     if(sInfo[pID][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Eingeloggt.");
  813.     SetPlayerName(pID,xname);
  814.     format(string,sizeof(string),"UPDATE accounts SET name='%s' WHERE id='%d'",SpielerName(pID),sInfo[pID][pDB]);
  815.     mysql_function_query(MYSQLConnect,string,false,"","");
  816.     SaveSpieler(pID);
  817.     return 1;
  818. }
  819. ocmd:kick(playerid,params[])
  820. {
  821.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  822.     if(!isAdmin(playerid,1))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  823.     if(sInfo[playerid][pAduty] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht ADuty.");
  824.     new pID,reason[64],string[128];
  825.     if(sscanf(params,"us",pID,reason))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /kick [SpielerName/ID][Grund]");
  826.     if(!IsPlayerConnected(pID))return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Online.");
  827.     if(sInfo[pID][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Eingeloggt.");
  828.     format(string,sizeof(string),"AdmCmd: %s hat den Spieler %s gekickt. Grund: %s",SpielerName(playerid),SpielerName(pID),reason);
  829.     SendClientMessageToAllEx(COLOR_HELLRED,string);
  830.     KickEx(pID);
  831.     return 1;
  832. }
  833. ocmd:kickall(playerid,params[])
  834. {
  835.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  836.     if(!isAdmin(playerid,4))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  837.     if(sInfo[playerid][pAduty] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht ADuty.");
  838.     new reason[64],string[128];
  839.     if(sscanf(params,"s",reason))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /kickall [Grund]");
  840.     format(string,sizeof(string),"AdmCmd: %s hat alle Spieler vom Server gekickt. Grund: %s",SpielerName(playerid),reason);
  841.     SendClientMessageToAllEx(COLOR_HELLRED,string);
  842.     for(new i = 0; i < GetMaxPlayers(); i++)
  843.     {
  844.         KickEx(i);
  845.     }
  846.     return 1;
  847. }
  848. ocmd:ban(playerid,params[])
  849. {
  850.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  851.     if(!isAdmin(playerid,2))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  852.     if(sInfo[playerid][pAduty] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht ADuty.");
  853.     new pID,reason[64],string[128];
  854.     if(sscanf(params,"us",pID,reason))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /ban [SpielerName/ID][Grund]");
  855.     if(!IsPlayerConnected(pID))return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Online.");
  856.     if(sInfo[pID][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Eingeloggt.");
  857.     format(string,sizeof(string),"AdmCmd: %s hat den Spieler %s gebannt. Grund: %s",SpielerName(playerid),SpielerName(pID),reason);
  858.     SendClientMessageToAllEx(COLOR_HELLRED,string);
  859.     BannEx(pID,reason,SpielerName(playerid),-1);
  860.     return 1;
  861. }
  862. ocmd:tban(playerid,params[])
  863. {
  864.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  865.     if(!isAdmin(playerid,2))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  866.     if(sInfo[playerid][pAduty] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht ADuty.");
  867.     new pID,reason[64],zeit,string[128],timeban;
  868.     if(sscanf(params,"uds",pID,zeit,reason))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /tban [SpielerName/ID][Zeit][Grund]");
  869.     if(!IsPlayerConnected(pID))return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Online.");
  870.     if(sInfo[pID][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Eingeloggt.");
  871.     if(zeit < 0 || zeit > 24)return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /tban [SpielerName/ID][Zeit 0-24][Grund]");
  872.     format(string,sizeof(string),"AdmCmd: %s hat den Spieler %s f¸r %d Stunden gebannt. Grund: %s",SpielerName(playerid),SpielerName(pID),zeit,reason);
  873.     SendClientMessageToAllEx(COLOR_HELLRED,string);
  874.     timeban = gettime() + (60*60*zeit);
  875.     BannEx(pID,reason,SpielerName(playerid),timeban);
  876.     return 1;
  877. }
  878. ocmd:aduty(playerid,params[])
  879. {
  880.     #pragma unused params
  881.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  882.     if(!isAdmin(playerid,1))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  883.     if(sInfo[playerid][pAduty] == 0)
  884.     {
  885.         new string[128];
  886.         switch(sInfo[playerid][pAdmin])
  887.         {
  888.             case 1:{sInfo[playerid][pAdutyLabel] = Create3DTextLabel("Supporter", COLOR_GRUN ,30.0, 40.0, 50.0, 20.0, 0, 1);}
  889.             case 2:{sInfo[playerid][pAdutyLabel] = Create3DTextLabel("Adminstrator", COLOR_BLAU, 30.0, 40.0, 50.0, 20.0, 0, 1);}
  890.             case 3:{sInfo[playerid][pAdutyLabel] = Create3DTextLabel("ServerManager", COLOR_GELB, 30.0, 40.0, 50.0, 20.0, 0, 1);}
  891.             case 4:{sInfo[playerid][pAdutyLabel] = Create3DTextLabel("ServerOwner", COLOR_HELLRED, 30.0, 40.0, 50.0, 20.0, 0, 1);}
  892.         }
  893.         Attach3DTextLabelToPlayer(sInfo[playerid][pAdutyLabel], playerid, 0.0, 0.0, 0.3);
  894.         sInfo[playerid][pAduty] = 1;
  895.         format(string,sizeof(string),"SERVER:"#HTML_WHITE" %s ist nun als %s im Dienst!",SpielerName(playerid),AdminRang(playerid));
  896.         SendClientMessageToAllEx(COLOR_ORANGE,string);
  897.         SetPlayerColor(playerid,COLOR_ORANGE);
  898.         return 1;
  899.     }
  900.     else
  901.     {
  902.         SendClientMessage(playerid,COLOR_GELB,"Du bist aus dem Admin Dienst gegangen.");
  903.         Delete3DTextLabel(sInfo[playerid][pAdutyLabel]);
  904.         sInfo[playerid][pAduty] = 0;
  905.         SetPlayerColor(playerid,COLOR_WEISS);
  906.     }
  907.     return 1;
  908. }
  909. ocmd:auninvite(playerid,params[])
  910. {
  911.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  912.     if(!isAdmin(playerid,3))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  913.     new pID,string[128];
  914.     if(sscanf(params,"u",pID))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /auninvite [SpielerName/ID]");
  915.     if(!IsPlayerConnected(pID))return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Online.");
  916.     if(sInfo[pID][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Eingeloggt.");
  917.     if(isFrakt(playerid,0))return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist in keiner Fraktion.");
  918.     sInfo[pID][pFraktion] = 0;
  919.     sInfo[pID][pLeader] = 0;
  920.     sInfo[pID][pRang] = 0;
  921.     sInfo[pID][pFSkin] = 0;
  922.     format(string,sizeof(string),"**%s hat dich aus der Fraktion gekickt.",SpielerName(playerid));
  923.     SendClientMessage(pID,COLOR_BLAU,string);
  924.     format(string,sizeof(string),"Du hast %s aus seiner Fraktion gekickt.",SpielerName(pID));
  925.     SendClientMessage(playerid,COLOR_BLAU,string);
  926.     SpawnPlayerEx(pID);
  927.     return 1;
  928. }
  929. ocmd:mark(playerid,params[])
  930. {
  931.     #pragma unused params
  932.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  933.     if(!isAdmin(playerid,1))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  934.     new Float:X,Float:Y,Float:Z;
  935.     GetPlayerPos(playerid,X,Y,Z);
  936.     MarkX[playerid] = X;
  937.     MarkY[playerid] = Y;
  938.     MarkZ[playerid] = Z;
  939.     MarkInt[playerid] = GetPlayerInterior(playerid);
  940.     MarkStatus[playerid] = 1;
  941.     SendClientMessage(playerid,COLOR_GELB,"Du hast ein Marker Punkt gesetzt.");
  942.     return 1;
  943. }
  944. ocmd:delmark(playerid,params[])
  945. {
  946.     #pragma unused params
  947.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  948.     if(!isAdmin(playerid,1))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  949.     if(MarkStatus[playerid] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du hast kein Marker Punkt gesetzt.");
  950.     MarkX[playerid] = -1;
  951.     MarkY[playerid] = -1;
  952.     MarkZ[playerid] = -1;
  953.     MarkInt[playerid] = -1;
  954.     MarkStatus[playerid] = 0;
  955.     SendClientMessage(playerid,COLOR_GELB,"Du hast ein Marker Punkt gelˆscht.");
  956.     return 1;
  957. }
  958. ocmd:gotomark(playerid,params[])
  959. {
  960.     #pragma unused params
  961.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  962.     if(!isAdmin(playerid,1))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  963.     if(MarkStatus[playerid] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du hast kein Marker Punkt gesetzt.");
  964.     if(IsPlayerInAnyVehicle(playerid))
  965.     {
  966.         new carid = GetPlayerVehicleID(playerid);
  967.         SetVehiclePos(carid,MarkX[playerid],MarkY[playerid],MarkZ[playerid]);
  968.         SetPlayerPos(playerid,MarkX[playerid],MarkY[playerid],MarkZ[playerid]);
  969.         SetPlayerInterior(playerid,MarkInt[playerid]);
  970.         LinkVehicleToInterior(carid, MarkInt[playerid]);
  971.         PutPlayerInVehicle(playerid,carid,0);
  972.     }
  973.     else
  974.     {
  975.         SetPlayerPos(playerid,MarkX[playerid],MarkY[playerid],MarkZ[playerid]);
  976.         SetPlayerInterior(playerid,MarkInt[playerid]);
  977.     }
  978.     return 1;
  979. }
  980. ocmd:supmobil(playerid,params[])
  981. {
  982.     #pragma unused params
  983.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  984.     if(!isAdmin(playerid,4))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  985.     new Float:X,Float:Y,Float:Z,Float:A;
  986.     GetPlayerPos(playerid,X,Y,Z);
  987.     GetPlayerFacingAngle(playerid,A);
  988.     if(sInfo[playerid][pSupErstellt] == 0)
  989.     {
  990.         SendClientMessage(playerid,COLOR_GELB,"Du hast ein Supmobil gespawnt!");
  991.         sInfo[playerid][pSupmobil] = CreateVehicle(457,X+3,Y,Z,A,-1,-1,-1);
  992.         sInfo[playerid][pSupID] = playerid;
  993.         sInfo[playerid][pSupErstellt] = 1;
  994.         motor[sInfo[playerid][pSupmobil]] = false;
  995.         licht[sInfo[playerid][pSupmobil]] = false;
  996.         for(new i = 0; i < GetMaxPlayers(); i++)
  997.         {
  998.             if(sInfo[i][pSupID] != i)
  999.             {
  1000.                 SetVehicleParamsForPlayer(sInfo[playerid][pSupmobil], i, 0, 1);
  1001.             }
  1002.             else
  1003.             {
  1004.                 SetVehicleParamsForPlayer(sInfo[playerid][pSupmobil], i, 0, 0);
  1005.             }
  1006.         }
  1007.         return 1;
  1008.     }
  1009.     else
  1010.     {
  1011.         SendClientMessage(playerid,COLOR_GELB,"Du hast dein Supmobil gelˆscht!");
  1012.         DestroyVehicle(sInfo[playerid][pSupmobil]);
  1013.         sInfo[playerid][pSupID] = -1;
  1014.         sInfo[playerid][pSupErstellt] = 0;
  1015.         return 1;
  1016.     }
  1017. }
  1018. ocmd:w(playerid,params[])
  1019. {
  1020.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  1021.     if(!isAdmin(playerid,2))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  1022.     new pID,text[64],string[128];
  1023.     if(sscanf(params,"us",pID,text))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /w [SpielerName/ID][Text]");
  1024.     if(!IsPlayerConnected(pID))return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Online.");
  1025.     if(sInfo[pID][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Eingeloggt.");
  1026.     format(string,sizeof(string),"%s fl¸stert dir: %s",SpielerName(playerid),text);
  1027.     SendClientMessage(pID,COLOR_GELB,string);
  1028.     format(string,sizeof(string),"Du hast %s folgendes gefl¸stert: %s",SpielerName(pID),text);
  1029.     SendClientMessage(playerid,COLOR_GELB,string);
  1030.     return 1;
  1031. }
  1032. ocmd:efa(playerid,params[])
  1033. {
  1034.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  1035.     if(!isAdmin(playerid,3))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  1036.     new Float:X,Float:Y,Float:Z,Float:A;
  1037.     new fID,carid,color1,color2;
  1038.     if(sscanf(params,"dddd",fID,carid,color1,color2))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /efa [Fraktion][CarID][Color1][Color2]");
  1039.     if(fID < 1 || fID > 10)return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /efa [Fraktion 1-10][CarID][Color1][Color2]");
  1040.     if(carid < 400 || carid > 611)return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /efa [Fraktion][CarID 400-611][Color1][Color2]");
  1041.     if(color1 < 0 || color1 > 255)return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /efa [Fraktion][CarID][Color1 0-255][Color2]");
  1042.     if(color2 < 0 || color2 > 255)return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /efa [Fraktion][CarID][Color1 0-255][Color2]");
  1043.     GetPlayerPos(playerid,X,Y,Z);
  1044.     GetPlayerFacingAngle(playerid,A);
  1045.     CreateFrakVehicle(playerid,fID,carid,color1,color2,X,Y,Z,A);
  1046.     return 1;
  1047. }
  1048. ocmd:setmoney(playerid,params[])
  1049. {
  1050.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  1051.     if(!isAdmin(playerid,4))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  1052.     new pID,money;
  1053.     if(sscanf(params,"ud",pID,money))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /setmoney [SpielerName/ID][Geld]");
  1054.     if(!IsPlayerConnected(pID))return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Online.");
  1055.     if(sInfo[pID][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Eingeloggt.");
  1056.     if(money < 1 || money > 999999)return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /setmoney [SpielerName/ID][Geld $1-$999.999]");
  1057.     SetPlayerMoney(pID,money);
  1058.     return 1;
  1059. }
  1060. ocmd:ahelp(playerid,params[])
  1061. {
  1062.     #pragma unused params
  1063.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  1064.     if(!isAdmin(playerid,1))return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  1065.     if(sInfo[playerid][pAdmin] == 1)
  1066.     {
  1067.         SendClientMessage(playerid,COLOR_WEISS,""#HTML_GRUN"**Supporter:"#HTML_WHITE" /a(chat) /freeze /unfreeze /gotols /goto /gethere /aduty");
  1068.         SendClientMessage(playerid,COLOR_WEISS,""#HTML_GRUN"**Supporter:"#HTML_WHITE" /kick /supmobil /mark /gotomark /delmark");
  1069.     }
  1070.     if(sInfo[playerid][pAdmin] == 2)
  1071.     {
  1072.         SendClientMessage(playerid,COLOR_WEISS,""#HTML_GRUN"**Supporter:"#HTML_WHITE" /a(chat) /freeze /unfreeze /gotols /goto /gethere /aduty");
  1073.         SendClientMessage(playerid,COLOR_WEISS,""#HTML_GRUN"**Supporter:"#HTML_WHITE" /kick /supmobil /mark /gotomark /delmark");
  1074.         SendClientMessage(playerid,COLOR_WEISS,""#HTML_BLAU"**Adminstrator:"#HTML_WHITE" /gotocar /getcar /setskin /rv /sethp /setarmor /fixveh");
  1075.         SendClientMessage(playerid,COLOR_WEISS,""#HTML_BLAU"**Adminstrator:"#HTML_WHITE" /tban /ban /w(hispern)");
  1076.     }
  1077.     if(sInfo[playerid][pAdmin] == 3)
  1078.     {
  1079.         SendClientMessage(playerid,COLOR_WEISS,""#HTML_GRUN"**Supporter:"#HTML_WHITE" /a(chat) /freeze /unfreeze /gotols /goto /gethere /aduty");
  1080.         SendClientMessage(playerid,COLOR_WEISS,""#HTML_GRUN"**Supporter:"#HTML_WHITE" /kick /supmobil /mark /gotomark /delmark");
  1081.         SendClientMessage(playerid,COLOR_WEISS,""#HTML_BLAU"**Adminstrator:"#HTML_WHITE" /gotocar /getcar /setskin /rv /sethp /setarmor /fixveh");
  1082.         SendClientMessage(playerid,COLOR_WEISS,""#HTML_BLAU"**Adminstrator:"#HTML_WHITE" /tban /ban /w(hispern)");
  1083.         SendClientMessage(playerid,COLOR_WEISS,""#HTML_GELB"**ServerManager:"HTML_WHITE" /makeleader /givegun /setname /flip /auninvite /efa /dv /afrangname");
  1084.     }
  1085.     if(sInfo[playerid][pAdmin] == 4)
  1086.     {
  1087.         SendClientMessage(playerid,COLOR_WEISS,""#HTML_GRUN"**Supporter:"#HTML_WHITE" /a(chat) /freeze /unfreeze /gotols /goto /gethere /aduty");
  1088.         SendClientMessage(playerid,COLOR_WEISS,""#HTML_GRUN"**Supporter:"#HTML_WHITE" /kick /supmobil /mark /gotomark /delmark");
  1089.         SendClientMessage(playerid,COLOR_WEISS,""#HTML_BLAU"**Adminstrator:"#HTML_WHITE" /gotocar /getcar /setskin /rv /sethp /setarmor /fixveh");
  1090.         SendClientMessage(playerid,COLOR_WEISS,""#HTML_BLAU"**Adminstrator:"#HTML_WHITE" /tban /ban /w(hispern)");
  1091.         SendClientMessage(playerid,COLOR_WEISS,""#HTML_GELB"**ServerManager:"HTML_WHITE" /makeleader /givegun /setname /flip /auninvite /dv /afrangname");
  1092.         SendClientMessage(playerid,COLOR_WEISS,""#HTML_ROT"**ServerOwner:"#HTML_WHITE" /makeadmin /veh /setmoney");
  1093.     }
  1094.     return 1;
  1095. }
  1096. ocmd:se(playerid,params[])
  1097. {
  1098.     new string[256];
  1099.     for(new i = 1; i < MAX_FRAKTIONEN; i++)
  1100.     {
  1101.         fInfo[i][fMats] = 200;
  1102.         format(string,sizeof(string),""#HTML_BLAU"Ausrustung %d von 200\n"#HTML_WHITE"/equip zum Equipen",fInfo[i][fMats]);
  1103.         Update3DTextLabelText(AusrustungsLabel[i],COLOR_WEISS,string);
  1104.     }
  1105.     fInfo[5][fMats] = 1;
  1106.     fInfo[6][fMats] = 200;
  1107.     fInfo[7][fMats] = 200;
  1108.     fInfo[8][fMats] = 200;
  1109.     fInfo[9][fMats] = 200;
  1110.     return 1;
  1111. }
  1112. //Fraktion
  1113. ocmd:equip(playerid,params[])
  1114. {
  1115.     #pragma unused params
  1116.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  1117.     if(!isPlayerInBadFrak(playerid))return SendClientMessage(playerid,COLOR_GRAU,"Du bist in keiner Gang/Mafia.");
  1118.     new string[128];
  1119.     if(IsPlayerInRangeOfPoint(playerid,5.0,1336.0338,48.8502,1001.0156))//Grove Street
  1120.     {
  1121.         if(isFrakt(playerid,5))
  1122.         {
  1123.             if(fInfo[5][fMats] > 0)
  1124.             {
  1125.                 ResetPlayerWeapons(playerid);
  1126.                 GivePlayerWeapon(playerid,5,1);
  1127.                 GivePlayerWeapon(playerid,24,500);
  1128.                 GivePlayerWeapon(playerid,29,500);
  1129.                 SetPlayerArmour(playerid,100);
  1130.                 if(sInfo[playerid][pLeader] == 1)GivePlayerWeapon(playerid,30,500);
  1131.                 SendClientMessage(playerid,COLOR_GELB,"Du hast dich erfolgreich Ausger¸stet.");
  1132.                 fInfo[5][fMats] -= 1;
  1133.                 format(string,sizeof(string),""#HTML_BLAU"Ausrustung %d von 200\n"#HTML_WHITE"/equip || Taste: N",fInfo[5][fMats]);
  1134.                 Update3DTextLabelText(fInfo[5][fWLabel],COLOR_WEISS,string);
  1135.                 return 1;
  1136.             }
  1137.             else
  1138.             {
  1139.                 SendClientMessage(playerid,COLOR_GRAU,"Deine Fraktion hat nicht gen¸gend Materialien.");
  1140.             }
  1141.         }
  1142.         else
  1143.         {
  1144.             SendClientMessage(playerid,COLOR_GRAU,"Dieses Waffenlager gehˆrt der Fraktion Grove Street.");
  1145.         }
  1146.     }
  1147.     if(IsPlayerInRangeOfPoint(playerid,5.0,2820.2852,-1173.0509,1025.5703))//Ballas Familie
  1148.     {
  1149.         if(isFrakt(playerid,6))
  1150.         {
  1151.             if(fInfo[6][fMats] > 0)
  1152.             {
  1153.                 ResetPlayerWeapons(playerid);
  1154.                 GivePlayerWeapon(playerid,5,1);
  1155.                 GivePlayerWeapon(playerid,24,500);
  1156.                 GivePlayerWeapon(playerid,29,500);
  1157.                 SetPlayerArmour(playerid,100);
  1158.                 if(sInfo[playerid][pLeader] == 1)GivePlayerWeapon(playerid,30,500);
  1159.                 SendClientMessage(playerid,COLOR_GELB,"Du hast dich erfolgreich Ausger¸stet.");
  1160.                 fInfo[6][fMats] -= 1;
  1161.                 format(string,sizeof(string),""#HTML_BLAU"Ausrustung %d von 200\n"#HTML_WHITE"/equip || Taste: N",fInfo[6][fMats]);
  1162.                 Update3DTextLabelText(fInfo[6][fWLabel],COLOR_WEISS,string);
  1163.                 return 1;
  1164.             }
  1165.             else
  1166.             {
  1167.                 SendClientMessage(playerid,COLOR_GRAU,"Deine Fraktion hat nicht gen¸gend Materialien.");
  1168.                 return 1;
  1169.             }
  1170.         }
  1171.         else
  1172.         {
  1173.             SendClientMessage(playerid,COLOR_GRAU,"Dieses Waffenlager gehˆrt der Fraktion Ballas Familie.");
  1174.             return 1;
  1175.         }
  1176.     }
  1177.     if(IsPlayerInRangeOfPoint(playerid,5.0,-2634.5540,1409.6840,906.4647))//Yakuza
  1178.     {
  1179.         if(isFrakt(playerid,7))
  1180.         {
  1181.             if(fInfo[7][fMats] > 0)
  1182.             {
  1183.                 ResetPlayerWeapons(playerid);
  1184.                 GivePlayerWeapon(playerid,8,1);
  1185.                 GivePlayerWeapon(playerid,24,500);
  1186.                 GivePlayerWeapon(playerid,29,500);
  1187.                 SetPlayerArmour(playerid,100);
  1188.                 if(sInfo[playerid][pLeader] == 1)GivePlayerWeapon(playerid,30,500);
  1189.                 SendClientMessage(playerid,COLOR_GELB,"Du hast dich erfolgreich Ausger¸stet.");
  1190.                 fInfo[7][fMats] -= 1;
  1191.                 format(string,sizeof(string),""#HTML_BLAU"Ausrustung %d von 200\n"#HTML_WHITE"/equip || Taste: N",fInfo[7][fMats]);
  1192.                 Update3DTextLabelText(fInfo[7][fWLabel],COLOR_WEISS,string);
  1193.                 return 1;
  1194.             }
  1195.             else
  1196.             {
  1197.                 SendClientMessage(playerid,COLOR_GRAU,"Deine Fraktion hat nicht gen¸gend Materialien.");
  1198.                 return 1;
  1199.             }
  1200.         }
  1201.         else
  1202.         {
  1203.             SendClientMessage(playerid,COLOR_GRAU,"Dieses Waffenlager gehˆrt der Fraktion Yakuza.");
  1204.             return 1;
  1205.         }
  1206.     }
  1207.     if(IsPlayerInRangeOfPoint(playerid,5.0,1709.5746,-1642.5717,20.2188))//Triaden
  1208.     {
  1209.         if(isFrakt(playerid,8))
  1210.         {
  1211.             if(fInfo[8][fMats] > 0)
  1212.             {
  1213.                 ResetPlayerWeapons(playerid);
  1214.                 GivePlayerWeapon(playerid,2,1);
  1215.                 GivePlayerWeapon(playerid,24,500);
  1216.                 GivePlayerWeapon(playerid,29,500);
  1217.                 SetPlayerArmour(playerid,100);
  1218.                 if(sInfo[playerid][pLeader] == 1)GivePlayerWeapon(playerid,30,500);
  1219.                 SendClientMessage(playerid,COLOR_GELB,"Du hast dich erfolgreich Ausger¸stet.");
  1220.                 fInfo[8][fMats] -= 1;
  1221.                 format(string,sizeof(string),""#HTML_BLAU"Ausrustung %d von 200\n"#HTML_WHITE"/equip || Taste: N",fInfo[8][fMats]);
  1222.                 Update3DTextLabelText(fInfo[8][fWLabel],COLOR_WEISS,string);
  1223.                 return 1;
  1224.             }
  1225.             else
  1226.             {
  1227.                 SendClientMessage(playerid,COLOR_GRAU,"Deine Fraktion hat nicht gen¸gend Materialien.");
  1228.                 return 1;
  1229.             }
  1230.         }
  1231.         else
  1232.         {
  1233.             SendClientMessage(playerid,COLOR_GRAU,"Dieses Waffenlager gehˆrt der Fraktion Triaden.");
  1234.             return 1;
  1235.         }
  1236.     }
  1237.     if(IsPlayerInRangeOfPoint(playerid,5.0,2455.6226,-1706.2953,1013.5078))//Los Aztecas
  1238.     {
  1239.         if(isFrakt(playerid,9))
  1240.         {
  1241.             if(fInfo[9][fMats] > 0)
  1242.             {
  1243.                 ResetPlayerWeapons(playerid);
  1244.                 GivePlayerWeapon(playerid,5,1);
  1245.                 GivePlayerWeapon(playerid,24,500);
  1246.                 GivePlayerWeapon(playerid,29,500);
  1247.                 SetPlayerArmour(playerid,100);
  1248.                 if(sInfo[playerid][pLeader] == 1)GivePlayerWeapon(playerid,30,500);
  1249.                 SendClientMessage(playerid,COLOR_GELB,"Du hast dich erfolgreich Ausger¸stet.");
  1250.                 fInfo[9][fMats] -= 1;
  1251.                 format(string,sizeof(string),""#HTML_BLAU"Ausrustung %d von 200\n"#HTML_WHITE"/equip || Taste: N",fInfo[9][fMats]);
  1252.                 Update3DTextLabelText(fInfo[9][fWLabel],COLOR_WEISS,string);
  1253.                 return 1;
  1254.             }
  1255.             else
  1256.             {
  1257.                 SendClientMessage(playerid,COLOR_GRAU,"Deine Fraktion hat nicht gen¸gend Materialien.");
  1258.                 return 1;
  1259.             }
  1260.         }
  1261.         else
  1262.         {
  1263.        
  1264.             SendClientMessage(playerid,COLOR_GRAU,"Dieses Waffenlager gehˆrt der Fraktion Los Aztecas.");
  1265.             return 1;
  1266.         }
  1267.     }
  1268.     if(IsPlayerInRangeOfPoint(playerid,5.0,948.4531,2104.1658,1011.0234))//Hitman
  1269.     {
  1270.         if(isFrakt(playerid,10))
  1271.         {
  1272.             if(fInfo[10][fMats] > 0)
  1273.             {
  1274.                 ResetPlayerWeapons(playerid);
  1275.                 GivePlayerWeapon(playerid,4,1);
  1276.                 GivePlayerWeapon(playerid,24,500);
  1277.                 GivePlayerWeapon(playerid,29,500);
  1278.                 GivePlayerWeapon(playerid,34,250);
  1279.                 GivePlayerWeapon(playerid,31,500);
  1280.                 SetPlayerArmour(playerid,100);
  1281.                 SendClientMessage(playerid,COLOR_GELB,"Du hast dich erfolgreich Ausger¸stet.");
  1282.                 fInfo[10][fMats] -= 1;
  1283.                 format(string,sizeof(string),""#HTML_BLAU"Ausrustung %d von 200\n"#HTML_WHITE"/equip || Taste: N",fInfo[10][fMats]);
  1284.                 Update3DTextLabelText(fInfo[10][fWLabel],COLOR_WEISS,string);
  1285.                 return 1;
  1286.             }
  1287.             else
  1288.             {
  1289.                 SendClientMessage(playerid,COLOR_GRAU,"Deine Fraktion hat nicht gen¸gend Materialien.");
  1290.                 return 1;
  1291.             }
  1292.         }
  1293.         else
  1294.         {
  1295.             SendClientMessage(playerid,COLOR_GRAU,"Dieses Waffenlager gehˆrt der Fraktion Hitman.");
  1296.             return 1;
  1297.         }
  1298.     }
  1299.     return 1;
  1300. }
  1301. ocmd:fpark(playerid,params[])
  1302. {
  1303.     #pragma unused params
  1304.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  1305.     if(sInfo[playerid][pLeader] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Befugt.");
  1306.     for(new i = 0; i < sizeof(fvInfo); i++)
  1307.     {
  1308.         if(sInfo[playerid][pLeader] != 1)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  1309.         if(IsPlayerInVehicle(playerid,fvInfo[i][fvCar]))
  1310.         {
  1311.             SaveFrakVehicle(i);
  1312.             SendClientMessage(playerid,COLOR_GELB,"Du hast das Fahrzeug erfolgreich geparkt!");
  1313.             return 1;
  1314.         }
  1315.     }
  1316.     return 1;
  1317. }
  1318. ocmd:flock(playerid,params[])
  1319. {
  1320.     new Float:X,Float:Y,Float:Z;
  1321.     for(new i = 0; i < sizeof(fvInfo); i++)
  1322.     {
  1323.         GetVehiclePos(fvInfo[i][fvCar],X,Y,Z);
  1324.         if(IsPlayerInRangeOfPoint(playerid,3.0,X,Y,Z))
  1325.         {
  1326.             GetVehicleParamsEx(fvInfo[i][fvCar],engine,lights,alarm,doors,bonnet,boot,objective);
  1327.             if(fvInfo[i][fvAbgeschlossen] == 0)
  1328.             {
  1329.                 fvInfo[i][fvAbgeschlossen] = 1;
  1330.                 GameTextForPlayer(playerid,"~w~Fahrzeug ~r~Abgeschlossen",2000,4);
  1331.                 for(new j = 0; j < GetMaxPlayers(); j++)
  1332.                 {
  1333.                     if(sInfo[i][pFraktion] == fvInfo[i][fvfrakid])
  1334.                     {
  1335.                         SetVehicleParamsForPlayer(fvInfo[i][fcID], j, 0, 0);
  1336.                     }
  1337.                     else
  1338.                     {
  1339.                         SetVehicleParamsForPlayer(fvInfo[i][fcID], j, 0, 1);
  1340.                     }
  1341.                 }
  1342.             }
  1343.             else if(fvInfo[i][fvAbgeschlossen] == 1)
  1344.             {
  1345.                 for(new j = 0; j < GetMaxPlayers(); j++)
  1346.                 {
  1347.                     fvInfo[i][fvAbgeschlossen] = 0;
  1348.                     GameTextForPlayer(playerid,"~w~Fahrzeug ~g~Aufgeschlossen",2000,4);
  1349.                     SetVehicleParamsForPlayer(fvInfo[i][fcID], j, 0, 0);
  1350.                 }
  1351.             }
  1352.         }
  1353.     }
  1354.     return 1;
  1355. }
  1356. ocmd:gov(playerid,params[])
  1357. {
  1358.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  1359.     if(sInfo[playerid][pTot] == 1)return SendClientMessage(playerid,COLOR_GRAU,"Tote kˆnnen keine Befehle benutzen.");
  1360.     if(sInfo[playerid][pDuty] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht im Dienst.");
  1361.     if(sInfo[playerid][pLeader] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht befugt.");
  1362.     new text[64],string[128];
  1363.     if(sscanf(params,"s",text))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /gov [Text]");
  1364.     SendClientMessageToAll(COLOR_WEISS,"[________________ Staatsmeldung _______________]");
  1365.     format(string,sizeof(string),"Staatsbeamter %s: %s",SpielerName(playerid),text);
  1366.     SendClientMessageToAll(COLOR_BLAU,string);
  1367.     return 1;
  1368. }
  1369. ocmd:duty(playerid,params[])
  1370. {
  1371.     #pragma unused params
  1372.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  1373.     if(sInfo[playerid][pTot] == 1)return SendClientMessage(playerid,COLOR_GRAU,"Tote kˆnnen keine Befehle benutzen.");
  1374.     if(!isFrakt(playerid,1))return SendClientMessage(playerid,COLOR_GRAU,"Du bist kein Beamter.");
  1375.     new string[128];
  1376.     if(IsPlayerInRangeOfPoint(playerid,5.0,254.4515,76.7813,1003.6406))
  1377.     {
  1378.         if(sInfo[playerid][pDuty] == 0)
  1379.         {
  1380.             sInfo[playerid][pDuty] = 1;
  1381.             SetPlayerSkin(playerid,sInfo[playerid][pFSkin]);
  1382.             GivePlayerWeapon(playerid,24,500);
  1383.             GivePlayerWeapon(playerid,29,500);
  1384.             GivePlayerWeapon(playerid,3,1);
  1385.             SetPlayerArmour(playerid,100);
  1386.             GivePlayerMoney(playerid,-100);
  1387.             if(sInfo[playerid][pLeader] == 1)GivePlayerWeapon(playerid,31,500);
  1388.             SetPlayerColor(playerid,COLOR_BLAU);
  1389.             SendClientMessage(playerid,COLOR_GELB,"Du bist nun im Dienst. Kosten: $100");
  1390.             format(string,sizeof(string),"**Officer %s nimmt seine Marke aus dem Schrank und meldet sich zum Dienst.",SpielerName(playerid));
  1391.             ProxerToPlayer(playerid,COLOR_MEFARBE,string,15.0);
  1392.             return 1;
  1393.         }
  1394.         else
  1395.         {
  1396.             sInfo[playerid][pDuty] = 0;
  1397.             SetPlayerSkin(playerid,sInfo[playerid][pSkin]);
  1398.             SetPlayerColor(playerid,COLOR_WEISS);
  1399.             SetPlayerArmour(playerid,0);
  1400.             ResetPlayerWeapons(playerid);
  1401.             SendClientMessage(playerid,COLOR_GELB,"Du bist aus dem Dienst gegangen.");
  1402.             format(string,sizeof(string),"**Officer %s legt seine Marke in den Schrank und machtt Feierabend.",SpielerName(playerid));
  1403.             ProxerToPlayer(playerid,COLOR_MEFARBE,string,15.0);
  1404.             return 1;
  1405.         }
  1406.     }
  1407.     return 1;
  1408. }
  1409. ocmd:arrest(playerid,params[])
  1410. {
  1411.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  1412.     if(sInfo[playerid][pTot] == 1)return SendClientMessage(playerid,COLOR_GRAU,"Tote kˆnnen keine Befehle benutzen.");
  1413.     if(sInfo[playerid][pDuty] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht im Dienst.");
  1414.     new pID,Float:X,Float:Y,Float:Z;
  1415.     if(sscanf(params,"u",pID))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /arrest [SpielerName/ID]");
  1416.     if(!IsPlayerConnected(pID))return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Online.");
  1417.     if(sInfo[pID][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Eingeloggt.");
  1418.     if(pID == playerid)return 1;
  1419.     if(GetPlayerWantedLevel(playerid) <= 0)return SendClientMessage(playerid,COLOR_GRAU,"Fehler: Der Spieler hat kein Wantedlevel.");
  1420.     GetPlayerPos(playerid,X,Y,Z);
  1421.     if(!IsPlayerInRangeOfPoint(pID,10,X,Y,Z))return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht in deiner N‰he.");
  1422.     if(IsPlayerInRangeOfPoint(playerid,10.0,267.8373,82.8182,1001.0391))
  1423.     {
  1424.    
  1425.     }
  1426.     return 1;
  1427. }
  1428. ocmd:clear(playerid,params[])
  1429. {
  1430.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  1431.     if(sInfo[playerid][pTot] == 1)return SendClientMessage(playerid,COLOR_GRAU,"Tote kˆnnen keine Befehle benutzen.");
  1432.     if(sInfo[playerid][pDuty] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht im Dienst.");
  1433.     new pID,grund[32],string[128];
  1434.     if(sscanf(params,"us",pID,grund))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /clear [SpielerName/ID][Grund]");
  1435.     if(!IsPlayerConnected(pID))return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Online.");
  1436.     if(sInfo[pID][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Eingeloggt.");
  1437.     if(pID == playerid)return SendClientMessage(playerid,COLOR_GRAU,"Du kannst dich selber nicht clearen.");
  1438.     if(GetPlayerWantedLevel(playerid) <= 0)return SendClientMessage(playerid,COLOR_GRAU,"Fehler: Der Spieler hat kein Wantedlevel.");
  1439.     if(IsPlayerInRangeOfPoint(playerid,5.0,252.1830,70.1469,1003.6406) || IsPlayerInPDFahrzeug(playerid))
  1440.     {
  1441.         format(string,sizeof(string),"%s hat deine Akte gereinigt.Grund: %s",SpielerName(playerid),grund);
  1442.         SendClientMessage(pID,COLOR_PDBLAU,string);
  1443.         format(string,sizeof(string),"<< %s hat die Akte von %s gereinigt.Grund: %s >>",SpielerName(playerid),SpielerName(pID),grund);
  1444.         SendFrakMessage(sInfo[playerid][pFraktion],COLOR_HELLRED,string);
  1445.         SetPlayerWantedLevel(pID,0);
  1446.         sInfo[pID][pWanteds] = 0;
  1447.     }
  1448.     return 1;
  1449. }
  1450. ocmd:su(playerid,params[])
  1451. {
  1452.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  1453.     if(sInfo[playerid][pTot] == 1)return SendClientMessage(playerid,COLOR_GRAU,"Tote kˆnnen keine Befehle benutzen.");
  1454.     if(sInfo[playerid][pDuty] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht im Dienst.");
  1455.     new pID,wanteds,reason[64],string[128];
  1456.     if(sscanf(params,"uds",pID,wanteds,reason))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /su [SpielerName/ID][Wanteds][Grund]");
  1457.     if(!IsPlayerConnected(pID))return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Online.");
  1458.     if(sInfo[pID][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler ist nicht Eingeloggt.");
  1459.     if(pID == playerid)return SendClientMessage(playerid,COLOR_GRAU,"Du kannst dir selber keine Wantedpunkte geben.");
  1460.     if(isFrakt(pID,1) || isFrakt(pID,2) || isFrakt(pID,3))return SendClientMessage(playerid,COLOR_GRAU,"Du kannst Beamten keine Wantedpunkte geben.");
  1461.     if(wanteds < 1 || wanteds > 69)return SendClientMessage(playerid,COLOR_GRAU,"Fehler: Die Wantedpunkte m¸ssen zwischen 1-69 liegen.");
  1462.     if(GetPlayerWantedLevel(playerid) > floatround(wanteds,floatround_round))return SendClientMessage(playerid,COLOR_GRAU,"Fehler: Der Spieler hat schon Wantedpunkte.");
  1463.     if(IsPlayerInRangeOfPoint(playerid,5.0,252.1830,70.1469,1003.6406) || IsPlayerInPDFahrzeug(playerid))
  1464.     {
  1465.         SetPlayerWantedLevel(pID,floatround(wanteds,floatround_round));
  1466.         sInfo[pID][pWanteds] = wanteds;
  1467.         format(string, sizeof(string), "HQ: Alle Einheiten: Reporter: %s, Vergebene Wanteds: %d",SpielerName(playerid), wanteds);
  1468.         SendFrakMessage(1,COLOR_PDBLAU,string);
  1469.         format(string, sizeof(string), "HQ: Verbrechen: %s, Gesuchter: %s, Aktuelle Wanteds: %d",reason,SpielerName(pID), sInfo[pID][pWanteds]);
  1470.         SendFrakMessage(1,COLOR_PDBLAU,string);
  1471.         return 1;
  1472.     }
  1473.     return 1;
  1474. }
  1475. ocmd:tie(playerid,params[])
  1476. {
  1477.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  1478.     if(sInfo[playerid][pTot] == 1)return SendClientMessage(playerid,COLOR_GRAU,"Tote kˆnnen keine Befehle benutzen.");
  1479.     return 1;
  1480. }
  1481. ocmd:r(playerid,params[])
  1482. {
  1483.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  1484.     if(sInfo[playerid][pTot] == 1)return SendClientMessage(playerid,COLOR_GRAU,"Tote kˆnnen keine Befehle benutzen.");
  1485.     if(isFrakt(playerid,1) || isFrakt(playerid,2) || isFrakt(playerid,3) || isFrakt(playerid,4))
  1486.     {
  1487.         new text[64],string[128];
  1488.         if(sscanf(params,"s",text))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /f(chat)[Text]");
  1489.         format(string,sizeof(string),"%s gibt etwas durch sein Funkger‰t durch.",SpielerName(playerid));
  1490.         ProxerToPlayer(playerid,COLOR_MEFARBE,string,15.0);
  1491.         format(string,sizeof(string),"**%s %s: %s.**",SpielerFrakRang(playerid),SpielerName(playerid),text);
  1492.         SendFrakMessage(sInfo[playerid][pFraktion],COLOR_FCHAT,string);
  1493.     }
  1494.     return 1;
  1495. }
  1496. ocmd:f(playerid,params[])
  1497. {
  1498.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  1499.     if(sInfo[playerid][pTot] == 1)return SendClientMessage(playerid,COLOR_GRAU,"Tote kˆnnen keine Befehle benutzen.");
  1500.     if(!isPlayerInBadFrak(playerid))return 1;
  1501.     new text[64],string[128];
  1502.     if(sscanf(params,"s",text))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /f(chat)[Text]");
  1503.     format(string,sizeof(string),"**%s %s: %s.**",SpielerFrakRang(playerid),SpielerName(playerid),text);
  1504.     SendFrakMessage(sInfo[playerid][pFraktion],COLOR_FCHAT,string);
  1505.     return 1;
  1506. }
  1507. //Allgemein
  1508. ocmd:cv(playerid,params[])
  1509. {
  1510.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  1511.     if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,COLOR_GRAU,"Nur im Fahrzeug mˆglich.");
  1512.     new cmd[32];
  1513.     new vID = GetPlayerVehicleID(playerid);
  1514.     if(sscanf(params,"s",cmd))return SendClientMessage(playerid,COLOR_GRAU,"Benutzung: /cv [Motor/Licht]");
  1515.     if(strcmp(cmd,"motor",true) == 0)
  1516.     {
  1517.         GetVehicleParamsEx(vID,engine,lights,alarm,doors,bonnet,boot,objective);
  1518.         if(motor[vID] == false)
  1519.         {
  1520.             motor[vID] = true;
  1521.             SetVehicleParamsEx(vID,1,lights,alarm,doors,bonnet,boot,objective);
  1522.             GameTextForPlayer(playerid,"~w~Motor ~g~gestartet",2000,4);
  1523.             return 1;
  1524.         }
  1525.         else if(motor[vID] == true)
  1526.         {
  1527.             motor[vID] = false;
  1528.             SetVehicleParamsEx(vID,0,lights,alarm,doors,bonnet,boot,objective);
  1529.             GameTextForPlayer(playerid,"~w~Motor ~r~ausgeschaltet",2000,4);
  1530.             return 1;
  1531.         }
  1532.     }
  1533.     if(strcmp(cmd,"licht",true) == 0)
  1534.     {
  1535.         GetVehicleParamsEx(vID,engine,lights,alarm,doors,bonnet,boot,objective);
  1536.         if(licht[vID] == false)
  1537.         {
  1538.             licht[vID] = true;
  1539.             SetVehicleParamsEx(vID,engine,1,alarm,doors,bonnet,boot,objective);
  1540.             GameTextForPlayer(playerid,"~w~Licht ~g~angeschaltet",2000,4);
  1541.             return 1;
  1542.         }
  1543.         else if(licht[vID] == true)
  1544.         {
  1545.             licht[vID] = false;
  1546.             SetVehicleParamsEx(vID,engine,0,alarm,doors,bonnet,boot,objective);
  1547.             GameTextForPlayer(playerid,"~w~Licht ~r~ausgeschaltet",2000,4);
  1548.             return 1;
  1549.         }
  1550.     }
  1551.     return 1;
  1552. }
  1553. ocmd:drivein(playerid,params[])
  1554. {
  1555.     #pragma unused params
  1556.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  1557.     if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,COLOR_GRAU,"Nur im Fahrzeug mˆglich.");
  1558.     new string[128];
  1559.     for(new i = 0; i < sizeof(DriveInInfo); i++)
  1560.     {
  1561.         if(IsPlayerInRangeOfPoint(playerid,5.0,DriveInInfo[i][drX],DriveInInfo[i][drY],DriveInInfo[i][drZ]))
  1562.         {
  1563.             TogglePlayerControllable(playerid,0);
  1564.             format(string,sizeof(string),"Herzlich Willkommen beim %s",DriveInInfo[i][drBeschreibung]);
  1565.             SendClientMessage(playerid,COLOR_ORANGE,string);
  1566.             SendClientMessage(playerid,COLOR_WEISS,"Ihre Bestellung wird gerade zubereitet.");
  1567.             SendClientMessage(playerid,COLOR_WEISS,"Bitte warten Sie einen Augenblick.");
  1568.             driveintimer[playerid] = SetTimerEx("UpdateDriveIn",10000,false,"i",playerid);
  1569.         }
  1570.     }
  1571.     return 1;
  1572. }
  1573. ocmd:admins(playerid,params[])
  1574. {
  1575.     #pragma unused params
  1576.     if(sInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GRAU,"Du bist nicht Eingeloggt.");
  1577.     new string[128],status[32];
  1578.     SendClientMessage(playerid,COLOR_ORANGE,"[__________Admins Online__________]");
  1579.     for(new i = 0; i < GetMaxPlayers(); i++)
  1580.     {
  1581.         if(IsPlayerConnected(i) && sInfo[i][pEingeloggt] == 1)
  1582.         {
  1583.             if(isAdmin(playerid,1))
  1584.             {
  1585.                 switch(sInfo[i][pAduty])
  1586.                 {
  1587.                     case 0:{status = "Nicht im Dienst.";}
  1588.                     case 1:{status = "Im Dienst";}
  1589.                 }
  1590.                 format(string,sizeof(string),"**%s %s: %s",AdminRang(sInfo[i][pAdmin]),SpielerName(i),status);
  1591.                 SendClientMessage(playerid,COLOR_WEISS,string);
  1592.             }
  1593.         }
  1594.     }
  1595.     return 1;
  1596. }
  1597. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  1598. {
  1599.     if(motor[vehicleid] == false)
  1600.     {
  1601.         SendClientMessage(playerid,COLOR_BLAU,"INFO: Mit /cv kannst du das Fahrzeug kontrollieren.(Taste Z)");
  1602.     }
  1603.     return 1;
  1604. }
  1605.  
  1606. public OnPlayerExitVehicle(playerid, vehicleid)
  1607. {
  1608.     return 1;
  1609. }
  1610.  
  1611. public OnPlayerStateChange(playerid, newstate, oldstate)
  1612. {
  1613.     if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
  1614.     {
  1615.         SetPlayerArmedWeapon(playerid,0);
  1616.     }
  1617.     return 1;
  1618. }
  1619.  
  1620. public OnPlayerEnterCheckpoint(playerid)
  1621. {
  1622.     return 1;
  1623. }
  1624.  
  1625. public OnPlayerLeaveCheckpoint(playerid)
  1626. {
  1627.     return 1;
  1628. }
  1629.  
  1630. public OnPlayerEnterRaceCheckpoint(playerid)
  1631. {
  1632.     return 1;
  1633. }
  1634.  
  1635. public OnPlayerLeaveRaceCheckpoint(playerid)
  1636. {
  1637.     return 1;
  1638. }
  1639.  
  1640. public OnRconCommand(cmd[])
  1641. {
  1642.     return 1;
  1643. }
  1644.  
  1645. public OnPlayerRequestSpawn(playerid)
  1646. {
  1647.     if(IsPlayerNPC(playerid))return 1;
  1648.     if(sInfo[playerid][pEingeloggt] == 0)return 1;
  1649.     return 1;
  1650. }
  1651.  
  1652. public OnObjectMoved(objectid)
  1653. {
  1654.     return 1;
  1655. }
  1656.  
  1657. public OnPlayerObjectMoved(playerid, objectid)
  1658. {
  1659.     return 1;
  1660. }
  1661.  
  1662. public OnPlayerPickUpPickup(playerid, pickupid)
  1663. {
  1664.     if(pickupid == Eingang[0])//Los Santos Police Department
  1665.     {
  1666.         SetPlayerPos(playerid,246.5590,65.5541,1003.6406);
  1667.         SetPlayerInterior(playerid,6);
  1668.         SetPlayerFacingAngle(playerid,0.3134);
  1669.     }
  1670.     if(pickupid == Ausgang[0])//Los Santos Police Department
  1671.     {
  1672.         SetPlayerPos(playerid,1551.0090,-1675.6046,15.6600);
  1673.         SetPlayerInterior(playerid,0);
  1674.         SetPlayerFacingAngle(playerid,88.9235);
  1675.     }
  1676.     if(pickupid == Eingang[1])//Hitman
  1677.     {
  1678.         if(isFrakt(playerid,10))
  1679.         {
  1680.             SetPlayerPos(playerid,962.6869,2107.8796,1011.0303);
  1681.             SetPlayerInterior(playerid,1);
  1682.             SetPlayerFacingAngle(playerid,87.9645);
  1683.         }
  1684.     }
  1685.     if(pickupid == Ausgang[1])//Hitman
  1686.     {
  1687.         if(isFrakt(playerid,10))
  1688.         {
  1689.             SetPlayerPos(playerid,289.1647,-1601.5796,17.8593);
  1690.             SetPlayerInterior(playerid,0);
  1691.             SetPlayerFacingAngle(playerid,355.0007);
  1692.         }
  1693.     }
  1694.     if(pickupid == Eingang[2])//Grove Street
  1695.     {
  1696.         SetPlayerPos(playerid,1339.8002,64.2431,1001.0078);
  1697.         SetPlayerInterior(playerid,0);
  1698.         SetPlayerFacingAngle(playerid,178.0738);
  1699.     }
  1700.     if(pickupid == Ausgang[2])//Grove Street
  1701.     {
  1702.         SetPlayerPos(playerid,2495.4109,-1687.7690,13.5164);
  1703.         SetPlayerInterior(playerid,0);
  1704.         SetPlayerFacingAngle(playerid,357.9112);
  1705.     }
  1706.     if(pickupid == Eingang[3])//Ballas Familie
  1707.     {
  1708.         SetPlayerPos(playerid,2807.6309,-1172.0702,1025.5703);
  1709.         SetPlayerInterior(playerid,8);
  1710.         SetPlayerFacingAngle(playerid,0.8760);
  1711.     }
  1712.     if(pickupid == Ausgang[3])//Ballas Familie
  1713.     {
  1714.         SetPlayerPos(playerid,1905.8623,-1115.4951,25.6641);
  1715.         SetPlayerInterior(playerid,0);
  1716.         SetPlayerFacingAngle(playerid,177.6859);
  1717.     }
  1718.     if(pickupid == Eingang[4])//Ordnungsamt
  1719.     {
  1720.         SetPlayerPos(playerid,322.197998,302.497985,999.148437);
  1721.         SetPlayerInterior(playerid,5);
  1722.     }
  1723.     if(pickupid == Eingang[5])//Yakuza
  1724.     {
  1725.         SetPlayerPos(playerid,-2636.7310,1405.0604,906.4609);
  1726.         SetPlayerInterior(playerid,3);
  1727.         SetPlayerFacingAngle(playerid,0.7254);
  1728.     }
  1729.     if(pickupid == Ausgang[5])//Yakuza
  1730.     {
  1731.         SetPlayerPos(playerid,299.0110,-1155.7712,80.9099);
  1732.         SetPlayerInterior(playerid,0);
  1733.         SetPlayerFacingAngle(playerid,130.6970);
  1734.     }
  1735.     if(pickupid == Eingang[6])//Triaden
  1736.     {
  1737.         SetPlayerPos(playerid,1705.5198,-1667.7308,20.2259);
  1738.         SetPlayerInterior(playerid,18);
  1739.         SetPlayerFacingAngle(playerid,268.8509);
  1740.     }
  1741.     if(pickupid == Ausgang[6])//Triaden
  1742.     {
  1743.         SetPlayerPos(playerid,1497.0594,-690.8240,94.7500);
  1744.         SetPlayerInterior(playerid,0);
  1745.         SetPlayerFacingAngle(playerid,178.3210);
  1746.     }
  1747.     if(pickupid == Eingang[7])//Aztecas
  1748.     {
  1749.         SetPlayerPos(playerid,2454.717041,-1700.871582,1013.515197);
  1750.         SetPlayerInterior(playerid,2);
  1751.         SetPlayerFacingAngle(playerid,90.6290);
  1752.     }
  1753.     if(pickupid == Ausgang[7])//Aztecas
  1754.     {
  1755.         SetPlayerPos(playerid,2754.7476,-1962.8741,13.5459);
  1756.         SetPlayerInterior(playerid,0);
  1757.         SetPlayerFacingAngle(playerid,269.5294);
  1758.     }
  1759.     return 1;
  1760. }
  1761.  
  1762. public OnVehicleMod(playerid, vehicleid, componentid)
  1763. {
  1764.     for(new i = 0; i < MAX_FRAKVEHICLE; i++)
  1765.     {
  1766.         if(vehicleid == fvInfo[i][fvCar])
  1767.         {
  1768.             switch(GetVehicleComponentType(componentid))
  1769.             {
  1770.                 case 0:fvInfo[i][fvspoiler] = componentid;
  1771.                 case 1:fvInfo[i][fvhood] = componentid;
  1772.                 case 2:fvInfo[i][fvroof] = componentid;
  1773.                 case 3:fvInfo[i][fvsideskirt] = componentid;
  1774.                 case 4:fvInfo[i][fvlamps] = componentid;
  1775.                 case 5:fvInfo[i][fvnitro] = componentid;
  1776.                 case 6:fvInfo[i][fvexhaust] = componentid;
  1777.                 case 7:fvInfo[i][fvwheels] = componentid;
  1778.                 case 8:fvInfo[i][fvstereo] = componentid;
  1779.                 case 9:fvInfo[i][fvhydraulics] = componentid;
  1780.                 case 10:fvInfo[i][fvfrontbumper] = componentid;
  1781.                 case 11:fvInfo[i][fvrearbumper] = componentid;
  1782.                 case 12:fvInfo[i][fvventright] = componentid;
  1783.                 case 13:fvInfo[i][fvventleft] = componentid;
  1784.             }
  1785.             return 1;
  1786.         }
  1787.     }
  1788.     return 1;
  1789. }
  1790.  
  1791. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  1792. {
  1793.     return 1;
  1794. }
  1795.  
  1796. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  1797. {
  1798.     return 1;
  1799. }
  1800.  
  1801. public OnPlayerSelectedMenuRow(playerid, row)
  1802. {
  1803.     return 1;
  1804. }
  1805.  
  1806. public OnPlayerExitedMenu(playerid)
  1807. {
  1808.     return 1;
  1809. }
  1810.  
  1811. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  1812. {
  1813.     return 1;
  1814. }
  1815.  
  1816. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  1817. {
  1818.     if(newkeys == 65536)
  1819.     {
  1820.         new vID = GetPlayerVehicleID(playerid);
  1821.         if(!IsPlayerInAnyVehicle(playerid))return 1;
  1822.         GetVehicleParamsEx(vID,engine,lights,alarm,doors,bonnet,boot,objective);
  1823.         if(motor[vID] == false)
  1824.         {
  1825.             motor[vID] = true;
  1826.             SetVehicleParamsEx(vID,1,lights,alarm,doors,bonnet,boot,objective);
  1827.             GameTextForPlayer(playerid,"~w~Motor ~g~gestartet",2000,4);
  1828.             return 1;
  1829.         }
  1830.         else if(motor[vID] == true)
  1831.         {
  1832.             motor[vID] = false;
  1833.             SetVehicleParamsEx(vID,0,lights,alarm,doors,bonnet,boot,objective);
  1834.             GameTextForPlayer(playerid,"~w~Motor ~r~ausgeschaltet",2000,4);
  1835.             return 1;
  1836.         }
  1837.     }
  1838.     if(newkeys == KEY_NO)
  1839.     {
  1840.         if(IsPlayerInRangeOfPoint(playerid,5.0,1336.0338,48.8502,1001.0156) || IsPlayerInRangeOfPoint(playerid,5.0,2820.2852,-1173.0509,1025.5703)
  1841.         || IsPlayerInRangeOfPoint(playerid,5.0,-2634.5540,1409.6840,906.4647) || IsPlayerInRangeOfPoint(playerid,5.0,1709.5746,-1642.5717,20.2188)
  1842.         || IsPlayerInRangeOfPoint(playerid,5.0,2455.6226,-1706.2953,1013.5078) || IsPlayerInRangeOfPoint(playerid,5.0,948.4531,2104.1658,1011.0234))
  1843.         {
  1844.             ocmd_equip(playerid,"");
  1845.             return 1;
  1846.         }
  1847.         else if(IsPlayerInRangeOfPoint(playerid,5.0,254.4515,76.7813,1003.6406))
  1848.         {
  1849.             ocmd_duty(playerid,"");
  1850.             return 1;
  1851.         }
  1852.         else if(IsPlayerInRangeOfPoint(playerid,5.0,246.4084,87.7833,1003.6406))
  1853.         {
  1854.             SetPlayerPos(playerid,1568.7195,-1694.0596,5.8906);
  1855.             SetPlayerFacingAngle(playerid,180.9552);
  1856.             SetPlayerInterior(playerid,0);
  1857.             return 1;
  1858.         }
  1859.         else if(IsPlayerInRangeOfPoint(playerid,5.0,1568.6493,-1689.9703,6.2188))
  1860.         {
  1861.             SetPlayerPos(playerid,246.4084,87.7833,1003.6406);
  1862.             SetPlayerInterior(playerid,6);
  1863.             return 1;
  1864.         }
  1865.     }
  1866.     return 1;
  1867. }
  1868.  
  1869. public OnRconLoginAttempt(ip[], password[], success)
  1870. {
  1871.     return 1;
  1872. }
  1873.  
  1874. public OnPlayerUpdate(playerid)
  1875. {
  1876.     return 1;
  1877. }
  1878.  
  1879. public OnPlayerStreamIn(playerid, forplayerid)
  1880. {
  1881.     return 1;
  1882. }
  1883.  
  1884. public OnPlayerStreamOut(playerid, forplayerid)
  1885. {
  1886.     return 1;
  1887. }
  1888. public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
  1889. {
  1890.     if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9 && isFrakt(issuerid,10))
  1891.     {
  1892.         SetPlayerHealth(playerid, 0.0);
  1893.     }
  1894.     return 1;
  1895. }
  1896. public OnVehicleStreamIn(vehicleid, forplayerid)
  1897. {
  1898.     for(new i = 0; i < sizeof(fvInfo); i++)
  1899.     {
  1900.         if(vehicleid == fvInfo[i][fvCar])
  1901.         {
  1902.             if(fvInfo[i][fvfrakid] == sInfo[forplayerid][pFraktion])
  1903.             {
  1904.                 SetVehicleParamsForPlayer(fvInfo[i][fvCar], forplayerid, 0, 0);
  1905.                 return 1;
  1906.             }
  1907.             else
  1908.             {
  1909.                 if(fvInfo[i][fvAbgeschlossen] == 0)
  1910.                 {
  1911.                     SetVehicleParamsForPlayer(fvInfo[i][fvCar], forplayerid, 0, 0);
  1912.                     return 1;
  1913.                 }
  1914.                 else
  1915.                 {
  1916.                     SetVehicleParamsForPlayer(fvInfo[i][fvCar], forplayerid, 0, 1);
  1917.                     return 1;
  1918.                 }
  1919.             }
  1920.         }
  1921.     }
  1922.     for(new j = 0; j < GetMaxPlayers(); j++)
  1923.     {
  1924.         if(vehicleid == sInfo[j][pSupmobil])
  1925.         {
  1926.             if(sInfo[j][pSupID] != forplayerid)
  1927.             {
  1928.                 SetVehicleParamsForPlayer(sInfo[j][pSupmobil], forplayerid, 0, 1);
  1929.             }
  1930.             else
  1931.             {
  1932.                 SetVehicleParamsForPlayer(sInfo[j][pSupmobil], forplayerid, 0, 0);
  1933.             }
  1934.         }
  1935.     }
  1936.     return 1;
  1937. }
  1938.  
  1939. public OnVehicleStreamOut(vehicleid, forplayerid)
  1940. {
  1941.     return 1;
  1942. }
  1943.  
  1944. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  1945. {
  1946.     new string[128];
  1947.     if(dialogid == DIALOG_REGISTER)
  1948.     {
  1949.         if(response)
  1950.         {
  1951.             if(strlen(inputtext) > 6 && strlen(inputtext) < 12)
  1952.             {
  1953.                 new passwort[12];
  1954.                 mysql_escape_string(inputtext,passwort,MYSQLConnect);
  1955.                 format(string,sizeof(string),"INSERT INTO accounts (name,passwort) VALUES ('%s',MD5('%s'))",SpielerName(playerid),passwort);
  1956.                 mysql_function_query(MYSQLConnect,string,true,"OnSpielerRegister","i",playerid);
  1957.                 return 1;
  1958.             }
  1959.             else
  1960.             {
  1961.                 SendClientMessage(playerid,COLOR_WEISS,""#HTML_ROT"Fehler:"#HTML_WHITE"Das Passwort muss mind. 6 Zeichen lang sein.");
  1962.                 format(string,sizeof(string),""#HTML_GRUN"Herzlich Willkommen auf Selfmade\n\n"#HTML_ROT"Benutzername: "#HTML_WHITE"%s\n\n"#HTML_ORANGE"Gib dein gew¸nschtes Passwort ein:",SpielerName(playerid));
  1963.                 ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Selfmade Roleplay",string,"Registrieren","Abbrechen");
  1964.             }
  1965.         }
  1966.         else
  1967.         {
  1968.             Kick(playerid);
  1969.         }
  1970.     }
  1971.     if(dialogid == DIALOG_LOGIN)
  1972.     {
  1973.         if(response)
  1974.         {
  1975.             if(strlen(inputtext) > 0)
  1976.             {
  1977.                 new passwort[12];
  1978.                 mysql_escape_string(inputtext,passwort,MYSQLConnect);
  1979.                 format(string,sizeof(string),"SELECT * FROM accounts WHERE name='%s' AND passwort=MD5('%s')",SpielerName(playerid),passwort);
  1980.                 mysql_function_query(MYSQLConnect,string,true,"OnSpielerLoad","i",playerid);
  1981.             }
  1982.             else
  1983.             {
  1984.                 SendClientMessage(playerid,COLOR_WEISS,""#HTML_ROT"Fehler:"#HTML_WHITE"Geben Sie das richtige Passwort ein!");
  1985.                 format(string,sizeof(string),""#HTML_GRUN"Herzlich Willkommen zur¸ck,\n\n"#HTML_ROT"Benutzername: "#HTML_WHITE"%s\n\n"#HTML_ORANGE"Gib dein Passwort ein:",SpielerName(playerid));
  1986.                 ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Selfmade Rolepaly",string,"Login","Abbrechen");
  1987.             }
  1988.         }
  1989.         else
  1990.         {
  1991.             Kick(playerid);
  1992.         }
  1993.     }
  1994.     if(dialogid == DIALOG_GESCHLECHT)
  1995.     {
  1996.         if(response)
  1997.         {
  1998.             sInfo[playerid][pGeschlecht] = 1;
  1999.             ShowPlayerDialog(playerid,DIALOG_ALTER,DIALOG_STYLE_INPUT,"Registrierung | Alter",""#HTML_WHITE"Wie alt bist du ?","Weiter","");
  2000.         }
  2001.         else
  2002.         {
  2003.             sInfo[playerid][pGeschlecht] = 2;
  2004.             ShowPlayerDialog(playerid,DIALOG_ALTER,DIALOG_STYLE_INPUT,"Registrierung | Alter",""#HTML_WHITE"Wie alt bist du ?","Weiter","");
  2005.         }
  2006.         return 1;
  2007.     }
  2008.     if(dialogid == DIALOG_ALTER)
  2009.     {
  2010.         if(response)
  2011.         {
  2012.             if(IsNumeric(inputtext))
  2013.             {
  2014.                 if(strval(inputtext) >= 12 || strval(inputtext) <= 65)
  2015.                 {
  2016.                     sInfo[playerid][pAlter] = strval(inputtext);
  2017.                     SaveSpieler(playerid);
  2018.                     TogglePlayerSpectating(playerid,0);
  2019.                     SpawnPlayerEx(playerid);
  2020.                     return 1;
  2021.                 }
  2022.                 else
  2023.                 {
  2024.                     SendClientMessage(playerid,COLOR_GRAU,"Fehler: Dein Alter darf nur zwischen 12 - 65 Jahren liegen.");
  2025.                     ShowPlayerDialog(playerid,DIALOG_ALTER,DIALOG_STYLE_INPUT,"Registrierung | Alter","Wie alt bist du ?","Weiter","");
  2026.                     return 1;
  2027.                 }
  2028.             }
  2029.             else
  2030.             {
  2031.                 SendClientMessage(playerid,COLOR_GRAU,"Fehler: Es sind nur Zahlen erlaubt.");
  2032.                 ShowPlayerDialog(playerid,DIALOG_ALTER,DIALOG_STYLE_INPUT,"Registrierung | Alter","Wie alt bist du ?","Weiter","");
  2033.                 return 1;
  2034.             }
  2035.         }
  2036.     }
  2037.     return 1;
  2038. }
  2039.  
  2040. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  2041. {
  2042.     return 1;
  2043. }
  2044. public OnSpielerCheck(playerid)
  2045. {
  2046.     new num_rows,num_fields,string[128];
  2047.     cache_get_data(num_rows,num_fields,MYSQLConnect);
  2048.     SpamChat(playerid,0);
  2049.     if(num_rows == 0)
  2050.     {
  2051.         //Registrierung
  2052.         format(string,sizeof(string),""#HTML_GRUN"Herzlich Willkommen auf Selfmade\n\n"#HTML_ROT"Benutzername: "#HTML_WHITE"%s\n\n"#HTML_ORANGE"Gib dein gew¸nschtes Passwort ein:",SpielerName(playerid));
  2053.         ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Selfmade Roleplay",string,"Registrieren","Abbrechen");
  2054.     }
  2055.     else
  2056.     {
  2057.         //Login
  2058.         format(string,sizeof(string),""#HTML_GRUN"Herzlich Willkommen zur¸ck,\n\n"#HTML_ROT"Benutzername: "#HTML_WHITE"%s\n\n"#HTML_ORANGE"Gib dein Passwort ein:",SpielerName(playerid));
  2059.         ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Selfmade Rolepaly",string,"Login","Abbrechen");
  2060.     }
  2061.     return 1;
  2062. }
  2063. public OnSpielerRegister(playerid)
  2064. {
  2065.     sInfo[playerid][pDB] = cache_insert_id(MYSQLConnect);
  2066.     sInfo[playerid][pEingeloggt] = 1;
  2067.     sInfo[playerid][pGeld] = 500;
  2068.     GivePlayerMoney(playerid,500);
  2069.     sInfo[playerid][pLevel] = 1;
  2070.     SetPlayerScore(playerid,1);
  2071.     ShowPlayerDialog(playerid,DIALOG_GESCHLECHT,DIALOG_STYLE_MSGBOX,"Registriereung | Geschlecht","Bist ein "#HTML_BLAU"Mann "#HTML_WHITE"oder eine "#HTML_BLAU"Frau"#HTML_WHITE"?","Mann","Frau");
  2072.     return 1;
  2073. }
  2074. public OnSpielerLoad(playerid)
  2075. {
  2076.     new num_rows,num_fields,string[128];
  2077.     cache_get_data(num_rows,num_fields,MYSQLConnect);
  2078.     if(num_rows == 1)
  2079.     {
  2080.         //Passwort richtig
  2081.         sInfo[playerid][pEingeloggt] = 1;
  2082.         sInfo[playerid][pDB] = cache_get_field_content_int(0,"id",MYSQLConnect);
  2083.         sInfo[playerid][pLevel] = cache_get_field_content_int(0,"level",MYSQLConnect);
  2084.         sInfo[playerid][pGeld] = cache_get_field_content_int(0,"geld",MYSQLConnect);
  2085.         sInfo[playerid][pFraktion] = cache_get_field_content_int(0,"fraktion",MYSQLConnect);
  2086.         sInfo[playerid][pRang] = cache_get_field_content_int(0,"rang",MYSQLConnect);
  2087.         sInfo[playerid][pAdmin] = cache_get_field_content_int(0,"admin",MYSQLConnect);
  2088.         sInfo[playerid][pLeader] = cache_get_field_content_int(0,"leader",MYSQLConnect);
  2089.         sInfo[playerid][pFSkin] = cache_get_field_content_int(0,"fskin",MYSQLConnect);
  2090.         GivePlayerMoney(playerid,sInfo[playerid][pGeld]);
  2091.         SetPlayerScore(playerid,sInfo[playerid][pLevel]);
  2092.         TogglePlayerSpectating(playerid,0);
  2093.         SpawnPlayer(playerid);
  2094.     }
  2095.     else
  2096.     {
  2097.         //Passwort falsch
  2098.         SendClientMessage(playerid,COLOR_WEISS,""#HTML_ROT"Fehler:"#HTML_WHITE"Das Passwort war falsch.Bitte geben Sie das richtige Passwort ein!");
  2099.         format(string,sizeof(string),""#HTML_GRUN"Herzlich Willkommen zur¸ck,\n\n"#HTML_ROT"Benutzername: "#HTML_WHITE"%s\n\n"#HTML_ORANGE"Gib dein Passwort ein:",SpielerName(playerid));
  2100.         ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Selfmade Rolepaly",string,"Login","Abbrechen");
  2101.     }
  2102.     return 1;
  2103. }
  2104. public UpdateServer()
  2105. {
  2106.     new hour,minute,day,month,year;
  2107.     gettime(hour,minute);
  2108.     getdate(year,month,day);
  2109.     SetWorldTime(hour);
  2110.     new string[128];
  2111.     format(string,sizeof(string),"%02d:%02d",hour,minute);
  2112.     TextDrawSetString(Uhr,string);
  2113.     format(string,sizeof(string),"%02d.%02d.%d",day,month,year);
  2114.     TextDrawSetString(Datum,string);
  2115.     for(new i = 0; i < sizeof(fInfo); i++)
  2116.     {
  2117.         SaveFraktionen(i);
  2118.     }
  2119.     return 1;
  2120. }
  2121. public KickPlayer(playerid)
  2122. {
  2123.     Kick(playerid);
  2124.     return 1;
  2125. }
  2126. public OnSpielerBanned(playerid)
  2127. {
  2128.     new num_rows,num_fields,admin[64],reason[64],zeit,string[256];
  2129.     cache_get_data(num_rows,num_fields,MYSQLConnect);
  2130.     if(num_rows)
  2131.     {
  2132.         zeit = cache_get_field_content_int(0,"Zeit",MYSQLConnect);
  2133.         cache_get_field_content(0,"Admin",admin,MYSQLConnect);
  2134.         cache_get_field_content(0,"Grund",reason,MYSQLConnect);
  2135.         if(zeit == -1)
  2136.         {
  2137.             format(string,sizeof(string),"Du wurdest vom Server gebannt.\nWenn du zu Unrecht gebannt wurdest melde dich im Teamspeak\nDauer: permanent\nGrund: %s\nAdmin: %s",reason,admin);
  2138.             ShowPlayerDialog(playerid,DIALOG_BANNED,DIALOG_STYLE_MSGBOX,"German Selfmade Reallife",string,"Schlieflen","");
  2139.             KickEx(playerid);
  2140.         }
  2141.         else
  2142.         {
  2143.             new timeban = zeit - gettime();
  2144.             if(gettime() < zeit)
  2145.             {
  2146.            
  2147.                 format(string,sizeof(string),"Du wurdest vom Server gebannt.\nWenn du zu Unrecht gebannt wurdest melde dich im Teamspeak\nDauer: %d Minuten\nGrund: %s\nAdmin: %s",timeban/60,reason,admin);
  2148.                 ShowPlayerDialog(playerid,DIALOG_BANNED,DIALOG_STYLE_MSGBOX,"German Selfmade Reallife",string,"Schlieflen","");
  2149.                 KickEx(playerid);
  2150.             }
  2151.             else
  2152.             {
  2153.                 format(string,sizeof(string),"DELETE FROM accounts_ban WHERE Spieler = '%s'",SpielerName(playerid));
  2154.                 mysql_function_query(MYSQLConnect,string,false,"","");
  2155.             }
  2156.         }
  2157.     }
  2158.     return 1;
  2159. }
  2160. public FrakVehicleSaved(i)
  2161. {
  2162.     fvInfo[i][fcID] = cache_insert_id(MYSQLConnect);
  2163.     return 1;
  2164. }
  2165. public OnFrakVehicleLoad()
  2166. {
  2167.     new num_rows,num_fields,index;
  2168.     cache_get_data(num_rows,num_fields,MYSQLConnect);
  2169.     if(!num_rows)return 1;
  2170.     for(new i = 0; i < num_rows; i++)
  2171.     {
  2172.         new j = FrakVehicleID();
  2173.         fvInfo[j][fcID] = cache_get_field_content_int(i,"id",MYSQLConnect);
  2174.         fvInfo[j][fvX] = cache_get_field_content_float(i,"X",MYSQLConnect);
  2175.         fvInfo[j][fvY] = cache_get_field_content_float(i,"Y",MYSQLConnect);
  2176.         fvInfo[j][fvZ] = cache_get_field_content_float(i,"Z",MYSQLConnect);
  2177.         fvInfo[j][fvA] = cache_get_field_content_float(i,"A",MYSQLConnect);
  2178.         fvInfo[j][fvmodelid] = cache_get_field_content_int(i,"modelid",MYSQLConnect);
  2179.         fvInfo[j][fvfrakid] = cache_get_field_content_int(i,"frakid",MYSQLConnect);
  2180.         fvInfo[j][fvcolor1] = cache_get_field_content_int(i,"color1",MYSQLConnect);
  2181.         fvInfo[j][fvcolor2] = cache_get_field_content_int(i,"color2",MYSQLConnect);
  2182.         fvInfo[j][fvspoiler] = cache_get_field_content_int(i,"spoiler",MYSQLConnect);
  2183.         fvInfo[j][fvhood] = cache_get_field_content_int(i,"hood",MYSQLConnect);
  2184.         fvInfo[j][fvroof] = cache_get_field_content_int(i,"roof",MYSQLConnect);
  2185.         fvInfo[j][fvsideskirt] = cache_get_field_content_int(i,"sideskirt",MYSQLConnect);
  2186.         fvInfo[j][fvlamps] = cache_get_field_content_int(i,"lamps",MYSQLConnect);
  2187.         fvInfo[j][fvnitro] = cache_get_field_content_int(i,"nitro",MYSQLConnect);
  2188.         fvInfo[j][fvexhaust] = cache_get_field_content_int(i,"exhaust",MYSQLConnect);
  2189.         fvInfo[j][fvwheels] = cache_get_field_content_int(i,"wheels",MYSQLConnect);
  2190.         fvInfo[j][fvstereo] = cache_get_field_content_int(i,"stereo",MYSQLConnect);
  2191.         fvInfo[j][fvhydraulics] = cache_get_field_content_int(i,"hydraulics",MYSQLConnect);
  2192.         fvInfo[j][fvfrontbumper] = cache_get_field_content_int(i,"front",MYSQLConnect);
  2193.         fvInfo[j][fvrearbumper] = cache_get_field_content_int(i,"rear",MYSQLConnect);
  2194.         fvInfo[j][fvventright] = cache_get_field_content_int(i,"ventright",MYSQLConnect);
  2195.         fvInfo[j][fvventleft] = cache_get_field_content_int(i,"ventleft",MYSQLConnect);
  2196.         fvInfo[j][fvCar] = CreateVehicle(fvInfo[j][fvmodelid],fvInfo[j][fvX],fvInfo[j][fvY],fvInfo[j][fvZ],fvInfo[j][fvA],fvInfo[j][fvcolor1],fvInfo[j][fvcolor2],-1);
  2197.         fvInfo[j][fvAbgeschlossen] = 1;
  2198.         if(fvInfo[j][fvspoiler] >= 1000) { AddVehicleComponent(fvInfo[j][fvCar],fvInfo[j][fvspoiler]); }
  2199.         if(fvInfo[j][fvhood] >= 1000) { AddVehicleComponent(fvInfo[j][fvCar],fvInfo[j][fvhood]); }
  2200.         if(fvInfo[j][fvroof] >= 1000) { AddVehicleComponent(fvInfo[j][fvCar],fvInfo[j][fvroof]); }
  2201.         if(fvInfo[j][fvsideskirt] >= 1000) { AddVehicleComponent(fvInfo[j][fvCar],fvInfo[j][fvsideskirt]); }
  2202.         if(fvInfo[j][fvlamps] >= 1000) { AddVehicleComponent(fvInfo[j][fvCar],fvInfo[j][fvlamps]); }
  2203.         if(fvInfo[j][fvnitro] >= 1000) { AddVehicleComponent(fvInfo[j][fvCar],fvInfo[j][fvnitro]); }
  2204.         if(fvInfo[j][fvexhaust] >= 1000) { AddVehicleComponent(fvInfo[j][fvCar],fvInfo[j][fvexhaust]); }
  2205.         if(fvInfo[j][fvwheels] >= 1000) { AddVehicleComponent(fvInfo[j][fvCar],fvInfo[j][fvwheels]); }
  2206.         if(fvInfo[j][fvstereo] >= 1000) { AddVehicleComponent(fvInfo[j][fvCar],fvInfo[j][fvstereo]); }
  2207.         if(fvInfo[j][fvhydraulics] >= 1000) { AddVehicleComponent(fvInfo[j][fvCar],fvInfo[j][fvhydraulics]); }
  2208.         if(fvInfo[j][fvfrontbumper] >= 1000) { AddVehicleComponent(fvInfo[j][fvCar],fvInfo[j][fvfrontbumper]); }
  2209.         if(fvInfo[j][fvrearbumper] >= 1000) { AddVehicleComponent(fvInfo[j][fvCar],fvInfo[j][fvrearbumper]); }
  2210.         if(fvInfo[j][fvventright] >= 1000) { AddVehicleComponent(fvInfo[j][fvCar],fvInfo[j][fvventright]); }
  2211.         if(fvInfo[j][fvventleft] >= 1000) { AddVehicleComponent(fvInfo[j][fvCar],fvInfo[j][fvventleft]); }
  2212.         GetVehicleParamsEx(fvInfo[j][fvCar],engine,lights,alarm,doors,bonnet,boot,objective);
  2213.         SetVehicleParamsEx(fvInfo[j][fvCar],engine,lights,alarm,VEHICLE_PARAMS_ON,bonnet,boot,objective);
  2214.         index++;
  2215.     }
  2216.     return printf("Es wurden %d Fraktionsfahrzeuge geladen.",index);
  2217. }
  2218. public OnFraktionenLoad()
  2219. {
  2220.     new num_rows,num_fields;
  2221.     cache_get_data(num_rows,num_fields,MYSQLConnect);
  2222.     if(!num_rows)return 1;
  2223.     for(new i = 0; i < num_rows; i++)
  2224.     {
  2225.         new rang0[32],rang1[32],rang2[32],rang3[32],rang4[32],rang5[32],rang6[32];
  2226.         fInfo[i][fMats] = cache_get_field_content_int(i,"mats",MYSQLConnect);
  2227.         fInfo[i][fGeld] = cache_get_field_content_int(i,"geld",MYSQLConnect);
  2228.         fInfo[i][fDrogen] = cache_get_field_content_int(i,"drogen",MYSQLConnect);
  2229.         cache_get_field_content(i,"rangname0",rang0,MYSQLConnect);
  2230.         format(fInfo[i][fRangName0],sizeof(rang0),"%s",rang0);
  2231.         cache_get_field_content(i,"rangname1",rang1,MYSQLConnect);
  2232.         format(fInfo[i][fRangName1],sizeof(rang1),"%s",rang1);
  2233.         cache_get_field_content(i,"rangname2",rang2,MYSQLConnect);
  2234.         format(fInfo[i][fRangName2],sizeof(rang2),"%s",rang2);
  2235.         cache_get_field_content(i,"rangname3",rang3,MYSQLConnect);
  2236.         format(fInfo[i][fRangName3],sizeof(rang3),"%s",rang3);
  2237.         cache_get_field_content(i,"rangname4",rang4,MYSQLConnect);
  2238.         format(fInfo[i][fRangName4],sizeof(rang4),"%s",rang4);
  2239.         cache_get_field_content(i,"rangname5",rang5,MYSQLConnect);
  2240.         format(fInfo[i][fRangName5],sizeof(rang5),"%s",rang5);
  2241.         cache_get_field_content(i,"rangname6",rang6,MYSQLConnect);
  2242.         format(fInfo[i][fRangName6],sizeof(rang6),"%s",rang6);
  2243.     }
  2244.     //Fraktionen Waffenlager
  2245.     new wstring[128];
  2246.     CreatePickup(1242,1,1336.0338,48.8502,1001.0156);//Grove Street
  2247.     format(wstring,sizeof(wstring),""#HTML_BLAU"Waffenlager %d von 250\n"#HTML_WHITE"/equip|| Taste: N",fInfo[5][fMats]);//Grove Street
  2248.     fInfo[5][fWLabel] = Create3DTextLabel(wstring,COLOR_WEISS,1336.0338,48.8502,1001.0156,20,0,1);//Grove Street
  2249.     CreatePickup(1242,1,2820.2852,-1173.0509,1025.5703);//Ballas Familie
  2250.     format(wstring,sizeof(wstring),""#HTML_BLAU"Waffenlager %d von 250\n"#HTML_WHITE"/equip|| Taste: N",fInfo[6][fMats]);//Ballas Familie
  2251.     fInfo[6][fWLabel] = Create3DTextLabel(wstring,COLOR_WEISS,2820.2852,-1173.0509,1025.5703,20,0,1);//Ballas Familie
  2252.     CreatePickup(1242,1,-2634.5540,1409.6840,906.4647);//Yakuza
  2253.     format(wstring,sizeof(wstring),""#HTML_BLAU"Waffenlager %d von 250\n"#HTML_WHITE"/equip|| Taste: N",fInfo[7][fMats]);//Yakuza
  2254.     fInfo[7][fWLabel] = Create3DTextLabel(wstring,COLOR_WEISS,-2634.5540,1409.6840,906.4647,20,0,1);//Yakuza
  2255.     CreatePickup(1242,1,1709.5746,-1642.5717,20.2188);//Triaden
  2256.     format(wstring,sizeof(wstring),""#HTML_BLAU"Waffenlager %d von 250\n"#HTML_WHITE"/equip|| Taste: N",fInfo[8][fMats]);//Triaden
  2257.     fInfo[8][fWLabel] = Create3DTextLabel(wstring,COLOR_WEISS,1709.5746,-1642.5717,20.2188,20,0,1);//Triaden
  2258.     CreatePickup(1242,1,2455.6226,-1706.2953,1013.5078);//Los Aztecas
  2259.     format(wstring,sizeof(wstring),""#HTML_BLAU"Waffenlager %d von 250\n"#HTML_WHITE"/equip|| Taste: N",fInfo[9][fMats]);//Los Aztecas
  2260.     fInfo[9][fWLabel] = Create3DTextLabel(wstring,COLOR_WEISS,2455.6226,-1706.2953,1013.5078,20,0,1);//Los Aztecas
  2261.     CreatePickup(1242,1,948.4531,2104.1658,1011.0234);//Hitman
  2262.     format(wstring,sizeof(wstring),""#HTML_BLAU"Waffenlager %d von 250\n"#HTML_WHITE"/equip|| Taste: N",fInfo[10][fMats]);//Hitman
  2263.     fInfo[10][fWLabel] = Create3DTextLabel(wstring,COLOR_WEISS,948.4531,2104.1658,1011.0234,20,0,1);//Hitman
  2264.     return 1;
  2265. }
  2266. public AntiCheat()
  2267. {
  2268.     new string[128];
  2269.     for(new i = 0; i < GetMaxPlayers(); i++)
  2270.     {
  2271.         new weapon = GetPlayerWeapon(i);
  2272.         if(!IsPlayerConnected(i))continue;
  2273.         if(sInfo[i][pEingeloggt] == 0)continue;
  2274.         if(isAdmin(i,1))continue;
  2275.         if(weapon == 16 || weapon == 35 || weapon == 36 || weapon == 37 || weapon == 38 || weapon == 39 || weapon == 40 || weapon == 45)
  2276.         {
  2277.             format(string,sizeof(string),"AdmCmd: %s wurde vom AntiCheat System gebannt. Grund: Waffenhack",SpielerName(i));
  2278.             SendClientMessageToAllEx(COLOR_HELLRED,string);
  2279.             BannEx(i,"Waffenhack","System",-1);
  2280.         }
  2281.         if(GetPlayerSpecialAction(i) == SPECIAL_ACTION_USEJETPACK)
  2282.         {
  2283.             format(string,sizeof(string),"AdmCmd: %s wurde vom AntiCheat System gebannt. Grund: Jetpack",SpielerName(i));
  2284.             SendClientMessageToAllEx(COLOR_HELLRED,string);
  2285.             BannEx(i,"Jetpack","System",-1);
  2286.         }
  2287.     }
  2288.     return 1;
  2289. }
  2290. public UpdateDriveIn(playerid)
  2291. {
  2292.     TogglePlayerControllable(playerid,1);
  2293.     SetPlayerHealth(playerid,100);
  2294.     SendClientMessage(playerid,COLOR_WEISS,"");
  2295.     SendClientMessage(playerid,COLOR_WEISS,"Hier ist Ihre Bestellung.");
  2296.     SendClientMessage(playerid,COLOR_WEISS,"Wir w¸nschen Ihnen noch einen schˆnen Tag.");
  2297.     return 1;
  2298. }
  2299. public SetPlayerConnect(playerid)
  2300. {
  2301.     new hour,minute;
  2302.     gettime(hour,minute);
  2303.     SetPlayerTime(playerid,hour,minute);
  2304.     TogglePlayerSpectating(playerid,1);
  2305.     SpamChat(playerid,0);
  2306.     SendClientMessage(playerid,COLOR_BLAU,"Verbinde mit dem Server.....");
  2307.     TextDrawShowForPlayer(playerid,LR_OBEN);
  2308.     TextDrawShowForPlayer(playerid,LR_UNTEN);
  2309.     new randcam = random(sizeof(ConnectScreen));
  2310.     SetPlayerPos(playerid,ConnectScreen[randcam][9],ConnectScreen[randcam][10],ConnectScreen[randcam][11]);
  2311.     InterpolateCameraPos(playerid, ConnectScreen[randcam][0], ConnectScreen[randcam][1], ConnectScreen[randcam][2], ConnectScreen[randcam][3], ConnectScreen[randcam][4], ConnectScreen[randcam][5], 20000);
  2312.     InterpolateCameraLookAt(playerid, ConnectScreen[randcam][6], ConnectScreen[randcam][7], ConnectScreen[randcam][8], ConnectScreen[randcam][9], ConnectScreen[randcam][10], ConnectScreen[randcam][11], 5000);
  2313.     CheckSpielerBanned(playerid);
  2314.     SetTimerEx("ShowLoginRegister",5000,false,"i",playerid);
  2315.     return 1;
  2316. }
  2317. public ShowLoginRegister(playerid)
  2318. {
  2319.     new query[128];
  2320.     format(query,sizeof(query),"SELECT id FROM accounts WHERE name='%s'",SpielerName(playerid));
  2321.     mysql_function_query(MYSQLConnect,query,true,"OnSpielerCheck","i",playerid);
  2322.     return 1;
  2323. }
  2324. stock isAdmin(playerid,rank)
  2325. {
  2326.     if(sInfo[playerid][pAdmin] >= rank)return 1;
  2327.     return 0;
  2328. }
  2329. stock SendAdminMessage(color,String[])
  2330. {
  2331.     for(new i = 0; i < GetMaxPlayers(); i++)
  2332.     {
  2333.         if(!IsPlayerConnected(i))continue;
  2334.         if(sInfo[i][pEingeloggt] == 0)continue;
  2335.         if(!isAdmin(i,1))continue;
  2336.         SendClientMessage(i,color,String);
  2337.     }
  2338.     return 1;
  2339. }
  2340. stock AdminRang(playerid)
  2341. {
  2342.     new Rangname[64];
  2343.     switch(sInfo[playerid][pAdmin])
  2344.     {
  2345.         case 1:{Rangname = "Supporter";}
  2346.         case 2:{Rangname = "Adminstrator";}
  2347.         case 3:{Rangname = "ServerManager";}
  2348.         case 4:{Rangname = "ServerOwner";}
  2349.     }
  2350.     return Rangname;
  2351. }
  2352. stock isFrakt(playerid,frakid)
  2353. {
  2354.     if(sInfo[playerid][pFraktion] == frakid)return 1;
  2355.     return 0;
  2356. }
  2357. stock SendFrakMessage(frakid,color,String[])
  2358. {
  2359.     for(new i = 0; i < GetMaxPlayers(); i++)
  2360.     {
  2361.         if(!IsPlayerConnected(i))continue;
  2362.         if(sInfo[i][pEingeloggt] == 0)continue;
  2363.         if(!isFrakt(i,frakid))continue;
  2364.         SendClientMessage(i,color,String);
  2365.     }
  2366.     return 1;
  2367. }
  2368. stock FraktionName(fID)
  2369. {
  2370.     new Frakname[64];
  2371.     switch(fID)
  2372.     {
  2373.         case 0:{Frakname = "Zivilist";}
  2374.         case 1:{Frakname = "LSPD";}
  2375.         case 2:{Frakname = "Rettungsdienst";}
  2376.         case 3:{Frakname = "Ordnungsamt";}
  2377.         case 4:{Frakname = "News Reporter";}
  2378.         case 5:{Frakname = "Grove Street";}
  2379.         case 6:{Frakname = "Ballas Familie";}
  2380.         case 7:{Frakname = "Yakuza";}
  2381.         case 8:{Frakname = "Triaden";}
  2382.         case 9:{Frakname = "Los Aztecas";}
  2383.         case 10:{Frakname = "Hitman";}
  2384.     }
  2385.     return Frakname;
  2386. }
  2387. stock SpielerName(playerid)
  2388. {
  2389.     new name[MAX_PLAYER_NAME];
  2390.     GetPlayerName(playerid,name,sizeof(name));
  2391.     return name;
  2392. }
  2393. stock SaveSpieler(playerid)
  2394. {
  2395.     if(sInfo[playerid][pEingeloggt] == 0)return 1;
  2396.     new query[128];
  2397.     format(query,sizeof(query),"UPDATE accounts SET level='%d',geld='%d',fraktion='%d',rang='%d',admin='%d',leader='%d',fskin='%d' WHERE id='%d'",sInfo[playerid][pLevel],GetPlayerMoney(playerid),sInfo[playerid][pFraktion],sInfo[playerid][pRang],sInfo[playerid][pAdmin],sInfo[playerid][pLeader],sInfo[playerid][pFSkin],sInfo[playerid][pDB]);
  2398.     mysql_function_query(MYSQLConnect,query,false,"","");
  2399.     return 1;
  2400. }
  2401. stock ResetSpieler(playerid)
  2402. {
  2403.     for(new i = 0; i < sizeof(sInfo[]); i++)
  2404.     {
  2405.         sInfo[playerid][SpielerDaten:i] = 0;
  2406.     }
  2407.     MarkX[playerid] = -1;
  2408.     MarkY[playerid] = -1;
  2409.     MarkZ[playerid] = -1;
  2410.     MarkInt[playerid] = -1;
  2411.     MarkStatus[playerid] = 0;
  2412.     DestroyVehicle(sInfo[playerid][pSupmobil]);
  2413.     return 1;
  2414. }
  2415. stock SpawnPlayerEx(playerid)
  2416. {
  2417.     if(IsPlayerInAnyVehicle(playerid))RemovePlayerFromVehicle(playerid);
  2418.     ClearAnimations(playerid);
  2419.     SpawnPlayer(playerid);
  2420.     return 1;
  2421. }
  2422. stock FreezeSpieler(playerid)
  2423. {
  2424.     TogglePlayerControllable(playerid,0);
  2425.     return 1;
  2426. }
  2427. stock UnFreezeSpieler(playerid)
  2428. {
  2429.     TogglePlayerControllable(playerid,1);
  2430.     return 1;
  2431. }
  2432. stock KickEx(playerid)
  2433. {
  2434.     SetTimerEx("KickPlayer",1000,false,"i",playerid);
  2435.     return 1;
  2436. }
  2437. stock BannEx(playerid,reason[],admin[],time)
  2438. {
  2439.     new query[128];
  2440.     format(query,sizeof(query),"INSERT INTO accounts_ban (Spieler,Grund,Admin,Zeit) VALUES ('%s','%s','%s','%d')",SpielerName(playerid),reason,admin,time);
  2441.     mysql_function_query(MYSQLConnect,query,false,"","");
  2442.     KickEx(playerid);
  2443.     return 1;
  2444. }
  2445. stock IsNumeric(const string[])
  2446. {
  2447.     for (new i = 0, j = strlen(string); i < j; i++)
  2448.     {
  2449.         if (string[i] > '9' || string[i] < '0') return 0;
  2450.     }
  2451.     return 1;
  2452. }
  2453. stock CheckSpielerBanned(playerid)
  2454. {
  2455.     new query[128];
  2456.     format(query,sizeof(query),"SELECT * FROM accounts_ban WHERE Spieler='%s'",SpielerName(playerid));
  2457.     mysql_function_query(MYSQLConnect,query,true,"OnSpielerBanned","i",playerid);
  2458.     return 1;
  2459. }
  2460. stock CreateFrakVehicle(playerid,frakid,modelid,color1,color2,Float:X,Float:Y,Float:Z,Float:A)
  2461. {
  2462.     new query[256];
  2463.     for(new i = 0; i < MAX_FRAKVEHICLE; i++)
  2464.     {
  2465.         if(fvInfo[i][fvCar] != 0)continue;
  2466.         fvInfo[i][fvfrakid] = frakid;
  2467.         fvInfo[i][fvmodelid] = modelid;
  2468.         fvInfo[i][fvX] = X;
  2469.         fvInfo[i][fvY] = Y;
  2470.         fvInfo[i][fvZ] = Z;
  2471.         fvInfo[i][fvA] = A;
  2472.         fvInfo[i][fvcolor1] = color1;
  2473.         fvInfo[i][fvcolor2] = color2;
  2474.         fvInfo[i][fvCar] = CreateVehicle(modelid,X,Y,Z,A,color1,color2,-1);
  2475.         PutPlayerInVehicle(playerid,fvInfo[i][fvCar],0);
  2476.         fvInfo[i][fvAbgeschlossen] = 1;
  2477.         GetVehicleParamsEx(fvInfo[i][fvCar],engine,lights,alarm,doors,bonnet,boot,objective);
  2478.         SetVehicleParamsEx(fvInfo[i][fvCar],engine,lights,alarm,VEHICLE_PARAMS_ON,bonnet,boot,objective);
  2479.         format(query,sizeof(query),"INSERT INTO frakcars (modelid,frakid,color1,color2,X,Y,Z,A) VALUES ('%d','%d','%d','%d','%f','%f','%f','%f')",modelid,frakid,color1,color2,X,Y,Z,A);
  2480.         mysql_function_query(MYSQLConnect,query,true,"FrakVehicleSaved","i",i);
  2481.         return 1;
  2482.     }
  2483.     return 1;
  2484. }
  2485. stock SaveFrakVehicle(frakID)
  2486. {
  2487.     new query[1000];
  2488.     GetVehiclePos(fvInfo[frakID][fvCar],fvInfo[frakID][fvX],fvInfo[frakID][fvY],fvInfo[frakID][fvZ]);
  2489.     GetVehicleZAngle(fvInfo[frakID][fvCar],fvInfo[frakID][fvA]);
  2490.     format(query,sizeof(query),"UPDATE frakcars SET X='%f',Y='%f',Z='%f',A='%f',spoiler='%d',hood='%d',roof='%d',sideskirt='%d',lamps='%d',nitro='%d',exhaust='%d',wheels='%d',stereo='%d',hydraulics='%d',front='%d',rear='%d',ventright='%d',ventleft='%d' WHERE id='%d'",
  2491.     fvInfo[frakID][fvX],fvInfo[frakID][fvY],fvInfo[frakID][fvZ],fvInfo[frakID][fvA],fvInfo[frakID][fvspoiler],fvInfo[frakID][fvhood],fvInfo[frakID][fvroof],fvInfo[frakID][fvsideskirt],fvInfo[frakID][fvlamps],fvInfo[frakID][fvnitro],fvInfo[frakID][fvexhaust],fvInfo[frakID][fvwheels],fvInfo[frakID][fvstereo],fvInfo[frakID][fvhydraulics],fvInfo[frakID][fvfrontbumper],fvInfo[frakID][fvrearbumper],fvInfo[frakID][fvventright],fvInfo[frakID][fvventleft],fvInfo[frakID][fcID]);
  2492.     mysql_function_query(MYSQLConnect,query,false,"","");
  2493.     return 1;
  2494. }
  2495. stock LoadFrakVehicle()
  2496. {
  2497.     mysql_function_query(MYSQLConnect,"SELECT * FROM frakcars",true,"OnFrakVehicleLoad","");
  2498.     return 1;
  2499. }
  2500. stock FrakVehicleID()
  2501. {
  2502.     for(new i = 0; i < sizeof(fvInfo); i++)
  2503.     {
  2504.         if(fvInfo[i][fvCar] == 0)return i;
  2505.     }
  2506.     return 0;
  2507. }
  2508. stock SendClientMessageToAllEx(color,String[])
  2509. {
  2510.     for(new i = 0; i < GetMaxPlayers(); i++)
  2511.     {
  2512.         if(sInfo[i][pEingeloggt] == 0)continue;
  2513.         SendClientMessageToAll(color,String);
  2514.     }
  2515.     return 1;
  2516. }
  2517. stock SetPlayerMoney(playerid,money)
  2518. {
  2519.     ResetPlayerMoney(playerid);
  2520.     GivePlayerMoney(playerid,money);
  2521.     return 1;
  2522. }
  2523. stock SaveFraktionen(frakID)
  2524. {
  2525.     new query[750];
  2526.     format(query,sizeof(query),"UPDATE fraktionen SET mats='%d',geld='%d',drogen='%d',rangname0='%s',rangname1='%s',rangname2='%s',rangname3='%s',rangname4='%s',rangname5='%s',rangname6='%s' WHERE id='%d'",
  2527.     fInfo[frakID][fMats],fInfo[frakID][fGeld],fInfo[frakID][fDrogen],fInfo[frakID][fRangName0],fInfo[frakID][fRangName1],fInfo[frakID][fRangName2],fInfo[frakID][fRangName3],fInfo[frakID][fRangName4],fInfo[frakID][fRangName5],fInfo[frakID][fRangName6],frakID);
  2528.     mysql_function_query(MYSQLConnect,query,false,"","");
  2529.     return 1;
  2530. }
  2531. stock LoadFraktionen()
  2532. {
  2533.     mysql_function_query(MYSQLConnect,"SELECT * FROM fraktionen",true,"OnFraktionenLoad","");
  2534.     return 1;
  2535. }
  2536. stock IsPlayerInPDFahrzeug(playerid)
  2537. {
  2538.     new vehicleid = GetPlayerVehicleID(playerid);
  2539.     new modelid = GetVehicleModel(vehicleid);
  2540.     if(!IsPlayerInAnyVehicle(playerid))return 0;
  2541.     if(modelid == 596 || modelid == 599 || modelid == 601 || modelid == 528 || modelid == 497 || modelid == 427)
  2542.     {
  2543.         return 1;
  2544.     }
  2545.     return 0;
  2546. }
  2547. stock isPlayerInBadFrak(playerid)
  2548. {
  2549.     if(isFrakt(playerid,5) || isFrakt(playerid,6) || isFrakt(playerid,7) || isFrakt(playerid,8) || isFrakt(playerid,9) || isFrakt(playerid,10))
  2550.     {
  2551.         return 1;
  2552.     }
  2553.     return 0;
  2554. }
  2555. stock fVehTuning(j)
  2556. {
  2557.     fvInfo[j][fvAbgeschlossen] = 1;
  2558.     if(fvInfo[j][fvspoiler] >= 1000) { AddVehicleComponent(fvInfo[j][fvCar],fvInfo[j][fvspoiler]); }
  2559.     if(fvInfo[j][fvhood] >= 1000) { AddVehicleComponent(fvInfo[j][fvCar],fvInfo[j][fvhood]); }
  2560.     if(fvInfo[j][fvroof] >= 1000) { AddVehicleComponent(fvInfo[j][fvCar],fvInfo[j][fvroof]); }
  2561.     if(fvInfo[j][fvsideskirt] >= 1000) { AddVehicleComponent(fvInfo[j][fvCar],fvInfo[j][fvsideskirt]); }
  2562.     if(fvInfo[j][fvlamps] >= 1000) { AddVehicleComponent(fvInfo[j][fvCar],fvInfo[j][fvlamps]); }
  2563.     if(fvInfo[j][fvnitro] >= 1000) { AddVehicleComponent(fvInfo[j][fvCar],fvInfo[j][fvnitro]); }
  2564.     if(fvInfo[j][fvexhaust] >= 1000) { AddVehicleComponent(fvInfo[j][fvCar],fvInfo[j][fvexhaust]); }
  2565.     if(fvInfo[j][fvwheels] >= 1000) { AddVehicleComponent(fvInfo[j][fvCar],fvInfo[j][fvwheels]); }
  2566.     if(fvInfo[j][fvstereo] >= 1000) { AddVehicleComponent(fvInfo[j][fvCar],fvInfo[j][fvstereo]); }
  2567.     if(fvInfo[j][fvhydraulics] >= 1000) { AddVehicleComponent(fvInfo[j][fvCar],fvInfo[j][fvhydraulics]); }
  2568.     if(fvInfo[j][fvfrontbumper] >= 1000) { AddVehicleComponent(fvInfo[j][fvCar],fvInfo[j][fvfrontbumper]); }
  2569.     if(fvInfo[j][fvrearbumper] >= 1000) { AddVehicleComponent(fvInfo[j][fvCar],fvInfo[j][fvrearbumper]); }
  2570.     if(fvInfo[j][fvventright] >= 1000) { AddVehicleComponent(fvInfo[j][fvCar],fvInfo[j][fvventright]); }
  2571.     if(fvInfo[j][fvventleft] >= 1000) { AddVehicleComponent(fvInfo[j][fvCar],fvInfo[j][fvventleft]); }
  2572.     GetVehicleParamsEx(fvInfo[j][fvCar],engine,lights,alarm,doors,bonnet,boot,objective);
  2573.     SetVehicleParamsEx(fvInfo[j][fvCar],engine,lights,alarm,VEHICLE_PARAMS_ON,bonnet,boot,objective);
  2574.     return 1;
  2575. }
  2576. stock AntiDeAMX()
  2577. {
  2578.     new a[][] =
  2579.     {
  2580.         "Unarmed (Fist)",
  2581.         "Brass K"
  2582.     };
  2583.     #pragma unused a
  2584. }
  2585. stock SpielerFrakRang(playerid)
  2586. {
  2587.     new rank[32];
  2588.     if(sInfo[playerid][pRang] == 0)strmid(rank,fInfo[sInfo[playerid][pFraktion]][fRangName0],0,strlen(fInfo[sInfo[playerid][pFraktion]][fRangName0]),sizeof(rank));
  2589.     if(sInfo[playerid][pRang] == 1)strmid(rank,fInfo[sInfo[playerid][pFraktion]][fRangName1],0,strlen(fInfo[sInfo[playerid][pFraktion]][fRangName1]),sizeof(rank));
  2590.     if(sInfo[playerid][pRang] == 2)strmid(rank,fInfo[sInfo[playerid][pFraktion]][fRangName2],0,strlen(fInfo[sInfo[playerid][pFraktion]][fRangName2]),sizeof(rank));
  2591.     if(sInfo[playerid][pRang] == 3)strmid(rank,fInfo[sInfo[playerid][pFraktion]][fRangName3],0,strlen(fInfo[sInfo[playerid][pFraktion]][fRangName3]),sizeof(rank));
  2592.     if(sInfo[playerid][pRang] == 4)strmid(rank,fInfo[sInfo[playerid][pFraktion]][fRangName4],0,strlen(fInfo[sInfo[playerid][pFraktion]][fRangName4]),sizeof(rank));
  2593.     if(sInfo[playerid][pRang] == 5)strmid(rank,fInfo[sInfo[playerid][pFraktion]][fRangName5],0,strlen(fInfo[sInfo[playerid][pFraktion]][fRangName5]),sizeof(rank));
  2594.     if(sInfo[playerid][pRang] == 6)strmid(rank,fInfo[sInfo[playerid][pFraktion]][fRangName6],0,strlen(fInfo[sInfo[playerid][pFraktion]][fRangName6]),sizeof(rank));
  2595.     return rank;
  2596. }
  2597. stock SpamChat(playerid,modus)
  2598. {
  2599.     switch(modus)
  2600.     {
  2601.         case 0:{for(new i = 0; i < 100; i++)SendClientMessage(playerid,COLOR_WEISS," ");}
  2602.         case 1:{for(new i = 0; i < 100; i++)SendClientMessageToAllEx(COLOR_WEISS," ");}
  2603.     }
  2604.     return 1;
  2605. }
  2606. stock ProxerToPlayer(playerid,color,const String[],Float:radius)
  2607. {
  2608.     new Float:X,Float:Y,Float:Z;
  2609.     GetPlayerPos(playerid,X,Y,Z);
  2610.     for(new i = 0; i < GetMaxPlayers(); i++)
  2611.     {
  2612.         if(IsPlayerConnected(i) && sInfo[i][pEingeloggt] == 1)
  2613.         {
  2614.             if(IsPlayerInRangeOfPoint(i,radius,X,Y,Z))
  2615.             {
  2616.                 SendClientMessage(i,color,String);
  2617.             }
  2618.         }
  2619.     }
  2620.     return 1;
  2621. }
  2622. stock sscanf(string[], format[], {Float,_}:...)
  2623. {
  2624.     #if defined isnull
  2625.         if (isnull(string))
  2626.     #else
  2627.         if (string[0] == 0 || (string[0] == 1 && string[1] == 0))
  2628.     #endif
  2629.         {
  2630.             return format[0];
  2631.         }
  2632.     #pragma tabsize 4
  2633.     new
  2634.         formatPos = 0,
  2635.         stringPos = 0,
  2636.         paramPos = 2,
  2637.         paramCount = numargs(),
  2638.         delim = ' ';
  2639.     while (string[stringPos] && string[stringPos] <= ' ')
  2640.     {
  2641.         stringPos++;
  2642.     }
  2643.     while (paramPos < paramCount && string[stringPos])
  2644.     {
  2645.         switch (format[formatPos++])
  2646.         {
  2647.             case '\0':
  2648.             {
  2649.                 return 0;
  2650.             }
  2651.             case 'i', 'd':
  2652.             {
  2653.                 new
  2654.                     neg = 1,
  2655.                     num = 0,
  2656.                     ch = string[stringPos];
  2657.                 if (ch == '-')
  2658.                 {
  2659.                     neg = -1;
  2660.                     ch = string[++stringPos];
  2661.                 }
  2662.                 do
  2663.                 {
  2664.                     stringPos++;
  2665.                     if ('0' <= ch <= '9')
  2666.                     {
  2667.                         num = (num * 10) + (ch - '0');
  2668.                     }
  2669.                     else
  2670.                     {
  2671.                         return -1;
  2672.                     }
  2673.                 }
  2674.                 while ((ch = string[stringPos]) > ' ' && ch != delim);
  2675.                 setarg(paramPos, 0, num * neg);
  2676.             }
  2677.             case 'h', 'x':
  2678.             {
  2679.                 new
  2680.                     num = 0,
  2681.                     ch = string[stringPos];
  2682.                 do
  2683.                 {
  2684.                     stringPos++;
  2685.                     switch (ch)
  2686.                     {
  2687.                         case 'x', 'X':
  2688.                         {
  2689.                             num = 0;
  2690.                             continue;
  2691.                         }
  2692.                         case '0' .. '9':
  2693.                         {
  2694.                             num = (num << 4) | (ch - '0');
  2695.                         }
  2696.                         case 'a' .. 'f':
  2697.                         {
  2698.                             num = (num << 4) | (ch - ('a' - 10));
  2699.                         }
  2700.                         case 'A' .. 'F':
  2701.                         {
  2702.                             num = (num << 4) | (ch - ('A' - 10));
  2703.                         }
  2704.                         default:
  2705.                         {
  2706.                             return -1;
  2707.                         }
  2708.                     }
  2709.                 }
  2710.                 while ((ch = string[stringPos]) > ' ' && ch != delim);
  2711.                 setarg(paramPos, 0, num);
  2712.             }
  2713.             case 'c':
  2714.             {
  2715.                 setarg(paramPos, 0, string[stringPos++]);
  2716.             }
  2717.             case 'f':
  2718.             {
  2719.  
  2720.                 new changestr[16], changepos = 0, strpos = stringPos;
  2721.                 while(changepos < 16 && string[strpos] && string[strpos] != delim)
  2722.                 {
  2723.                     changestr[changepos++] = string[strpos++];
  2724.                     }
  2725.                 changestr[changepos] = '\0';
  2726.                 setarg(paramPos,0,_:floatstr(changestr));
  2727.             }
  2728.             case 'p':
  2729.             {
  2730.                 delim = format[formatPos++];
  2731.                 continue;
  2732.             }
  2733.             case '\'':
  2734.             {
  2735.                 new
  2736.                     end = formatPos - 1,
  2737.                     ch;
  2738.                 while ((ch = format[++end]) && ch != '\'') {}
  2739.                 if (!ch)
  2740.                 {
  2741.                     return -1;
  2742.                 }
  2743.                 format[end] = '\0';
  2744.                 if ((ch = strfind(string, format[formatPos], false, stringPos)) == -1)
  2745.                 {
  2746.                     if (format[end + 1])
  2747.                     {
  2748.                         return -1;
  2749.                     }
  2750.                     return 0;
  2751.                 }
  2752.                 format[end] = '\'';
  2753.                 stringPos = ch + (end - formatPos);
  2754.                 formatPos = end + 1;
  2755.             }
  2756.             case 'u':
  2757.             {
  2758.                 new
  2759.                     end = stringPos - 1,
  2760.                     id = 0,
  2761.                     bool:num = true,
  2762.                     ch;
  2763.                 while ((ch = string[++end]) && ch != delim)
  2764.                 {
  2765.                     if (num)
  2766.                     {
  2767.                         if ('0' <= ch <= '9')
  2768.                         {
  2769.                             id = (id * 10) + (ch - '0');
  2770.                         }
  2771.                         else
  2772.                         {
  2773.                             num = false;
  2774.                         }
  2775.                     }
  2776.                 }
  2777.                 if (num && IsPlayerConnected(id))
  2778.                 {
  2779.                     setarg(paramPos, 0, id);
  2780.                 }
  2781.                 else
  2782.                 {
  2783.                     #if !defined foreach
  2784.                         #define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
  2785.                         #define __SSCANF_FOREACH__
  2786.                     #endif
  2787.                     string[end] = '\0';
  2788.                     num = false;
  2789.                     new
  2790.                         name[MAX_PLAYER_NAME];
  2791.                     id = end - stringPos;
  2792.                     foreach (Player, playerid)
  2793.                     {
  2794.                         GetPlayerName(playerid, name, sizeof (name));
  2795.                         if (!strcmp(name, string[stringPos], true, id))
  2796.                         {
  2797.                             setarg(paramPos, 0, playerid);
  2798.                             num = true;
  2799.                             break;
  2800.                         }
  2801.                     }
  2802.                     if (!num)
  2803.                     {
  2804.                         setarg(paramPos, 0, INVALID_PLAYER_ID);
  2805.                     }
  2806.                     string[end] = ch;
  2807.                     #if defined __SSCANF_FOREACH__
  2808.                         #undef foreach
  2809.                         #undef __SSCANF_FOREACH__
  2810.                     #endif
  2811.                 }
  2812.                 stringPos = end;
  2813.             }
  2814.             case 's', 'z':
  2815.             {
  2816.                 new
  2817.                     i = 0,
  2818.                     ch;
  2819.                 if (format[formatPos])
  2820.                 {
  2821.                     while ((ch = string[stringPos++]) && ch != delim)
  2822.                     {
  2823.                         setarg(paramPos, i++, ch);
  2824.                     }
  2825.                     if (!i)
  2826.                     {
  2827.                         return -1;
  2828.                     }
  2829.                 }
  2830.                 else
  2831.                 {
  2832.                     while ((ch = string[stringPos++]))
  2833.                     {
  2834.                         setarg(paramPos, i++, ch);
  2835.                     }
  2836.                 }
  2837.                 stringPos--;
  2838.                 setarg(paramPos, i, '\0');
  2839.             }
  2840.             default:
  2841.             {
  2842.                 continue;
  2843.             }
  2844.         }
  2845.         while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')
  2846.         {
  2847.             stringPos++;
  2848.         }
  2849.         while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))
  2850.         {
  2851.             stringPos++;
  2852.         }
  2853.         paramPos++;
  2854.     }
  2855.     do
  2856.     {
  2857.         if ((delim = format[formatPos++]) > ' ')
  2858.         {
  2859.             if (delim == '\'')
  2860.             {
  2861.                 while ((delim = format[formatPos++]) && delim != '\'') {}
  2862.             }
  2863.             else if (delim != 'z')
  2864.             {
  2865.                 return delim;
  2866.             }
  2867.         }
  2868.     }
  2869.     while (delim > ' ');
  2870.     return 0;
  2871. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top