Advertisement
Guest User

Untitled

a guest
May 12th, 2009
616
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.80 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3.  
  4. //Don't Steal.
  5. #define FILTERSCRIPT
  6. forward IsAtClothShop(playerid);
  7. forward IsAtGasStation(playerid);
  8. forward IsAtBar(playerid);
  9. forward IsAtBank(playerid);
  10. forward IsAtCash(playerid);
  11. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  12. forward rob(id);
  13. forward split(const strsrc[], strdest[][], delimiter);
  14.  
  15. forward re(index);
  16. forward IsACop(playerid);
  17. forward GetCops();
  18. forward ruf(str[], id);
  19. forward Wait(time);
  20. forward zu(id);
  21. forward SetAmm(bizzid,summant);
  22.  
  23. new gbl_robber_status[MAX_PLAYERS];
  24. new gbl_L[7200];
  25. new Float:gbl_LX[7200];
  26. new Float:gbl_LY[7200];
  27. new Float:gbl_LZ[7200];
  28. new cops[200];
  29. new cops_on;
  30. //zur�cktimer
  31. new amm_arr[MAX_PLAYERS];
  32. new b_arr[MAX_PLAYERS];
  33. new ungueltig[MAX_PLAYERS];
  34.  
  35.  
  36. public split(const strsrc[], strdest[][], delimiter)
  37. {
  38.  
  39. new i, li;
  40. new aNum;
  41. new len;
  42. while(i <= strlen(strsrc)){
  43. if(strsrc[i]==delimiter || i==strlen(strsrc)){
  44. len = strmid(strdest[aNum], strsrc, li, i, 128);
  45. strdest[aNum][len] = 0;
  46. li = i+1;
  47. aNum++;
  48. }
  49. i++;
  50. }
  51. return 1;
  52. }
  53.  
  54. public Wait(time)
  55. {
  56. new stamp = tickcount();
  57. while (tickcount() - stamp < time){}
  58. return 1;
  59. }
  60.  
  61. stock ini_GetKey( line[] )
  62. {
  63. new keyRes[256];
  64. keyRes[0] = 0;
  65. if ( strfind( line , "=" , true ) == -1 ) return keyRes;
  66. strmid( keyRes , line , 0 , strfind( line , "=" , true ) , sizeof( keyRes) );
  67. return keyRes;
  68. }
  69.  
  70. stock ini_GetValue( line[] )
  71. {
  72. new valRes[256];
  73. valRes[0]=0;
  74. if ( strfind( line , "=" , true ) == -1 ) return valRes;
  75. strmid( valRes , line , strfind( line , "=" , true )+1 , strlen( line ) , sizeof( valRes ) );
  76. return valRes;
  77. }
  78.  
  79. public ruf(str[], id){
  80. new Float:x, Float:y, Float:z;
  81. for(new i=0;i<MAX_PLAYERS;i++){
  82. if(cops[i] == 1){
  83. GameTextForPlayer(i,str,5000, 1);
  84. GetPlayerPos(id, x, y, z);
  85. if(IsAtBank(id)==20000){
  86. if(GetPlayerVirtualWorld(id) == 2){
  87. SetPlayerCheckpoint(i, -1783.8413,572.3282,35.1641, 1);
  88. }else{
  89. SetPlayerCheckpoint(i, 2375.456298, 2307.444335, 8.140600, 1);
  90. }
  91. }else if(IsAtGasStation(id) >= 2000){
  92. SetPlayerCheckpoint(i, x, y, z, 1);
  93. } else {
  94.  
  95. }
  96. }
  97. }
  98. return true;
  99. }
  100.  
  101. public zu(id){
  102. if(ungueltig[id]==0){
  103. amm_arr[id] = 0;
  104. b_arr[id] = 0;
  105. }else{
  106. ungueltig[id]=0;
  107. }
  108. return true;
  109. }
  110.  
  111. public GetCops(){
  112. cops_on = 0;
  113. for(new i=0;i<MAX_PLAYERS;i++){
  114. if(IsPlayerConnected(i))
  115. {
  116. if(IsACop(i)){
  117. cops[i] = 1;
  118. cops_on++;
  119. }else{
  120. cops[i] = 0;
  121. }
  122.  
  123. }
  124.  
  125. }
  126. }
  127.  
  128. public IsACop(playerid)
  129. {
  130.  
  131. if(IsPlayerConnected(playerid))
  132. {
  133. new mem, lea;
  134. new string2[64];
  135. new playername2[MAX_PLAYER_NAME];
  136. GetPlayerName(playerid, playername2, sizeof(playername2));
  137. format(string2, sizeof(string2), "%s.ini", playername2);
  138. new File: UserFile = fopen(string2, io_read);
  139. if ( UserFile )
  140. {
  141. new key[ 256 ] , val[ 256 ];
  142. new Data[ 256 ];
  143. while ( fread( UserFile , Data , sizeof( Data ) ) )
  144. {
  145. key = ini_GetKey( Data );
  146.  
  147. if( strcmp( key , "Leader" , true ) == 0 ) { val = ini_GetValue( Data ); lea = strval( val ); }
  148. if( strcmp( key , "Member" , true ) == 0 ) { val = ini_GetValue( Data ); mem = strval( val ); }
  149.  
  150. }//end while
  151. fclose(UserFile);//close the file after everything has been read in the while
  152.  
  153.  
  154. }
  155. if(( (mem > 0) && (mem < 4) || mem==15 )||( (lea > 0) && (lea < 4) ) || lea==15) { return 1;}
  156. else { return 0;}
  157. }else{
  158. return 0;
  159. }
  160. }
  161.  
  162.  
  163. public re(index){
  164. gbl_L[index] = 0;
  165. gbl_LX[index] = 0.0000;
  166. gbl_LY[index] = 0.0000;
  167. gbl_LZ[index] = 0.0000;
  168. return 0;
  169. }
  170.  
  171.  
  172. public rob(id){
  173.  
  174.  
  175. new string[256];
  176.  
  177. if(IsAtGasStation(id) >= 1000)
  178. {
  179. TogglePlayerControllable(id, 1);
  180. ClearAnimations(id);
  181. GivePlayerMoney(id, IsAtGasStation(id));
  182. format(string, sizeof(string), "Du hast %i$ erbaeutet!", IsAtGasStation(id));
  183. GameTextForPlayer(id,string,5000,3);
  184. amm_arr[id] = IsAtGasStation(id);
  185. b_arr[id] = 2;
  186. SetAmm(203,(-1)*IsAtGasStation(id));
  187. SetTimerEx("zu", 5*60000, false, "i", id);
  188.  
  189.  
  190. }
  191. else if(IsAtBar(id) >= 100)
  192. {
  193. TogglePlayerControllable(id, 1);
  194. ClearAnimations(id);
  195. GivePlayerMoney(id, IsAtBar(id));
  196. format(string, sizeof(string), "Du hast %i$ erbaeutet!", IsAtBar(id));
  197. GameTextForPlayer(id,string,5000,3);
  198. amm_arr[id] = IsAtBar(id);
  199. SetTimerEx("zu", 5*60000, false, "i", id);
  200. }
  201. else if(IsAtClothShop(id) >= 750)
  202. {
  203. TogglePlayerControllable(id, 1);
  204. ClearAnimations(id);
  205. GivePlayerMoney(id, IsAtClothShop(id));
  206. format(string, sizeof(string), "Du hast %i$ erbaeutet!", IsAtClothShop(id));
  207. GameTextForPlayer(id,string,5000,3);
  208. amm_arr[id] = IsAtClothShop(id);
  209. SetTimerEx("zu", 5*60000, false, "i", id);
  210.  
  211. }
  212. else if(IsAtCash(id) >= 2000)
  213. {
  214. TogglePlayerControllable(id, 1);
  215. ClearAnimations(id);
  216. GivePlayerMoney(id, IsAtCash(id));
  217. format(string, sizeof(string), "Du hast %i$ erbaeutet!", IsAtCash(id));
  218. GameTextForPlayer(id,string,5000,3);
  219. amm_arr[id] = IsAtCash(id);
  220. SetTimerEx("zu", 5*60000, false, "i", id);
  221.  
  222. }
  223. else if(IsAtBank(id) == 20000)
  224. {
  225. ClearAnimations(id);
  226. GivePlayerMoney(id, IsAtBank(id));
  227. format(string, sizeof(string), "Du hast %i$ erbaeutet!", IsAtBank(id));
  228. GameTextForPlayer(id,string,5000,3);
  229. amm_arr[id] = IsAtBank(id);
  230. b_arr[id] = 1;
  231. SetAmm(4,(-1)*IsAtBank(id));
  232. SetTimerEx("zu", 5*60000, false, "i", id);
  233.  
  234. }else{}
  235.  
  236. gbl_robber_status[id] = 0;
  237. new Float:X, Float:Z, Float:Y,index;
  238. GetPlayerPos(id, X, Y, Z);
  239.  
  240. for(new o=0; o<7200;o++){
  241. if(gbl_L[o] == 0){
  242. gbl_L[o] = GetPlayerVirtualWorld(id)+1;
  243. gbl_LX[o] = X;
  244. gbl_LY[o] = Y;
  245. gbl_LZ[o] = Z;
  246. index = o;
  247. o=7200;
  248. }
  249. }
  250.  
  251. SetTimerEx("re", 3600000, false,"i",index);
  252. return 0;
  253. }
  254.  
  255.  
  256.  
  257. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  258. {
  259. if(IsPlayerConnected(playerid))
  260. {
  261. new Float:oldposx, Float:oldposy, Float:oldposz;
  262. new Float:tempposx, Float:tempposy, Float:tempposz;
  263. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  264. tempposx = (oldposx -x);
  265. tempposy = (oldposy -y);
  266. tempposz = (oldposz -z);
  267. //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  268. if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  269. {
  270. return 1;
  271. }
  272. }
  273. return 0;
  274. }
  275.  
  276.  
  277. enum bInfo
  278. {
  279. bOwned,
  280. bOwner[64],
  281. bMessage[128],
  282. bExtortion[MAX_PLAYER_NAME],
  283. Float:bEntranceX,
  284. Float:bEntranceY,
  285. Float:bEntranceZ,
  286. Float:bExitX,
  287. Float:bExitY,
  288. Float:bExitZ,
  289. bLevelNeeded,
  290. bBuyPrice,
  291. bEntranceCost,
  292. bTill,
  293. bLocked,
  294. bInterior,
  295. bProducts,
  296. bMaxProducts,
  297. bPriceProd,
  298. };
  299.  
  300. public SetAmm(bizzid,summant){
  301. new filen[256];
  302. new arrCoords[19][64];
  303. new strFromFile2[256];
  304. if(bizzid>200){
  305. filen="sbizz.cfg";
  306. bizzid=bizzid-200;
  307. new sBizzInfo[12][bInfo];
  308.  
  309. new File: file = fopen(filen, io_readwrite);
  310. if (file)
  311. {
  312. new idx;
  313. while (idx < sizeof(sBizzInfo))
  314. {
  315. if(idx==bizzid){
  316. fread(file, strFromFile2);
  317. split(strFromFile2, arrCoords, '|');
  318. sBizzInfo[idx][bOwned] = strval(arrCoords[0]);
  319. strmid(sBizzInfo[idx][bOwner], arrCoords[1], 0, strlen(arrCoords[1]), 255);
  320. strmid(sBizzInfo[idx][bMessage], arrCoords[2], 0, strlen(arrCoords[2]), 255);
  321. strmid(sBizzInfo[idx][bExtortion], arrCoords[3], 0, strlen(arrCoords[3]), 255);
  322. sBizzInfo[idx][bEntranceX] = floatstr(arrCoords[4]);
  323. sBizzInfo[idx][bEntranceY] = floatstr(arrCoords[5]);
  324. sBizzInfo[idx][bEntranceZ] = floatstr(arrCoords[6]);
  325. sBizzInfo[idx][bExitX] = floatstr(arrCoords[7]);
  326. sBizzInfo[idx][bExitY] = floatstr(arrCoords[8]);
  327. sBizzInfo[idx][bExitZ] = floatstr(arrCoords[9]);
  328. sBizzInfo[idx][bLevelNeeded] = strval(arrCoords[10]);
  329. sBizzInfo[idx][bBuyPrice] = strval(arrCoords[11]);
  330. sBizzInfo[idx][bEntranceCost] = strval(arrCoords[12]);
  331. sBizzInfo[idx][bTill] = strval(arrCoords[13]);
  332. sBizzInfo[idx][bLocked] = strval(arrCoords[14]);
  333. sBizzInfo[idx][bInterior] = strval(arrCoords[15]);
  334. sBizzInfo[idx][bProducts] = strval(arrCoords[16]);
  335. sBizzInfo[idx][bMaxProducts] = strval(arrCoords[17]);
  336. sBizzInfo[idx][bPriceProd] = strval(arrCoords[18]);
  337. new coordsstring[256];
  338. format(coordsstring, sizeof(coordsstring), "%d|%s|%s|%s|%f|%f|%f|%f|%f|%f|%d|%d|%d|%d|%d|%d|%d|%d|%d\n",
  339. sBizzInfo[idx][bOwned],
  340. sBizzInfo[idx][bOwner],
  341. sBizzInfo[idx][bMessage],
  342. sBizzInfo[idx][bExtortion],
  343. sBizzInfo[idx][bEntranceX],
  344. sBizzInfo[idx][bEntranceY],
  345. sBizzInfo[idx][bEntranceZ],
  346. sBizzInfo[idx][bExitX],
  347. sBizzInfo[idx][bExitY],
  348. sBizzInfo[idx][bExitZ],
  349. sBizzInfo[idx][bLevelNeeded],
  350. sBizzInfo[idx][bBuyPrice],
  351. sBizzInfo[idx][bEntranceCost],
  352. sBizzInfo[idx][bTill]+summant,
  353. sBizzInfo[idx][bLocked],
  354. sBizzInfo[idx][bInterior],
  355. sBizzInfo[idx][bProducts],
  356. sBizzInfo[idx][bMaxProducts],
  357. sBizzInfo[idx][bPriceProd]);
  358. fwrite(file, coordsstring);
  359. }
  360. idx++;
  361. }
  362. fclose(file);
  363. }
  364. }else{
  365. filen="bizz.cfg";
  366. new BizzInfo[6][bInfo];
  367. new File: file = fopen(filen, io_readwrite);
  368. if (file)
  369. {
  370. new idx;
  371. while (idx < sizeof(BizzInfo))
  372. {
  373. if(idx==bizzid){
  374. fread(file, strFromFile2);
  375. split(strFromFile2, arrCoords, '|');
  376. BizzInfo[idx][bOwned] = strval(arrCoords[0]);
  377. strmid(BizzInfo[idx][bOwner], arrCoords[1], 0, strlen(arrCoords[1]), 255);
  378. strmid(BizzInfo[idx][bMessage], arrCoords[2], 0, strlen(arrCoords[2]), 255);
  379. strmid(BizzInfo[idx][bExtortion], arrCoords[3], 0, strlen(arrCoords[3]), 255);
  380. BizzInfo[idx][bEntranceX] = floatstr(arrCoords[4]);
  381. BizzInfo[idx][bEntranceY] = floatstr(arrCoords[5]);
  382. BizzInfo[idx][bEntranceZ] = floatstr(arrCoords[6]);
  383. BizzInfo[idx][bExitX] = floatstr(arrCoords[7]);
  384. BizzInfo[idx][bExitY] = floatstr(arrCoords[8]);
  385. BizzInfo[idx][bExitZ] = floatstr(arrCoords[9]);
  386. BizzInfo[idx][bLevelNeeded] = strval(arrCoords[10]);
  387. BizzInfo[idx][bBuyPrice] = strval(arrCoords[11]);
  388. BizzInfo[idx][bEntranceCost] = strval(arrCoords[12]);
  389. BizzInfo[idx][bTill] = strval(arrCoords[13]);
  390. BizzInfo[idx][bLocked] = strval(arrCoords[14]);
  391. BizzInfo[idx][bInterior] = strval(arrCoords[15]);
  392. BizzInfo[idx][bProducts] = strval(arrCoords[16]);
  393. BizzInfo[idx][bMaxProducts] = strval(arrCoords[17]);
  394. BizzInfo[idx][bPriceProd] = strval(arrCoords[18]);
  395. new coordsstring[256];
  396. format(coordsstring, sizeof(coordsstring), "%d|%s|%s|%s|%f|%f|%f|%f|%f|%f|%d|%d|%d|%d|%d|%d|%d|%d|%d\n",
  397. BizzInfo[idx][bOwned],
  398. BizzInfo[idx][bOwner],
  399. BizzInfo[idx][bMessage],
  400. BizzInfo[idx][bExtortion],
  401. BizzInfo[idx][bEntranceX],
  402. BizzInfo[idx][bEntranceY],
  403. BizzInfo[idx][bEntranceZ],
  404. BizzInfo[idx][bExitX],
  405. BizzInfo[idx][bExitY],
  406. BizzInfo[idx][bExitZ],
  407. BizzInfo[idx][bLevelNeeded],
  408. BizzInfo[idx][bBuyPrice],
  409. BizzInfo[idx][bEntranceCost],
  410. BizzInfo[idx][bTill]+summant,
  411. BizzInfo[idx][bLocked],
  412. BizzInfo[idx][bInterior],
  413. BizzInfo[idx][bProducts],
  414. BizzInfo[idx][bMaxProducts],
  415. BizzInfo[idx][bPriceProd]);
  416. fwrite(file, coordsstring);
  417. }
  418. idx++;
  419. }
  420. fclose(file);
  421. }
  422. }
  423. return true;
  424. }
  425.  
  426.  
  427. public IsAtBar(playerid)
  428. {
  429. if(IsPlayerConnected(playerid))
  430. {
  431. if(PlayerToPoint(4.0,playerid,495.7801,-76.0305,998.7578) || PlayerToPoint(4.0,playerid,499.9654,-20.2515,1000.6797))
  432. {//In grove street bar (with girlfriend), and in Havanna
  433. return 500;
  434. }
  435. else if(PlayerToPoint(4.0,playerid,1215.9480,-13.3519,1000.9219) || PlayerToPoint(10.0,playerid,-2658.9749,1407.4136,906.2734))
  436. {//PIG Pen
  437. return 1000;
  438. }
  439. }
  440. return 0;
  441. }
  442.  
  443. public IsAtBank(playerid)
  444. {
  445. if(IsPlayerConnected(playerid))
  446. {
  447. if(PlayerToPoint(4.0,playerid,2305.688964,-16.088100,26.749599))
  448. {
  449. return 20000;
  450. }
  451. }
  452. return 0;
  453. }
  454.  
  455. public IsAtCash(playerid)
  456. {
  457. if(IsPlayerConnected(playerid))
  458. {
  459. if(PlayerToPoint(1.0,playerid,1193.5065,-916.7116,43.1726) || PlayerToPoint(1.0,playerid,-1980.8181,145.1371,27.6875))
  460. {
  461. return 20000;
  462. }
  463. }
  464. return 0;
  465. }
  466.  
  467. public IsAtClothShop(playerid)
  468. {
  469. if(IsPlayerConnected(playerid))
  470. {
  471. if(PlayerToPoint(25.0,playerid,207.5627,-103.7291,1005.2578) || PlayerToPoint(25.0,playerid,203.9068,-41.0728,1001.8047))
  472. {//Binco & Suburban
  473. return 250;
  474. }
  475. else if(PlayerToPoint(30.0,playerid,214.4470,-7.6471,1001.2109) || PlayerToPoint(50.0,playerid,161.3765,-83.8416,1001.8047))
  476. {//Zip & Victim
  477. return 500;
  478. }
  479. }
  480. return 0;
  481. }
  482.  
  483. public IsAtGasStation(playerid)
  484. {
  485. if(IsPlayerConnected(playerid))
  486. {
  487. if(PlayerToPoint(6.0,playerid,1004.0070,-939.3102,42.1797) || PlayerToPoint(6.0,playerid,1944.3260,-1772.9254,13.3906))
  488. {//LS
  489. return 2000;
  490. }
  491. else if(PlayerToPoint(6.0,playerid,-90.5515,-1169.4578,2.4079) || PlayerToPoint(6.0,playerid,-1609.7958,-2718.2048,48.5391))
  492. {//LS
  493. return 2000;
  494. }
  495. else if(PlayerToPoint(6.0,playerid,-2029.4968,156.4366,28.9498) || PlayerToPoint(8.0,playerid,-2408.7590,976.0934,45.4175))
  496. {//SF
  497. return 2000;
  498. }
  499. else if(PlayerToPoint(5.0,playerid,-2243.9629,-2560.6477,31.8841) || PlayerToPoint(8.0,playerid,-1676.6323,414.0262,6.9484))
  500. {//Between LS and SF
  501. return 2000;
  502. }
  503. else if(PlayerToPoint(6.0,playerid,2202.2349,2474.3494,10.5258) || PlayerToPoint(10.0,playerid,614.9333,1689.7418,6.6968))
  504. {//LV
  505. return 2000;
  506. }
  507. else if(PlayerToPoint(8.0,playerid,-1328.8250,2677.2173,49.7665) || PlayerToPoint(6.0,playerid,70.3882,1218.6783,18.5165))
  508. {//LV
  509. return 2000;
  510. }
  511. else if(PlayerToPoint(8.0,playerid,2113.7390,920.1079,10.5255) || PlayerToPoint(6.0,playerid,-1327.7218,2678.8723,50.0625))
  512. {//LV
  513. return 2000;
  514. }
  515. }
  516. return 0;
  517. }
  518.  
  519. #if defined FILTERSCRIPT
  520.  
  521. public OnFilterScriptInit()
  522. {
  523. print("\n--------------------------------------");
  524. print(" by YBob, make");
  525. print("--------------------------------------\n");
  526. return 1;
  527. }
  528.  
  529. public OnFilterScriptExit()
  530. {
  531. return 1;
  532. }
  533.  
  534. #else
  535.  
  536. main()
  537. {
  538. print("\n----------------------------------");
  539. print(" Only GF / by YBob, make");
  540. print("----------------------------------\n");
  541. }
  542.  
  543. #endif
  544.  
  545. public OnGameModeInit()
  546. {
  547. // Don't use these lines if it's a filterscript
  548. //SetGameModeText("Rob Script");
  549. //AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  550. //return 1;
  551. }
  552.  
  553. public OnGameModeExit()
  554. {
  555. return 1;
  556. }
  557.  
  558.  
  559.  
  560. public OnPlayerRequestSpawn(playerid)
  561. {
  562. gbl_robber_status[playerid] = 0;
  563. GetCops();
  564. return 1;
  565. }
  566.  
  567. public OnPlayerConnect(playerid)
  568. {
  569. gbl_robber_status[playerid] = 0;
  570. return 1;
  571. }
  572.  
  573. public OnPlayerDisconnect(playerid, reason)
  574. {
  575. gbl_robber_status[playerid] = 0;
  576. return 1;
  577. }
  578.  
  579. public OnPlayerSpawn(playerid)
  580. {
  581. gbl_robber_status[playerid] = 0;
  582. GetCops();
  583. return 1;
  584. }
  585.  
  586. public OnPlayerDeath(playerid, killerid, reason)
  587. {
  588. gbl_robber_status[playerid] = 0;
  589. if(amm_arr[playerid]>0){
  590. new string[256];
  591. GetCops();
  592. if(reason < 43){
  593. if(cops[killerid] == 1 && b_arr[playerid] == 1){
  594. GivePlayerMoney(playerid,(-1)*amm_arr[playerid]);
  595. GivePlayerMoney(killerid, floatround(amm_arr[playerid]/10, floatround_round));
  596. format(string, sizeof(string), "Du hast die gestohlenen %i$ zurueckerlangt und bekommst %i$ Belohnung!", amm_arr[playerid], floatround(amm_arr[playerid]/10, floatround_round));
  597. GameTextForPlayer(killerid,string,5000,3);
  598. SetAmm(4,amm_arr[playerid]-floatround(amm_arr[playerid]/10, floatround_round));
  599.  
  600. }else if(cops[killerid] == 1 && b_arr[playerid] == 2){
  601. GivePlayerMoney(playerid,(-1)*amm_arr[playerid]);
  602. GivePlayerMoney(killerid, floatround(amm_arr[playerid]/10, floatround_round));
  603. format(string, sizeof(string), "Du hast die gestohlenen %i$ zurueckerlangt und bekommst %i$ Belohnung!", amm_arr[playerid], floatround(amm_arr[playerid]/10, floatround_round));
  604. GameTextForPlayer(killerid,string,5000,3);
  605. SetAmm(203,amm_arr[playerid]-floatround(amm_arr[playerid]/10, floatround_round));
  606.  
  607. }else if(cops[killerid] == 1){
  608. GivePlayerMoney(playerid,(-1)*amm_arr[playerid]);
  609. GivePlayerMoney(killerid, floatround(amm_arr[playerid]/10, floatround_round));
  610. format(string, sizeof(string), "Du hast die gestohlenen %i$ zurueckerlangt und bekommst %i$ Belohnung!", amm_arr[playerid], floatround(amm_arr[playerid]/10, floatround_round));
  611. GameTextForPlayer(killerid,string,5000,3);
  612.  
  613. }else{
  614. GivePlayerMoney(playerid,(-1)*amm_arr[playerid]);
  615. GivePlayerMoney(killerid, amm_arr[playerid]);
  616. format(string, sizeof(string), "Du hast %i$ erbaeutet!", amm_arr[playerid]);
  617. GameTextForPlayer(killerid,string,5000,3);
  618. }
  619. }else{
  620. GivePlayerMoney(playerid,(-1)*amm_arr[playerid]);
  621. }
  622. amm_arr[playerid] = 0;
  623. b_arr[playerid] = 0;
  624. ungueltig[playerid] = 1;
  625. }
  626. return 1;
  627. }
  628.  
  629. public OnVehicleSpawn(vehicleid)
  630. {
  631. return 1;
  632. }
  633.  
  634. public OnVehicleDeath(vehicleid, killerid)
  635. {
  636. return 1;
  637. }
  638.  
  639. public OnPlayerText(playerid, text[])
  640. {
  641. return 1;
  642. }
  643.  
  644. public OnPlayerPrivmsg(playerid, recieverid, text[])
  645. {
  646. return 1;
  647. }
  648.  
  649. public OnPlayerCommandText(playerid, cmdtext[])
  650. {
  651. if (strcmp("/rob", cmdtext, true, 10) == 0)
  652. {
  653. if(IsPlayerConnected(playerid))
  654. {
  655.  
  656. if(cops[playerid] == 1){
  657. GameTextForPlayer(playerid,"Du bist ein Cop!",5000,3);
  658. return 0;
  659.  
  660. }
  661.  
  662.  
  663. for(new o=0; o<7200;o++){
  664. if(PlayerToPoint(10.0,playerid,gbl_LX[o],gbl_LY[o],gbl_LZ[o]) && gbl_L[o] == GetPlayerVirtualWorld(playerid)+1){
  665. GameTextForPlayer(playerid,"Dieser Laden wurde erst vor kurzem ausgeraubt!",5000,3);
  666. return 0;
  667.  
  668. }
  669. }
  670.  
  671. if(cops_on < 0)
  672. {
  673. GameTextForPlayer(playerid,"Es sind zu wenig cops online.",5000,3);
  674. return 0;
  675. }
  676.  
  677. if(GetPlayerWeapon(playerid) < 21 || GetPlayerWeapon(playerid) > 39)
  678. {
  679. GameTextForPlayer(playerid,"Der Besitzer fuerchtet sich nicht!\nDu musst ihn mit deiner Waffe bedrohen!",5000,3);
  680. return 0;
  681. }
  682.  
  683. if(gbl_robber_status[playerid] == 1)
  684. {
  685. GameTextForPlayer(playerid,"Du bist bereits am ausrauben!",5000,3);
  686. return 0;
  687. }
  688.  
  689. new str_msg[256], name[256];
  690. GetPlayerName(playerid, name, sizeof(name));
  691.  
  692.  
  693. if(IsAtGasStation(playerid) >= 2000)
  694. {
  695. if(IsPlayerInAnyVehicle(playerid)){
  696. RemovePlayerFromVehicle(playerid);
  697.  
  698. }
  699. ApplyAnimation(playerid,"SHOP", "ROB_Loop_Threat",4.0,1,0,0,0,0);
  700. format(str_msg, sizeof(str_msg), "Eine Tankstelle wird ausgeraubt!", name);
  701. gbl_robber_status[playerid] = 1;
  702. TogglePlayerControllable(playerid, 0);
  703. SetTimerEx("rob",60000,false,"i",playerid);
  704. ruf(str_msg, playerid);
  705.  
  706. }
  707. else if(IsAtBar(playerid) >= 500)
  708. {
  709. ApplyAnimation(playerid,"SHOP", "ROB_Loop_Threat",4.0,1,0,0,0,0);
  710. if(PlayerToPoint(4.0,playerid,1215.9480,-13.3519,1000.9219)){
  711. format(str_msg, sizeof(str_msg), "Der PIG Pen wird ausgeraubt!", name);
  712. }else if(PlayerToPoint(4.0,playerid,495.7801,-76.0305,998.7578)){
  713. format(str_msg, sizeof(str_msg), "Eine Bar wird ausgeraubt!", name);
  714. }else if(PlayerToPoint(4.0,playerid,499.9654,-20.2515,1000.6797)){
  715. format(str_msg, sizeof(str_msg), "Eine Bar wird ausgeraubt!!", name);
  716. }else{
  717. format(str_msg, sizeof(str_msg), "Eine Bar wird ausgeraubt !", name);
  718. }
  719. gbl_robber_status[playerid] = 1;
  720. TogglePlayerControllable(playerid, 0);
  721. SetTimerEx("rob",30000,false,"i",playerid);
  722. ruf(str_msg, playerid);
  723.  
  724. }
  725. else if(IsAtClothShop(playerid) >= 500)
  726. {
  727. ApplyAnimation(playerid,"SHOP", "ROB_Loop_Threat",4.0,1,0,0,0,0);
  728. format(str_msg, sizeof(str_msg), "Ein Geschaeft wird ausgeraubt!", name);
  729. gbl_robber_status[playerid] = 1;
  730. TogglePlayerControllable(playerid, 0);
  731. SetTimerEx("rob",30000,false,"i",playerid);
  732. ruf(str_msg, playerid);
  733. }
  734. else if(IsAtCash(playerid) >= 2000)
  735. {
  736. ApplyAnimation(playerid,"SHOP", "ROB_Loop_Threat",4.0,1,0,0,0,0);
  737. format(str_msg, sizeof(str_msg), "Ein Geld Automat wird ausgeraubt !", name);
  738. gbl_robber_status[playerid] = 1;
  739. TogglePlayerControllable(playerid, 0);
  740. SetTimerEx("rob",30000,false,"i",playerid);
  741. ruf(str_msg, playerid);
  742. }
  743. else if(IsAtBank(playerid) == 20000)
  744. {
  745. format(str_msg, sizeof(str_msg), "Eine Bank wird ausgeraubt!", name);
  746. gbl_robber_status[playerid] = 1;
  747. ApplyAnimation(playerid,"SHOP", "ROB_Loop_Threat",4.0,1,0,0,0,0);
  748. SetTimerEx("rob",120000,false,"i",playerid);
  749. ruf(str_msg, playerid);
  750. }else{
  751. GameTextForPlayer(playerid,"Du bist in keinem Laden!",5000,3);
  752. return 0;
  753. }
  754. return 1;
  755.  
  756.  
  757.  
  758. }
  759. }
  760. return 0;
  761. }
  762.  
  763. public OnPlayerInfoChange(playerid)
  764. {
  765. return 1;
  766. }
  767.  
  768. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  769. {
  770. return 1;
  771. }
  772.  
  773. public OnPlayerExitVehicle(playerid, vehicleid)
  774. {
  775. return 1;
  776. }
  777.  
  778. public OnPlayerStateChange(playerid, newstate, oldstate)
  779. {
  780. return 1;
  781. }
  782.  
  783. public OnPlayerEnterCheckpoint(playerid)
  784. {
  785. DisablePlayerCheckpoint(playerid);
  786.  
  787. return 1;
  788. }
  789.  
  790. public OnPlayerLeaveCheckpoint(playerid)
  791. {
  792. return 1;
  793. }
  794.  
  795. public OnPlayerEnterRaceCheckpoint(playerid)
  796. {
  797. return 1;
  798. }
  799.  
  800. public OnPlayerLeaveRaceCheckpoint(playerid)
  801. {
  802. return 1;
  803. }
  804.  
  805. public OnRconCommand(cmd[])
  806. {
  807. return 1;
  808. }
  809.  
  810. public OnObjectMoved(objectid)
  811. {
  812. return 1;
  813. }
  814.  
  815. public OnPlayerObjectMoved(playerid, objectid)
  816. {
  817. return 1;
  818. }
  819.  
  820. public OnPlayerPickUpPickup(playerid, pickupid)
  821. {
  822. return 1;
  823. }
  824.  
  825. public OnPlayerSelectedMenuRow(playerid, row)
  826. {
  827. return 1;
  828. }
  829.  
  830. public OnPlayerExitedMenu(playerid)
  831. {
  832. return 1;
  833. }
  834.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement