Guest User

MichiEXE's NoobScript xD

a guest
Apr 14th, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.87 KB | None | 0 0
  1. #include <a_samp>
  2. #include <ocmd>
  3.  
  4. #define ROT 0xFB1A1AFF
  5.  
  6. main()
  7. {
  8. print("\n----------------------------------");
  9. print(" German Radioactive Reallife v0.1 ");
  10. print("----------------------------------\n");
  11. print("Lade Zeilen-Code aus Script...");
  12. print(" ");
  13. print(" ");
  14. print("Erfolgreich geladen..");
  15. }
  16.  
  17. public OnGameModeInit()
  18. {
  19. SetGameModeText("G R Reallife");
  20. AddPlayerClass(14,1759.2991,-1896.3878,13.5614,271.0562,0,0,0,0,0,0);
  21. AddPlayerClass(15,1759.2991,-1896.3878,13.5614,271.0562,0,0,0,0,0,0);
  22. AddPlayerClass(20,1759.2991,-1896.3878,13.5614,271.0562,0,0,0,0,0,0);
  23. AddPlayerClass(21,1759.2991,-1896.3878,13.5614,271.0562,0,0,0,0,0,0);
  24. AddPlayerClass(22,1759.2991,-1896.3878,13.5614,271.0562,0,0,0,0,0,0);
  25. AddPlayerClass(23,1759.2991,-1896.3878,13.5614,271.0562,0,0,0,0,0,0);
  26. AddPlayerClass(24,1759.2991,-1896.3878,13.5614,271.0562,0,0,0,0,0,0);
  27. AddPlayerClass(25,1759.2991,-1896.3878,13.5614,271.0562,0,0,0,0,0,0);
  28. AddPlayerClass(28,1759.2991,-1896.3878,13.5614,271.0562,0,0,0,0,0,0);
  29. AddPlayerClass(29,1759.2991,-1896.3878,13.5614,271.0562,0,0,0,0,0,0);
  30. AddPlayerClass(40,1759.2991,-1896.3878,13.5614,271.0562,0,0,0,0,0,0);
  31. AddPlayerClass(56,1759.2991,-1896.3878,13.5614,271.0562,0,0,0,0,0,0);
  32. AddPlayerClass(63,1759.2991,-1896.3878,13.5614,271.0562,0,0,0,0,0,0);
  33. return 1;
  34. }
  35.  
  36. public OnGameModeExit()
  37. {
  38. return 1;
  39. }
  40.  
  41. public OnPlayerRequestClass(playerid, classid)
  42. {
  43. SetPlayerPos(playerid,268.2801,-1618.0891,114.4163);
  44. SetPlayerFacingAngle(playerid,319.5098);
  45. SetPlayerCameraPos(playerid,269.8268,-1616.7572,114.4163);
  46. SetPlayerCameraLookAt(playerid,268.2801,-1618.0891,114.4163);
  47. return 1;
  48. }
  49.  
  50. public OnPlayerConnect(playerid)
  51. {
  52. return 1;
  53. }
  54.  
  55. public OnPlayerDisconnect(playerid, reason)
  56. {
  57. return 1;
  58. }
  59.  
  60. public OnPlayerSpawn(playerid)
  61. {
  62. return 1;
  63. }
  64.  
  65. public OnPlayerDeath(playerid, killerid, reason)
  66. {
  67. return 1;
  68. }
  69.  
  70. public OnVehicleSpawn(vehicleid)
  71. {
  72. return 1;
  73. }
  74.  
  75. public OnVehicleDeath(vehicleid, killerid)
  76. {
  77. return 1;
  78. }
  79.  
  80. public OnPlayerText(playerid, text[])
  81. {
  82. return 1;
  83. }
  84.  
  85. ocmd:aduty(playerid, params[])
  86. {
  87. if (IsPlayerAdmin(playerid))
  88. {
  89. SendPlayerMessageToAll(playerid, "ist nun als Level |3| Admin im dienst.");
  90. SendClientMessage(playerid, "Du hast dich als Level |3| Admin im Dienst angemeldet.");
  91. }
  92.  
  93. return 1;
  94. }
  95.  
  96. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  97. {
  98. return 1;
  99. }
  100.  
  101. public OnPlayerExitVehicle(playerid, vehicleid)
  102. {
  103. return 1;
  104. }
  105.  
  106. public OnPlayerStateChange(playerid, newstate, oldstate)
  107. {
  108. return 1;
  109. }
  110.  
  111. public OnPlayerEnterCheckpoint(playerid)
  112. {
  113. return 1;
  114. }
  115.  
  116. public OnPlayerLeaveCheckpoint(playerid)
  117. {
  118. return 1;
  119. }
  120.  
  121. public OnPlayerEnterRaceCheckpoint(playerid)
  122. {
  123. return 1;
  124. }
  125.  
  126. public OnPlayerLeaveRaceCheckpoint(playerid)
  127. {
  128. return 1;
  129. }
  130.  
  131. public OnRconCommand(cmd[])
  132. {
  133. return 1;
  134. }
  135.  
  136. public OnPlayerRequestSpawn(playerid)
  137. {
  138. return 1;
  139. }
  140.  
  141. public OnObjectMoved(objectid)
  142. {
  143. return 1;
  144. }
  145.  
  146. public OnPlayerObjectMoved(playerid, objectid)
  147. {
  148. return 1;
  149. }
  150.  
  151. public OnPlayerPickUpPickup(playerid, pickupid)
  152. {
  153. return 1;
  154. }
  155.  
  156. public OnVehicleMod(playerid, vehicleid, componentid)
  157. {
  158. return 1;
  159. }
  160.  
  161. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  162. {
  163. return 1;
  164. }
  165.  
  166. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  167. {
  168. return 1;
  169. }
  170.  
  171. public OnPlayerSelectedMenuRow(playerid, row)
  172. {
  173. return 1;
  174. }
  175.  
  176. public OnPlayerExitedMenu(playerid)
  177. {
  178. return 1;
  179. }
  180.  
  181. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  182. {
  183. return 1;
  184. }
  185.  
  186. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  187. {
  188. return 1;
  189. }
  190.  
  191. public OnRconLoginAttempt(ip[], password[], success)
  192. {
  193. return 1;
  194. }
  195.  
  196. public OnPlayerUpdate(playerid)
  197. {
  198. return 1;
  199. }
  200.  
  201. public OnPlayerStreamIn(playerid, forplayerid)
  202. {
  203. return 1;
  204. }
  205.  
  206. public OnPlayerStreamOut(playerid, forplayerid)
  207. {
  208. return 1;
  209. }
  210.  
  211. public OnVehicleStreamIn(vehicleid, forplayerid)
  212. {
  213. return 1;
  214. }
  215.  
  216. public OnVehicleStreamOut(vehicleid, forplayerid)
  217. {
  218. return 1;
  219. }
  220.  
  221. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  222. {
  223. return 1;
  224. }
  225.  
  226. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  227. {
  228. return 1;
  229. }
  230.  
  231. /*-------------------------------------------------------------------------------*/
  232. stock sscanf(string[], format[], {Float,_}:...)
  233. {
  234. #if defined isnull
  235. if (isnull(string))
  236. #else
  237. if (string[0] == 0 || (string[0] == 1 && string[1] == 0))
  238. #endif
  239. {
  240. return format[0];
  241. }
  242. #pragma tabsize 4
  243. new
  244. formatPos = 0,
  245. stringPos = 0,
  246. paramPos = 2,
  247. paramCount = numargs(),
  248. delim = ' ';
  249. while (string[stringPos] && string[stringPos] <= ' ')
  250. {
  251. stringPos++;
  252. }
  253. while (paramPos < paramCount && string[stringPos])
  254. {
  255. switch (format[formatPos++])
  256. {
  257. case '\0':
  258. {
  259. return 0;
  260. }
  261. case 'i', 'd':
  262. {
  263. new
  264. neg = 1,
  265. num = 0,
  266. ch = string[stringPos];
  267. if (ch == '-')
  268. {
  269. neg = -1;
  270. ch = string[++stringPos];
  271. }
  272. do
  273. {
  274. stringPos++;
  275. if ('0' <= ch <= '9')
  276. {
  277. num = (num * 10) + (ch - '0');
  278. }
  279. else
  280. {
  281. return -1;
  282. }
  283. }
  284. while ((ch = string[stringPos]) > ' ' && ch != delim);
  285. setarg(paramPos, 0, num * neg);
  286. }
  287. case 'h', 'x':
  288. {
  289. new
  290. num = 0,
  291. ch = string[stringPos];
  292. do
  293. {
  294. stringPos++;
  295. switch (ch)
  296. {
  297. case 'x', 'X':
  298. {
  299. num = 0;
  300. continue;
  301. }
  302. case '0' .. '9':
  303. {
  304. num = (num << 4) | (ch - '0');
  305. }
  306. case 'a' .. 'f':
  307. {
  308. num = (num << 4) | (ch - ('a' - 10));
  309. }
  310. case 'A' .. 'F':
  311. {
  312. num = (num << 4) | (ch - ('A' - 10));
  313. }
  314. default:
  315. {
  316. return -1;
  317. }
  318. }
  319. }
  320. while ((ch = string[stringPos]) > ' ' && ch != delim);
  321. setarg(paramPos, 0, num);
  322. }
  323. case 'c':
  324. {
  325. setarg(paramPos, 0, string[stringPos++]);
  326. }
  327. case 'f':
  328. {
  329.  
  330. new changestr[16], changepos = 0, strpos = stringPos;
  331. while(changepos < 16 && string[strpos] && string[strpos] != delim)
  332. {
  333. changestr[changepos++] = string[strpos++];
  334. }
  335. changestr[changepos] = '\0';
  336. setarg(paramPos,0,_:floatstr(changestr));
  337. }
  338. case 'p':
  339. {
  340. delim = format[formatPos++];
  341. continue;
  342. }
  343. case '\'':
  344. {
  345. new
  346. end = formatPos - 1,
  347. ch;
  348. while ((ch = format[++end]) && ch != '\'') {}
  349. if (!ch)
  350. {
  351. return -1;
  352. }
  353. format[end] = '\0';
  354. if ((ch = strfind(string, format[formatPos], false, stringPos)) == -1)
  355. {
  356. if (format[end + 1])
  357. {
  358. return -1;
  359. }
  360. return 0;
  361. }
  362. format[end] = '\'';
  363. stringPos = ch + (end - formatPos);
  364. formatPos = end + 1;
  365. }
  366. case 'u':
  367. {
  368. new
  369. end = stringPos - 1,
  370. id = 0,
  371. bool:num = true,
  372. ch;
  373. while ((ch = string[++end]) && ch != delim)
  374. {
  375. if (num)
  376. {
  377. if ('0' <= ch <= '9')
  378. {
  379. id = (id * 10) + (ch - '0');
  380. }
  381. else
  382. {
  383. num = false;
  384. }
  385. }
  386. }
  387. if (num && IsPlayerConnected(id))
  388. {
  389. setarg(paramPos, 0, id);
  390. }
  391. else
  392. {
  393. #if !defined foreach
  394. #define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
  395. #define __SSCANF_FOREACH__
  396. #endif
  397. string[end] = '\0';
  398. num = false;
  399. new
  400. name[MAX_PLAYER_NAME];
  401. id = end - stringPos;
  402. foreach (Player, playerid)
  403. {
  404. GetPlayerName(playerid, name, sizeof (name));
  405. if (!strcmp(name, string[stringPos], true, id))
  406. {
  407. setarg(paramPos, 0, playerid);
  408. num = true;
  409. break;
  410. }
  411. }
  412. if (!num)
  413. {
  414. setarg(paramPos, 0, INVALID_PLAYER_ID);
  415. }
  416. string[end] = ch;
  417. #if defined __SSCANF_FOREACH__
  418. #undef foreach
  419. #undef __SSCANF_FOREACH__
  420. #endif
  421. }
  422. stringPos = end;
  423. }
  424. case 's', 'z':
  425. {
  426. new
  427. i = 0,
  428. ch;
  429. if (format[formatPos])
  430. {
  431. while ((ch = string[stringPos++]) && ch != delim)
  432. {
  433. setarg(paramPos, i++, ch);
  434. }
  435. if (!i)
  436. {
  437. return -1;
  438. }
  439. }
  440. else
  441. {
  442. while ((ch = string[stringPos++]))
  443. {
  444. setarg(paramPos, i++, ch);
  445. }
  446. }
  447. stringPos--;
  448. setarg(paramPos, i, '\0');
  449. }
  450. default:
  451. {
  452. continue;
  453. }
  454. }
  455. while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')
  456. {
  457. stringPos++;
  458. }
  459. while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))
  460. {
  461. stringPos++;
  462. }
  463. paramPos++;
  464. }
  465. do
  466. {
  467. if ((delim = format[formatPos++]) > ' ')
  468. {
  469. if (delim == '\'')
  470. {
  471. while ((delim = format[formatPos++]) && delim != '\'') {}
  472. }
  473. else if (delim != 'z')
  474. {
  475. return delim;
  476. }
  477. }
  478. }
  479. while (delim > ' ');
  480. return 0;
  481. }
Advertisement
Add Comment
Please, Sign In to add comment