Guest User

Untitled

a guest
Sep 24th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.15 KB | None | 0 0
  1. #include <YSI\y_ini>
  2. #include <dini>
  3.  
  4. enum spieler_daten
  5. {
  6. Fraktion,
  7. wanted,
  8. skin,
  9. Float:lastx,Float:lasty,Float:lastz,
  10. eingeloggt
  11. }
  12. new Spieler[MAX_PLAYERS][spieler_daten];
  13. new Text:Team;
  14.  
  15. //Fraktionsnamen
  16. #define fraktname1 "LSPD"
  17. #define fraktname2 "Grove Streat"
  18. #define fraktname3 "Medic"
  19.  
  20.  
  21. //farben
  22. #define COL_WHITE "{FFFFFF}"
  23. #define COL_RED "{F81414}"
  24. #define COL_GREEN "{00FF22}"
  25. #define COL_LIGHTBLUE "{00CED1}"
  26. #define COLOR_RED 0xAA3333AA
  27. #define COLOR_LIGHTBLUE 0x00BFFFFF
  28. #define COLOR_NORMAL_PLAYER 0xFFBB7777
  29. #define COLOR_GREY 0xAFAFAFAA
  30. #define COLOR_GREEN 0x33AA33AA
  31. #define COLOR_RED 0xAA3333AA
  32. #define COLOR_YELLOW 0xFFFF00AA
  33. #define COLOR_WHITE 0xFFFFFFAA
  34. #define COLOR_BLUE 0x0000BBAA
  35. #define COLOR_ORANGE 0xFF9900AA
  36. #define COLOR_RED 0xAA3333AA
  37. #define COLOR_LIME 0x10F441AA
  38. #define COLOR_MAGENTA 0xFF00FFFF
  39. #define COLOR_NAVY 0x000080AA
  40. #define COLOR_AQUA 0xF0F8FFAA
  41. #define COLOR_CRIMSON 0xDC143CAA
  42. #define COLOR_FLBLUE 0x6495EDAA
  43. #define COLOR_BISQUE 0xFFE4C4AA
  44. #define COLOR_BLACK 0x000000AA
  45. #define COLOR_CHARTREUSE 0x7FFF00AA
  46. #define COLOR_BROWN 0XA52A2AAA
  47. #define COLOR_CORAL 0xFF7F50AA
  48. #define COLOR_GOLD 0xB8860BAA
  49. #define COLOR_GREENYELLOW 0xADFF2FAA
  50. #define COLOR_INDIGO 0x4B00B0AA
  51. #define COLOR_IVORY 0xFFFF82AA
  52. #define COLOR_LAWNGREEN 0x7CFC00AA
  53. #define COLOR_SEAGREEN 0x20B2AAAA
  54. #define COLOR_LIMEGREEN 0x32CD32AA
  55. #define COLOR_MIDNIGHTBLUE 0X191970AA
  56. #define COLOR_MAROON 0x800000AA
  57. #define COLOR_OLIVE 0x808000AA
  58. #define COLOR_ORANGERED 0xFF4500AA
  59. #define COLOR_PINK 0xFFC0CBAA
  60. #define COLOR_SPRINGGREEN 0x00FF7FAA
  61. #define COLOR_TOMATO 0xFF6347AA
  62. #define COLOR_YELLOWGREEN 0x9ACD32AA
  63. #define COLOR_MEDIUMAQUA 0x83BFBFAA
  64. #define COLOR_MEDIUMMAGENTA 0x8B008BAA
  65. #define DIALOG_LOGIN 3
  66. #define DIALOG_REG 4
  67.  
  68. main()
  69. {
  70. print("\n----------------------------------");
  71. print(" by XtreamRealLife" );
  72. print("----------------------------------\n");
  73. }
  74.  
  75. public OnGameModeInit()
  76. {
  77. SetGameModeText("Blank Script");
  78. AddPlayerClass(10, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  79. AddPlayerClass(101, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  80. AddPlayerClass(12, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  81. AddPlayerClass(13, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  82. AddPlayerClass(136, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  83. AddPlayerClass(14, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  84. AddPlayerClass(142, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  85. AddPlayerClass(143, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  86. AddPlayerClass(144, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  87. AddPlayerClass(15, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  88. AddPlayerClass(151, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  89. AddPlayerClass(156, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  90. AddPlayerClass(168, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  91. AddPlayerClass(169, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  92. AddPlayerClass(17, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  93. AddPlayerClass(170, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  94. AddPlayerClass(180, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  95. AddPlayerClass(182, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  96. AddPlayerClass(54, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  97. AddPlayerClass(183, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  98. AddPlayerClass(184, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  99. AddPlayerClass(263, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  100. AddPlayerClass(75, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  101. AddPlayerClass(185, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  102. AddPlayerClass(188, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  103. AddPlayerClass(19, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  104. AddPlayerClass(216, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  105. AddPlayerClass(20, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  106. AddPlayerClass(10, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  107. AddPlayerClass(10, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  108. Team = TextDrawCreate(4.0,428.0,"XtreamRealLife wuennscht dir viel spass!");
  109. TextDrawFont(Team,2);
  110. TextDrawLetterSize(Team,0.2,1.5);
  111. TextDrawColor(Team,0xFEFEFEFF);
  112. TextDrawSetProportional(Team,1);
  113. TextDrawSetShadow(Team,1);
  114. return 1;
  115. }
  116.  
  117. public OnGameModeExit()
  118. {
  119. return 1;
  120. }
  121.  
  122. public OnPlayerRequestClass(playerid, classid)
  123. {
  124. return 1;
  125. }
  126.  
  127. public OnPlayerConnect(playerid)
  128. {
  129. new pname[MAX_PLAYERS],accFormat[128];
  130. GetPlayerName(playerid,pname,sizeof pname);
  131. format(accFormat,sizeof accFormat,"%s.datei",pname);
  132. if(fexist(accFormat))
  133. {
  134. ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Weiter","Abbrechen");
  135. }
  136. else
  137. {
  138. ShowPlayerDialog(playerid,DIALOG_REG,1,"Registrieren","Bitte Registriere dich","Weiter","Abbrechen");
  139. }
  140. TextDrawShowForPlayer(playerid,Team);
  141. return 1;
  142. }
  143.  
  144. public OnPlayerDisconnect(playerid, reason)
  145. {
  146. new pname[MAX_PLAYERS],accFormat[128];
  147. GetPlayerName(playerid,pname,sizeof pname);
  148. format(accFormat,sizeof accFormat,"%s.datei",pname);
  149. if(fexist(accFormat) && Spieler[playerid][eingeloggt])
  150. {
  151. dini_IntSet(accFormat,"wanted",Spieler[playerid][wanted]);
  152. dini_IntSet(accFormat,"Fraktion",Spieler[playerid][Fraktion]);
  153. dini_IntSet(accFormat,"skin",Spieler[playerid][skin]);
  154. dini_FloatSet(accFormat,"lastx",Spieler[playerid][lastx]);
  155. dini_FloatSet(accFormat,"lasty",Spieler[playerid][lasty]);
  156. dini_FloatSet(accFormat,"lastz",Spieler[playerid][lastz]);
  157. }
  158. Spieler[playerid][eingeloggt] = 0;
  159. Spieler[playerid][wanted] = 0;
  160. Spieler[playerid][skin] = 0;
  161. Spieler[playerid][lastx] = (0.0);
  162. Spieler[playerid][lasty] = (0.0);
  163. Spieler[playerid][lastz] = (0.0);
  164. Spieler[playerid][Fraktion] = 0;
  165. return 1;
  166. }
  167.  
  168. public OnPlayerSpawn(playerid)
  169. {
  170. new pname[MAX_PLAYERS],accFormat[128];
  171. GetPlayerName(playerid,pname,sizeof pname);
  172. format(accFormat,sizeof accFormat,"%s.datei",pname);
  173. if(dini_Isset(accFormat,"lastx"))
  174. {
  175. SetPlayerPos(playerid,Spieler[playerid][lastx],Spieler[playerid][lasty],Spieler[playerid][lastz]);
  176. }
  177. return 1;
  178. }
  179.  
  180. public OnPlayerDeath(playerid, killerid, reason)
  181. {
  182. return 1;
  183. }
  184.  
  185. public OnVehicleSpawn(vehicleid)
  186. {
  187. return 1;
  188. }
  189.  
  190. public OnVehicleDeath(vehicleid, killerid)
  191. {
  192. return 1;
  193. }
  194.  
  195. public OnPlayerText(playerid, text[])
  196. {
  197. return 1;
  198. }
  199.  
  200. public OnPlayerCommandText(playerid, cmdtext[])
  201. {
  202. if(IsPlayerAdmin(playerid))
  203. {
  204. if (strcmp("/godmode", cmdtext, true, 10) == 0)
  205. {
  206. SetPlayerHealth(playerid, 10000000);
  207. return 1;
  208. }
  209. }
  210. if (strcmp("/godmode", cmdtext, true, 10) == 0)
  211. {
  212. SendClientMessage(playerid,COLOR_GREEN,"Du bist kein Admin!");
  213. }
  214. if (strcmp("/test", cmdtext, true, 10) == 0)
  215. {
  216. if(isPlayerInFrakt(playerid,1))
  217. SendClientMessage(playerid,COLOR_GREEN,"Erfolgreich");
  218. else
  219. SendClientMessage(playerid,COLOR_RED,"Du gehörst nicht zum LSPD");
  220. }
  221. return 0;
  222. }
  223.  
  224. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  225. {
  226. return 1;
  227. }
  228.  
  229. public OnPlayerExitVehicle(playerid, vehicleid)
  230. {
  231. return 1;
  232. }
  233.  
  234. public OnPlayerStateChange(playerid, newstate, oldstate)
  235. {
  236. return 1;
  237. }
  238.  
  239. public OnPlayerEnterCheckpoint(playerid)
  240. {
  241. return 1;
  242. }
  243.  
  244. public OnPlayerLeaveCheckpoint(playerid)
  245. {
  246. return 1;
  247. }
  248.  
  249. public OnPlayerEnterRaceCheckpoint(playerid)
  250. {
  251. return 1;
  252. }
  253.  
  254. public OnPlayerLeaveRaceCheckpoint(playerid)
  255. {
  256. return 1;
  257. }
  258.  
  259. public OnRconCommand(cmd[])
  260. {
  261. return 1;
  262. }
  263.  
  264. public OnPlayerRequestSpawn(playerid)
  265. {
  266. return 1;
  267. }
  268.  
  269. public OnObjectMoved(objectid)
  270. {
  271. return 1;
  272. }
  273.  
  274. public OnPlayerObjectMoved(playerid, objectid)
  275. {
  276. return 1;
  277. }
  278.  
  279. public OnPlayerPickUpPickup(playerid, pickupid)
  280. {
  281. return 1;
  282. }
  283.  
  284. public OnVehicleMod(playerid, vehicleid, componentid)
  285. {
  286. return 1;
  287. }
  288.  
  289. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  290. {
  291. return 1;
  292. }
  293.  
  294. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  295. {
  296. return 1;
  297. }
  298.  
  299. public OnPlayerSelectedMenuRow(playerid, row)
  300. {
  301. return 1;
  302. }
  303.  
  304. public OnPlayerExitedMenu(playerid)
  305. {
  306. return 1;
  307. }
  308.  
  309. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  310. {
  311. return 1;
  312. }
  313.  
  314. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  315. {
  316. return 1;
  317. }
  318.  
  319. public OnRconLoginAttempt(ip[], password[], success)
  320. {
  321. return 1;
  322. }
  323.  
  324. public OnPlayerUpdate(playerid)
  325. {
  326. return 1;
  327. }
  328.  
  329. public OnPlayerStreamIn(playerid, forplayerid)
  330. {
  331. return 1;
  332. }
  333.  
  334. public OnPlayerStreamOut(playerid, forplayerid)
  335. {
  336. return 1;
  337. }
  338.  
  339. public OnVehicleStreamIn(vehicleid, forplayerid)
  340. {
  341. return 1;
  342. }
  343.  
  344. public OnVehicleStreamOut(vehicleid, forplayerid)
  345. {
  346. return 1;
  347. }
  348.  
  349. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  350. {
  351. new pname[MAX_PLAYERS],accFormat[128];
  352. GetPlayerName(playerid,pname,sizeof pname);
  353. format(accFormat,sizeof accFormat,"%s.datei",pname);
  354. if(response)
  355. {
  356. switch(dialogid)
  357. {
  358. case DIALOG_LOGIN:
  359. {
  360. if(!strlen(inputtext))
  361. {
  362. ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Abbrechen","Weiter");
  363. return SendClientMessage(playerid,0xFFFFFFFF,"Kein Passwort angegeben!");
  364. }
  365. if(strcmp(inputtext,dini_Get(accFormat,"Passwort")) == 0)
  366. {
  367. Spieler[playerid][wanted] = dini_Int(accFormat,"wanted");
  368. Spieler[playerid][Fraktion] = dini_Int(accFormat,"Fraktion");
  369. Spieler[playerid][skin] = dini_Int(accFormat,"skin");
  370. Spieler[playerid][lastx] = dini_Float(accFormat,"lastx");
  371. Spieler[playerid][lasty] = dini_Float(accFormat,"lasty");
  372. Spieler[playerid][lastz] = dini_Float(accFormat,"lastz");
  373. Spieler[playerid][eingeloggt] = 1;
  374. SendClientMessage(playerid,0xFFFFFFFF,"Du wurdest erfolgreich eingeloggt.");
  375. }
  376. else
  377. {
  378. ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Weiter","Abbrechen");
  379. SendClientMessage(playerid,0xFFFFFFFF,"Das Passwort war Falsch!");
  380. }
  381. }
  382. case DIALOG_REG:
  383. {
  384. if(!strlen(inputtext))
  385. {
  386. ShowPlayerDialog(playerid,DIALOG_REG,1,"Registrieren","Bitte Registriere dich","Weiter","Abbrechen");
  387. return SendClientMessage(playerid,0xFFFFFFFF,"Das Passwort ist zu kurz!");
  388. }
  389. dini_Create(accFormat);
  390. dini_Set(accFormat,"Passwort",inputtext);
  391. Spieler[playerid][eingeloggt] = 1;
  392. SendClientMessage(playerid,0xFFFFFFFF,"Account wurde angelegt und du wurdest eingeloggt.");
  393. }
  394. }
  395. }
  396. else
  397. {
  398. switch(dialogid)
  399. {
  400. case DIALOG_LOGIN:ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Abbrechen","Weiter");
  401. case DIALOG_REG:ShowPlayerDialog(playerid,DIALOG_REG,1,"Registrieren","Bitte Registriere dich","Abbrechen","Weiter");
  402. }
  403. }
  404. return 1;
  405. }
  406.  
  407. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  408. {
  409. return 1;
  410. }
  411. stock isPlayerInFrakt(playerid,fraktid)
  412. {
  413. if(GetPVarInt(playerid,"Fraktion")==fraktid)return 1;
  414. return 0;
  415. }
Add Comment
Please, Sign In to add comment