Guest User

Untitled

a guest
Jul 25th, 2014
1,141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 79.28 KB | None | 0 0
  1. /* Made by Dimi
  2. I recommend you to put that script in your gamemode and it will work perfectly :) */
  3. #include <a_samp>
  4. #include <streamer>
  5. #include <sscanf2>
  6. #include <YSI_3.1\y_ini>
  7. #include <YSI_3.1\y_iterate>
  8. #include <YSI_3.1\y_commands>
  9. //------------------------------------------------------------------------------
  10. #define MAX_ORG 20
  11. #define O_FILE "Organization/ORG_%d.ini"
  12. #define ORG_NAME 128
  13. #define ORG_LEADER 32
  14. #define ORG_MEMBER 32
  15. #define ORG_RANK 64
  16. //------------------------------------------------------------------------------
  17. // Definisane boje
  18. #define COLOR_RED 0xfa5555AA
  19. #define COLOR_GREEN 0x33AA33AA
  20. #define COLOR_WHITE 0xFFFFFFFF
  21. #define COLOR_ORANGE 0xFFAF00FF
  22. #define COLOR_PURPLE 0xC2A2DAAA
  23. //------------------------------------------------------------------------------
  24. #define DIALOG_ORGCREATE 7
  25. #define DIALOG_ORGTYPE 8
  26. #define DIALOG_ORGSKINS 9
  27. #define DIALOG_ORGRANK1 10
  28. #define DIALOG_ORGRANK2 11
  29. #define DIALOG_ORGRANK3 12
  30. #define DIALOG_ORGRANK4 13
  31. #define DIALOG_ORGRANK5 14
  32. #define DIALOG_ORGRANK6 15
  33. #define DIALOG_ORGINT1 16
  34. #define DIALOG_ORGINT2 17
  35. #define DIALOG_LEADER 21
  36. #define DIALOG_INVITE 22
  37. #define DIALOG_UNINVITE 23
  38. #define DIALOG_GIVERANK 24
  39. #define DIALOG_ALLMEMBERS 25
  40. #define DIALOG_ORGDELETE 26
  41. #define DIALOG_ORGEDIT 28
  42. #define DIALOG_ORGNAME 29
  43. #define DIALOG_ORGRANKS 30
  44. #define DIALOG_OSAFE 49
  45. #define DIALOG_ORGSCREATE 50
  46. #define DIALOG_SAFE_INFO 51
  47. #define DIALOG_SAFE_TMATS 52
  48. #define DIALOG_SAFE_PMATS 53
  49. #define DIALOG_SAFE_TDRUGS 54
  50. #define DIALOG_SAFE_PDRUGS 55
  51. #define DIALOG_SAFE_TMONEY 56
  52. #define DIALOG_SAFE_DMONEY 57
  53. #define DIALOG_ORGLIST 66
  54. //------------------------------------------------------------------------------
  55. enum xPlayerInfo{ // enum for players stats
  56. xLevel,
  57. xAdmin, // if Admin ingame in my mod - by Levels
  58. xSkin,
  59. xLeader,
  60. xMember,
  61. xRank,
  62. xDrugs,
  63. xMats
  64. }
  65. new PI[ MAX_PLAYERS ][ xPlayerInfo ];
  66. //------------------------------------------------------------------------------
  67. enum oOrgInfo { // enum for organization
  68. oID,
  69. oName[ORG_NAME],
  70.  
  71. oType,
  72.  
  73. oLeader[ORG_LEADER],
  74.  
  75. oMember1[ORG_MEMBER],
  76. oMember2[ORG_MEMBER],
  77. oMember3[ORG_MEMBER],
  78. oMember4[ORG_MEMBER],
  79. oMember5[ORG_MEMBER],
  80. oMember6[ORG_MEMBER],
  81. oMember7[ORG_MEMBER],
  82. oMember8[ORG_MEMBER],
  83. oMember9[ORG_MEMBER],
  84. oMember10[ORG_MEMBER],
  85. oMember11[ORG_MEMBER],
  86. oMember12[ORG_MEMBER],
  87.  
  88. oSkin1,
  89. oSkin2,
  90. oSkin3,
  91. oSkin4,
  92. oSkin5,
  93. oSkin6,
  94.  
  95. oRank1[ORG_RANK],
  96. oRank2[ORG_RANK],
  97. oRank3[ORG_RANK],
  98. oRank4[ORG_RANK],
  99. oRank5[ORG_RANK],
  100. oRank6[ORG_RANK],
  101.  
  102.  
  103. Float:oPosExtX,
  104. Float:oPosExtY,
  105. Float:oPosExtZ,
  106.  
  107. Float:oPosIntX,
  108. Float:oPosIntY,
  109. Float:oPosIntZ,
  110.  
  111. oVehicle_1,
  112. Float:oVehicle_1_PosX,
  113. Float:oVehicle_1_PosY,
  114. Float:oVehicle_1_PosZ,
  115. Float:oVehicle_1_PosA,
  116.  
  117. oVehicle_2,
  118. Float:oVehicle_2_PosX,
  119. Float:oVehicle_2_PosY,
  120. Float:oVehicle_2_PosZ,
  121. Float:oVehicle_2_PosA,
  122.  
  123. oVehicle_3,
  124. Float:oVehicle_3_PosX,
  125. Float:oVehicle_3_PosY,
  126. Float:oVehicle_3_PosZ,
  127. Float:oVehicle_3_PosA,
  128.  
  129. oVehicle_4,
  130. Float:oVehicle_4_PosX,
  131. Float:oVehicle_4_PosY,
  132. Float:oVehicle_4_PosZ,
  133. Float:oVehicle_4_PosA,
  134.  
  135. oVehicle_5,
  136. Float:oVehicle_5_PosX,
  137. Float:oVehicle_5_PosY,
  138. Float:oVehicle_5_PosZ,
  139. Float:oVehicle_5_PosA,
  140.  
  141. oVehicle_6,
  142. Float:oVehicle_6_PosX,
  143. Float:oVehicle_6_PosY,
  144. Float:oVehicle_6_PosZ,
  145. Float:oVehicle_6_PosA,
  146.  
  147. oVehicle_7,
  148. Float:oVehicle_7_PosX,
  149. Float:oVehicle_7_PosY,
  150. Float:oVehicle_7_PosZ,
  151. Float:oVehicle_7_PosA,
  152.  
  153. oVehicle_8,
  154. Float:oVehicle_8_PosX,
  155. Float:oVehicle_8_PosY,
  156. Float:oVehicle_8_PosZ,
  157. Float:oVehicle_8_PosA,
  158.  
  159. oVehicle_9,
  160. Float:oVehicle_9_PosX,
  161. Float:oVehicle_9_PosY,
  162. Float:oVehicle_9_PosZ,
  163. Float:oVehicle_9_PosA,
  164.  
  165. oVehicle_10,
  166. Float:oVehicle_10_PosX,
  167. Float:oVehicle_10_PosY,
  168. Float:oVehicle_10_PosZ,
  169. Float:oVehicle_10_PosA,
  170.  
  171. oVehicle_11,
  172. Float:oVehicle_11_PosX,
  173. Float:oVehicle_11_PosY,
  174. Float:oVehicle_11_PosZ,
  175. Float:oVehicle_11_PosA,
  176.  
  177. oVehicle_12,
  178. Float:oVehicle_12_PosX,
  179. Float:oVehicle_12_PosY,
  180. Float:oVehicle_12_PosZ,
  181. Float:oVehicle_12_PosA,
  182.  
  183. oColor_1,
  184. oColor_2,
  185.  
  186. oInt,
  187. oVw,
  188.  
  189. oSafe,
  190. Float:oSafePosX,
  191. Float:oSafePosY,
  192. Float:oSafePosZ,
  193. oSafeMats,
  194. oSafeDrugs,
  195. oSafeMoney
  196. }
  197. new OI[ MAX_ORG ][ oOrgInfo ];
  198. new OrgPickup[ MAX_ORG ];
  199. new OrgVehicle[ MAX_ORG ][ 12 ];
  200. new Text3D:Org3D[ MAX_ORG ];
  201. new Text3D:OrgSafeLabel[ MAX_ORG ];
  202. new OrgSafePickup[ MAX_ORG ];
  203. new OrgCreate[ MAX_PLAYERS ]; // difference between creating and editing in dialogs
  204. //------------------------------------------------------------------------------
  205. IsPlayerNearOrganization(playerid) {
  206. for(new b = 1; b < MAX_ORG; b++) {
  207. if(IsPlayerInRangeOfPoint(playerid, 2.0, OI[ b ][ oPosExtX], OI[ b ][ oPosExtY], OI[ b ][ oPosExtZ])) return b; }
  208. return -1;
  209. }
  210. //------------------------------------------------------------------------------
  211. stock Orge3D(id) { // updating organization labels on chaning leader,create ....
  212. new string[ 400 ];
  213. Delete3DTextLabel( OrgSafeLabel[ id ] );
  214. DestroyPickup( OrgSafePickup[ id ] );
  215. Delete3DTextLabel( Org3D[ id ] );
  216. DestroyPickup( OrgPickup[ id ] );
  217. format( string,sizeof( string ),"{FFFFFF}%s\n{FF6200}Leader: {FFFFFF}%s\n{FF6200}For entrance click\n{FFFFFF}'ENTER'", OI[ id ][ oName], OI[ id ][ oLeader ]);
  218. Org3D[ id ] = Create3DTextLabel( string ,COLOR_GREEN, OI[ id ][ oPosExtX ], OI[ id ][ oPosExtY ], OI[ id ][ oPosExtZ ], 25, 0, 1);
  219. OrgPickup[ id ] = CreateDynamicPickup( 1314, 1, OI[ id ][ oPosExtX ], OI[ id ][ oPosExtY ], OI[ id ][ oPosExtZ ]);
  220. if( OI[ id ][ oSafe ] == 1) {
  221. OrgSafeLabel[ id ] = Create3DTextLabel( "{FF6200}Press {FFFFFF}'SPACE' {FF6200}to open safe menu{FF6200}" ,COLOR_GREEN, OI[ id ][ oSafePosX ], OI[ id ][ oSafePosY ], OI[ id ][ oSafePosZ ], 25, OI[ id ][ oVw ], 1);
  222. OrgSafePickup[ id ] = CreateDynamicPickup( 1239, 1, OI[ id ][ oSafePosX ], OI[ id ][ oSafePosY ], OI[ id ][ oSafePosZ ], OI[ id ][ oVw ] ); }
  223. return true;
  224. }
  225. //------------------------------------------------------------------------------
  226. stock PlayerName(id)
  227. {
  228. new ime[MAX_PLAYER_NAME];
  229. GetPlayerName(id, ime, sizeof ime);
  230. return ime;
  231. }
  232. //------------------------------------------------------------------------------
  233. IsNumeric(const string[]) {
  234. for (new i = 0, j = strlen(string); i < j; i++) {
  235. if (string[i] > '9' || string[i] < '0') return false; }
  236. return true;
  237. }
  238. //------------------------------------------------------------------------------
  239. stock OrgMessage(orgid, color, string[]) {
  240. foreach(Player, i) {
  241. if( PI[ i ][ xMember ] == orgid || PI[ i ][ xLeader ] == orgid ) {
  242. SendClientMessage( i, color, string ); } }
  243. return true;
  244. }
  245. //------------------------------------------------------------------------------
  246. forward ProxDetector( Float:Radius, playerid, string[], col1);
  247. public ProxDetector(Float:Radius, playerid, string[], col1)
  248. {
  249. new Float:PozX, Float:PozY, Float:PozZ;
  250. GetPlayerPos(playerid, PozX, PozY, PozZ);
  251. foreach( Player, i) {
  252. if( IsPlayerConnected( i ) && ( GetPlayerVirtualWorld( playerid ) == GetPlayerVirtualWorld( i ) ) ) {
  253. if( IsPlayerInRangeOfPoint( i, Radius, PozX, PozY, PozZ ) ) {
  254. SendClientMessage(i, col1, string); } } }
  255. return true;
  256. }
  257. //------------------------------------------------------------------------------
  258. forward SaveOrganization(id); // Save organization stats
  259. public SaveOrganization(id)
  260. {
  261. new org_file[ 40 ];
  262. format (org_file, sizeof( org_file ), O_FILE, id );
  263. new INI:File = INI_Open( org_file );
  264. INI_SetTag( File, "Organizacija");
  265.  
  266. INI_WriteInt( File, "ID", OI[ id ][ oID ]);
  267. INI_WriteString( File, "Name", OI[ id ][ oName ]);
  268.  
  269. INI_WriteInt( File, "Type", OI[ id ][ oType ]);
  270.  
  271. INI_WriteString( File, "Leader", OI[ id ][ oLeader ]);
  272.  
  273. INI_WriteString( File, "Member1", OI[ id ][ oMember1 ]);
  274. INI_WriteString( File, "Member2", OI[ id ][ oMember2 ]);
  275. INI_WriteString( File, "Member3", OI[ id ][ oMember3 ]);
  276. INI_WriteString( File, "Member4", OI[ id ][ oMember4 ]);
  277. INI_WriteString( File, "Member5", OI[ id ][ oMember5 ]);
  278. INI_WriteString( File, "Member6", OI[ id ][ oMember6 ]);
  279. INI_WriteString( File, "Member7", OI[ id ][ oMember7 ]);
  280. INI_WriteString( File, "Member8", OI[ id ][ oMember8 ]);
  281. INI_WriteString( File, "Member9", OI[ id ][ oMember9 ]);
  282. INI_WriteString( File, "Member10", OI[ id ][ oMember10 ]);
  283. INI_WriteString( File, "Member11", OI[ id ][ oMember11 ]);
  284. INI_WriteString( File, "Member12", OI[ id ][ oMember12 ]);
  285.  
  286. INI_WriteInt( File, "Skin1", OI[ id ][ oSkin1 ]);
  287. INI_WriteInt( File, "Skin2", OI[ id ][ oSkin2 ]);
  288. INI_WriteInt( File, "Skin3", OI[ id ][ oSkin3 ]);
  289. INI_WriteInt( File, "Skin4", OI[ id ][ oSkin4 ]);
  290. INI_WriteInt( File, "Skin5", OI[ id ][ oSkin5 ]);
  291. INI_WriteInt( File, "Skin6", OI[ id ][ oSkin6 ]);
  292. INI_WriteString( File, "Rank1", OI[ id ][ oRank1 ]);
  293. INI_WriteString( File, "Rank2", OI[ id ][ oRank2 ]);
  294. INI_WriteString( File, "Rank3", OI[ id ][ oRank3 ]);
  295. INI_WriteString( File, "Rank4", OI[ id ][ oRank4 ]);
  296. INI_WriteString( File, "Rank5", OI[ id ][ oRank5 ]);
  297. INI_WriteString( File, "Rank6", OI[ id ][ oRank6 ]);
  298.  
  299. INI_WriteFloat( File, "PosExtX", OI[ id ][ oPosExtX ]);
  300. INI_WriteFloat( File, "PosExtY", OI[ id ][ oPosExtY ]);
  301. INI_WriteFloat( File, "PosExtZ", OI[ id ][ oPosExtZ ]);
  302.  
  303. INI_WriteFloat( File, "PosIntX", OI[ id ][ oPosIntX ]);
  304. INI_WriteFloat( File, "PosIntY", OI[ id ][ oPosIntY ]);
  305. INI_WriteFloat( File, "PosIntZ", OI[ id ][ oPosIntZ ]);
  306.  
  307. INI_WriteInt( File, "Vehicle_1", OI[id][oVehicle_1]);
  308. INI_WriteFloat( File, "Vehicle_1_PosX", OI[id][oVehicle_1_PosX]);
  309. INI_WriteFloat( File, "Vehicle_1_PosY", OI[id][oVehicle_1_PosY]);
  310. INI_WriteFloat( File, "Vehicle_1_PosZ", OI[id][oVehicle_1_PosZ]);
  311. INI_WriteFloat( File, "Vehicle_1_PosA", OI[id][oVehicle_1_PosA]);
  312.  
  313. INI_WriteInt( File, "Vehicle_2", OI[id][oVehicle_2]);
  314. INI_WriteFloat( File, "Vehicle_2_PosX", OI[id][oVehicle_2_PosX]);
  315. INI_WriteFloat( File, "Vehicle_2_PosY", OI[id][oVehicle_2_PosY]);
  316. INI_WriteFloat( File, "Vehicle_2_PosZ", OI[id][oVehicle_2_PosZ]);
  317. INI_WriteFloat( File, "Vehicle_2_PosA", OI[id][oVehicle_2_PosA]);
  318.  
  319. INI_WriteInt( File, "Vehicle_3", OI[id][oVehicle_3]);
  320. INI_WriteFloat( File, "Vehicle_3_PosX", OI[id][oVehicle_3_PosX]);
  321. INI_WriteFloat( File, "Vehicle_3_PosY", OI[id][oVehicle_3_PosY]);
  322. INI_WriteFloat( File, "Vehicle_3_PosZ", OI[id][oVehicle_3_PosZ]);
  323. INI_WriteFloat( File, "Vehicle_3_PosA", OI[id][oVehicle_3_PosA]);
  324.  
  325. INI_WriteInt( File, "Vehicle_4", OI[id][oVehicle_4]);
  326. INI_WriteFloat( File, "Vehicle_4_PosX", OI[id][oVehicle_4_PosX]);
  327. INI_WriteFloat( File, "Vehicle_4_PosY", OI[id][oVehicle_4_PosY]);
  328. INI_WriteFloat( File, "Vehicle_4_PosZ", OI[id][oVehicle_4_PosZ]);
  329. INI_WriteFloat( File, "Vehicle_4_PosA", OI[id][oVehicle_4_PosA]);
  330.  
  331. INI_WriteInt( File, "Vehicle_5", OI[id][oVehicle_5]);
  332. INI_WriteFloat( File, "Vehicle_5_PosX", OI[id][oVehicle_5_PosX]);
  333. INI_WriteFloat( File, "Vehicle_5_PosY", OI[id][oVehicle_5_PosY]);
  334. INI_WriteFloat( File, "Vehicle_5_PosZ", OI[id][oVehicle_5_PosZ]);
  335. INI_WriteFloat( File, "Vehicle_5_PosA", OI[id][oVehicle_5_PosA]);
  336.  
  337. INI_WriteInt( File, "Vehicle_6", OI[id][oVehicle_6]);
  338. INI_WriteFloat( File, "Vehicle_6_PosX", OI[id][oVehicle_6_PosX]);
  339. INI_WriteFloat( File, "Vehicle_6_PosY", OI[id][oVehicle_6_PosY]);
  340. INI_WriteFloat( File, "Vehicle_6_PosZ", OI[id][oVehicle_6_PosZ]);
  341. INI_WriteFloat( File, "Vehicle_6_PosA", OI[id][oVehicle_6_PosA]);
  342.  
  343. INI_WriteInt( File, "Vehicle_7", OI[id][oVehicle_7]);
  344. INI_WriteFloat( File, "Vehicle_7_PosX", OI[id][oVehicle_7_PosX]);
  345. INI_WriteFloat( File, "Vehicle_7_PosY", OI[id][oVehicle_7_PosY]);
  346. INI_WriteFloat( File, "Vehicle_7_PosZ", OI[id][oVehicle_7_PosZ]);
  347. INI_WriteFloat( File, "Vehicle_7_PosA", OI[id][oVehicle_7_PosA]);
  348.  
  349. INI_WriteInt( File, "Vehicle_8", OI[id][oVehicle_8]);
  350. INI_WriteFloat( File, "Vehicle_8_PosX", OI[id][oVehicle_8_PosX]);
  351. INI_WriteFloat( File, "Vehicle_8_PosY", OI[id][oVehicle_8_PosY]);
  352. INI_WriteFloat( File, "Vehicle_8_PosZ", OI[id][oVehicle_8_PosZ]);
  353. INI_WriteFloat( File, "Vehicle_8_PosA", OI[id][oVehicle_8_PosA]);
  354.  
  355. INI_WriteInt( File, "Vehicle_9", OI[id][oVehicle_9]);
  356. INI_WriteFloat( File, "Vehicle_9_PosX", OI[id][oVehicle_9_PosX]);
  357. INI_WriteFloat( File, "Vehicle_9_PosY", OI[id][oVehicle_9_PosY]);
  358. INI_WriteFloat( File, "Vehicle_9_PosZ", OI[id][oVehicle_9_PosZ]);
  359. INI_WriteFloat( File, "Vehicle_9_PosA", OI[id][oVehicle_9_PosA]);
  360.  
  361. INI_WriteInt( File, "Vehicle_10", OI[id][oVehicle_10]);
  362. INI_WriteFloat( File, "Vehicle_10_PosX", OI[id][oVehicle_10_PosX]);
  363. INI_WriteFloat( File, "Vehicle_10_PosY", OI[id][oVehicle_10_PosY]);
  364. INI_WriteFloat( File, "Vehicle_10_PosZ", OI[id][oVehicle_10_PosZ]);
  365. INI_WriteFloat( File, "Vehicle_10_PosA", OI[id][oVehicle_10_PosA]);
  366.  
  367. INI_WriteInt( File, "Vehicle_11", OI[id][oVehicle_11]);
  368. INI_WriteFloat( File, "Vehicle_11_PosX", OI[id][oVehicle_11_PosX]);
  369. INI_WriteFloat( File, "Vehicle_11_PosY", OI[id][oVehicle_11_PosY]);
  370. INI_WriteFloat( File, "Vehicle_11_PosZ", OI[id][oVehicle_11_PosZ]);
  371. INI_WriteFloat( File, "Vehicle_11_PosA", OI[id][oVehicle_11_PosA]);
  372.  
  373. INI_WriteInt( File, "Vehicle_12", OI[id][oVehicle_12]);
  374. INI_WriteFloat( File, "Vehicle_12_PosX", OI[id][oVehicle_12_PosX]);
  375. INI_WriteFloat( File, "Vehicle_12_PosY", OI[id][oVehicle_12_PosY]);
  376. INI_WriteFloat( File, "Vehicle_12_PosZ", OI[id][oVehicle_12_PosZ]);
  377. INI_WriteFloat( File, "Vehicle_12_PosA", OI[id][oVehicle_12_PosA]);
  378.  
  379. INI_WriteInt( File, "Color_1", OI[id][oColor_1]);
  380. INI_WriteInt( File, "Color_2", OI[id][oColor_2]);
  381.  
  382. INI_WriteInt( File, "Int", OI[ id ][ oInt ]);
  383. INI_WriteInt( File, "Vw", OI[ id ][ oVw ]);
  384.  
  385. INI_WriteInt( File, "Safe", OI[ id ][ oSafe ]);
  386. INI_WriteFloat( File, "SafePosX", OI[ id ][ oSafePosX ]);
  387. INI_WriteFloat( File, "SafePosY", OI[ id ][ oSafePosY ]);
  388. INI_WriteFloat( File, "SafePosZ", OI[ id ][ oSafePosZ ]);
  389. INI_WriteInt( File, "SafeMats", OI[ id ][ oSafeMats ]);
  390. INI_WriteInt( File, "SafeDrugs", OI[ id ][ oSafeDrugs ]);
  391. INI_WriteInt( File, "SafeMoney", OI[ id ][ oSafeMoney ]);
  392.  
  393. INI_Close( File );
  394. return 1;
  395. }
  396. //------------------------------------------------------------------------------
  397. forward LoadOrganization(id, name[], value[]); // Load organization
  398. public LoadOrganization(id, name[], value[])
  399. {
  400. INI_Int( "ID", OI[ id ][ oID]);
  401. INI_String( "Name", OI[ id ][ oName], ORG_NAME);
  402.  
  403. INI_String( "Leader", OI[ id ][ oLeader], ORG_LEADER);
  404.  
  405. INI_Int( "Type", OI[ id ][ oType]);
  406.  
  407. INI_String( "Member1", OI[ id ][ oMember1], ORG_MEMBER);
  408. INI_String( "Member2", OI[ id ][ oMember2], ORG_MEMBER);
  409. INI_String( "Member3", OI[ id ][ oMember3], ORG_MEMBER);
  410. INI_String( "Member4", OI[ id ][ oMember4], ORG_MEMBER);
  411. INI_String( "Member5", OI[ id ][ oMember5], ORG_MEMBER);
  412. INI_String( "Member6", OI[ id ][ oMember6], ORG_MEMBER);
  413. INI_String( "Member7", OI[ id ][ oMember7], ORG_MEMBER);
  414. INI_String( "Member8", OI[ id ][ oMember8], ORG_MEMBER);
  415. INI_String( "Member9", OI[ id ][ oMember9], ORG_MEMBER);
  416. INI_String( "Member10", OI[ id ][ oMember10], ORG_MEMBER);
  417. INI_String( "Member11", OI[ id ][ oMember11], ORG_MEMBER);
  418. INI_String( "Member12", OI[ id ][ oMember12], ORG_MEMBER);
  419.  
  420. INI_Int( "Skin1", OI[ id ][ oSkin1]);
  421. INI_Int( "Skin2", OI[ id ][ oSkin2]);
  422. INI_Int( "Skin3", OI[ id ][ oSkin3]);
  423. INI_Int( "Skin4", OI[ id ][ oSkin4]);
  424. INI_Int( "Skin5", OI[ id ][ oSkin5]);
  425. INI_Int( "Skin6", OI[ id ][ oSkin6]);
  426. INI_String( "Rank1", OI[ id ][ oRank1], ORG_RANK);
  427. INI_String( "Rank2", OI[ id ][ oRank2], ORG_RANK);
  428. INI_String( "Rank3", OI[ id ][ oRank3], ORG_RANK);
  429. INI_String( "Rank4", OI[ id ][ oRank4], ORG_RANK);
  430. INI_String( "Rank5", OI[ id ][ oRank5], ORG_RANK);
  431. INI_String( "Rank6", OI[ id ][ oRank6], ORG_RANK);
  432.  
  433. INI_Float( "PosExtX", OI[ id ][ oPosExtX]);
  434. INI_Float( "PosExtY", OI[ id ][ oPosExtY]);
  435. INI_Float( "PosExtZ", OI[ id ][ oPosExtZ]);
  436.  
  437. INI_Float( "PosIntX", OI[ id ][ oPosIntX]);
  438. INI_Float( "PosIntY", OI[ id ][ oPosIntY]);
  439. INI_Float( "PosIntZ", OI[ id ][ oPosIntZ]);
  440.  
  441. INI_Int("Vehicle_1", OI[id][oVehicle_1]);
  442. INI_Float("Vehicle_1_PosX", OI[id][oVehicle_1_PosX]);
  443. INI_Float("Vehicle_1_PosY", OI[id][oVehicle_1_PosY]);
  444. INI_Float("Vehicle_1_PosZ", OI[id][oVehicle_1_PosZ]);
  445. INI_Float("Vehicle_1_PosA", OI[id][oVehicle_1_PosA]);
  446.  
  447. INI_Int("Vehicle_2", OI[id][oVehicle_2]);
  448. INI_Float("Vehicle_2_PosX", OI[id][oVehicle_2_PosX]);
  449. INI_Float("Vehicle_2_PosY", OI[id][oVehicle_2_PosY]);
  450. INI_Float("Vehicle_2_PosZ", OI[id][oVehicle_2_PosZ]);
  451. INI_Float("Vehicle_2_PosA", OI[id][oVehicle_2_PosA]);
  452.  
  453. INI_Int("Vehicle_3", OI[id][oVehicle_3]);
  454. INI_Float("Vehicle_3_PosX", OI[id][oVehicle_3_PosX]);
  455. INI_Float("Vehicle_3_PosY", OI[id][oVehicle_3_PosY]);
  456. INI_Float("Vehicle_3_PosZ", OI[id][oVehicle_3_PosZ]);
  457. INI_Float("Vehicle_3_PosA", OI[id][oVehicle_3_PosA]);
  458.  
  459. INI_Int("Vehicle_4", OI[id][oVehicle_4]);
  460. INI_Float("Vehicle_4_PosX", OI[id][oVehicle_4_PosX]);
  461. INI_Float("Vehicle_4_PosY", OI[id][oVehicle_4_PosY]);
  462. INI_Float("Vehicle_4_PosZ", OI[id][oVehicle_4_PosZ]);
  463. INI_Float("Vehicle_4_PosA", OI[id][oVehicle_4_PosA]);
  464.  
  465. INI_Int("Vehicle_5", OI[id][oVehicle_5]);
  466. INI_Float("Vehicle_5_PosX", OI[id][oVehicle_5_PosX]);
  467. INI_Float("Vehicle_5_PosY", OI[id][oVehicle_5_PosY]);
  468. INI_Float("Vehicle_5_PosZ", OI[id][oVehicle_5_PosZ]);
  469. INI_Float("Vehicle_5_PosA", OI[id][oVehicle_5_PosA]);
  470.  
  471. INI_Int("Vehicle_6", OI[id][oVehicle_6]);
  472. INI_Float("Vehicle_6_PosX", OI[id][oVehicle_6_PosX]);
  473. INI_Float("Vehicle_6_PosY", OI[id][oVehicle_6_PosY]);
  474. INI_Float("Vehicle_6_PosZ", OI[id][oVehicle_6_PosZ]);
  475. INI_Float("Vehicle_6_PosA", OI[id][oVehicle_6_PosA]);
  476.  
  477. INI_Int("Vehicle_7", OI[id][oVehicle_7]);
  478. INI_Float("Vehicle_7_PosX", OI[id][oVehicle_7_PosX]);
  479. INI_Float("Vehicle_7_PosY", OI[id][oVehicle_7_PosY]);
  480. INI_Float("Vehicle_7_PosZ", OI[id][oVehicle_7_PosZ]);
  481. INI_Float("Vehicle_7_PosA", OI[id][oVehicle_7_PosA]);
  482.  
  483. INI_Int("Vehicle_8", OI[id][oVehicle_8]);
  484. INI_Float("Vehicle_8_PosX", OI[id][oVehicle_8_PosX]);
  485. INI_Float("Vehicle_8_PosY", OI[id][oVehicle_8_PosY]);
  486. INI_Float("Vehicle_8_PosZ", OI[id][oVehicle_8_PosZ]);
  487. INI_Float("Vehicle_8_PosA", OI[id][oVehicle_8_PosA]);
  488.  
  489. INI_Int("Vehicle_9", OI[id][oVehicle_9]);
  490. INI_Float("Vehicle_9_PosX", OI[id][oVehicle_9_PosX]);
  491. INI_Float("Vehicle_9_PosY", OI[id][oVehicle_9_PosY]);
  492. INI_Float("Vehicle_9_PosZ", OI[id][oVehicle_9_PosZ]);
  493. INI_Float("Vehicle_9_PosA", OI[id][oVehicle_9_PosA]);
  494.  
  495. INI_Int("Vehicle_10", OI[id][oVehicle_10]);
  496. INI_Float("Vehicle_10_PosX", OI[id][oVehicle_10_PosX]);
  497. INI_Float("Vehicle_10_PosY", OI[id][oVehicle_10_PosY]);
  498. INI_Float("Vehicle_10_PosZ", OI[id][oVehicle_10_PosZ]);
  499. INI_Float("Vehicle_10_PosA", OI[id][oVehicle_10_PosA]);
  500.  
  501. INI_Int("Vehicle_11", OI[id][oVehicle_11]);
  502. INI_Float("Vehicle_11_PosX", OI[id][oVehicle_11_PosX]);
  503. INI_Float("Vehicle_11_PosY", OI[id][oVehicle_11_PosY]);
  504. INI_Float("Vehicle_11_PosZ", OI[id][oVehicle_11_PosZ]);
  505. INI_Float("Vehicle_11_PosA", OI[id][oVehicle_11_PosA]);
  506.  
  507. INI_Int("Vehicle_12", OI[id][oVehicle_12]);
  508. INI_Float("Vehicle_12_PosX", OI[id][oVehicle_12_PosX]);
  509. INI_Float("Vehicle_12_PosY", OI[id][oVehicle_12_PosY]);
  510. INI_Float("Vehicle_12_PosZ", OI[id][oVehicle_12_PosZ]);
  511. INI_Float("Vehicle_12_PosA", OI[id][oVehicle_12_PosA]);
  512.  
  513. INI_Int( "Color_1", OI[id][oColor_1]);
  514. INI_Int( "Color_2", OI[id][oColor_2]);
  515.  
  516. INI_Int( "Safe", OI[ id ][ oSafe ]);
  517. INI_Float( "SafePosX", OI[ id ][ oSafePosX ]);
  518. INI_Float( "SafePosY", OI[ id ][ oSafePosY ]);
  519. INI_Float( "SafePosZ", OI[ id ][ oSafePosZ ]);
  520. INI_Int( "SafeMats", OI[ id ][ oSafeMats ]);
  521. INI_Int( "SafeDrugs", OI[ id ][ oSafeDrugs ]);
  522. INI_Int( "SafeMoney", OI[ id ][ oSafeMoney ]);
  523.  
  524. INI_Int( "Int", OI[ id ][ oInt]);
  525. INI_Int( "Vw", OI[ id ][ oVw ]);
  526.  
  527. return 1;
  528. }
  529.  
  530. public OnGameModeInit() // that must go in gamemode
  531. {
  532. for( new id = 1; id < MAX_ORG; id++ ) // loading organization,safe adn vehicles
  533. {
  534. new oFile[ 50 ], string10[ 256 ];
  535. format( oFile, sizeof( oFile ), O_FILE, id );
  536. if( fexist( oFile ) )
  537. {
  538. INI_ParseFile(oFile, "LoadOrganization", .bExtra = true, .extra = id);
  539. OrgPickup[ id ] = CreateDynamicPickup(1314, 1, OI[id][ oPosExtX ], OI[ id ][ oPosExtY ], OI[ id ][ oPosExtZ ] );
  540. format(string10,sizeof(string10),"{FFFFFF}%s\n{FF6200}Leader: {FFFFFF}%s\n{FF6200}For entrance click\n{FFFFFF}'ENTER'", OI[ id ][ oName ], OI[ id ][ oLeader ] );
  541. if( OI[ id ][ oVehicle_1 ] != 0 ) { OrgVehicle[id][0] = CreateVehicle(OI[id][oVehicle_1], OI[id][oVehicle_1_PosX], OI[id][oVehicle_1_PosY], OI[id][oVehicle_1_PosZ], OI[id][oVehicle_1_PosA], OI[id][oColor_1], OI[id][oColor_2], -1); }
  542. if( OI[ id ][ oVehicle_2 ] != 0 ) { OrgVehicle[id][1] = CreateVehicle(OI[id][oVehicle_2], OI[id][oVehicle_2_PosX], OI[id][oVehicle_2_PosY], OI[id][oVehicle_2_PosZ], OI[id][oVehicle_2_PosA], OI[id][oColor_1], OI[id][oColor_2], -1); }
  543. if( OI[ id ][ oVehicle_3 ] != 0 ) { OrgVehicle[id][2] = CreateVehicle(OI[id][oVehicle_3], OI[id][oVehicle_3_PosX], OI[id][oVehicle_3_PosY], OI[id][oVehicle_3_PosZ], OI[id][oVehicle_3_PosA], OI[id][oColor_1], OI[id][oColor_2], -1); }
  544. if( OI[ id ][ oVehicle_4 ] != 0 ) { OrgVehicle[id][3] = CreateVehicle(OI[id][oVehicle_4], OI[id][oVehicle_4_PosX], OI[id][oVehicle_4_PosY], OI[id][oVehicle_4_PosZ], OI[id][oVehicle_4_PosA], OI[id][oColor_1], OI[id][oColor_2], -1); }
  545. if( OI[ id ][ oVehicle_5 ] != 0 ) { OrgVehicle[id][4] = CreateVehicle(OI[id][oVehicle_5], OI[id][oVehicle_5_PosX], OI[id][oVehicle_5_PosY], OI[id][oVehicle_5_PosZ], OI[id][oVehicle_5_PosA], OI[id][oColor_1], OI[id][oColor_2], -1); }
  546. if( OI[ id ][ oVehicle_6 ] != 0 ) { OrgVehicle[id][5] = CreateVehicle(OI[id][oVehicle_6], OI[id][oVehicle_6_PosX], OI[id][oVehicle_6_PosY], OI[id][oVehicle_6_PosZ], OI[id][oVehicle_6_PosA], OI[id][oColor_1], OI[id][oColor_2], -1); }
  547. if( OI[ id ][ oVehicle_7 ] != 0 ) { OrgVehicle[id][6] = CreateVehicle(OI[id][oVehicle_7], OI[id][oVehicle_7_PosX], OI[id][oVehicle_7_PosY], OI[id][oVehicle_7_PosZ], OI[id][oVehicle_7_PosA], OI[id][oColor_1], OI[id][oColor_2], -1); }
  548. if( OI[ id ][ oVehicle_8 ] != 0 ) { OrgVehicle[id][7] = CreateVehicle(OI[id][oVehicle_8], OI[id][oVehicle_8_PosX], OI[id][oVehicle_8_PosY], OI[id][oVehicle_8_PosZ], OI[id][oVehicle_8_PosA], OI[id][oColor_1], OI[id][oColor_2], -1); }
  549. if( OI[ id ][ oVehicle_9 ] != 0 ) { OrgVehicle[id][8] = CreateVehicle(OI[id][oVehicle_9], OI[id][oVehicle_9_PosX], OI[id][oVehicle_9_PosY], OI[id][oVehicle_9_PosZ], OI[id][oVehicle_9_PosA], OI[id][oColor_1], OI[id][oColor_2], -1); }
  550. if( OI[ id ][ oVehicle_10 ] != 0 ) { OrgVehicle[id][9] = CreateVehicle(OI[id][oVehicle_10], OI[id][oVehicle_10_PosX], OI[id][oVehicle_10_PosY], OI[id][oVehicle_10_PosZ], OI[id][oVehicle_10_PosA], OI[id][oColor_1], OI[id][oColor_2], -1); }
  551. if( OI[ id ][ oVehicle_11 ] != 0 ) { OrgVehicle[id][10] = CreateVehicle(OI[id][oVehicle_11], OI[id][oVehicle_11_PosX], OI[id][oVehicle_11_PosY], OI[id][oVehicle_11_PosZ], OI[id][oVehicle_11_PosA], OI[id][oColor_1], OI[id][oColor_2], -1); }
  552. if( OI[ id ][ oVehicle_12 ] != 0 ) { OrgVehicle[id][11] = CreateVehicle(OI[id][oVehicle_12], OI[id][oVehicle_12_PosX], OI[id][oVehicle_12_PosY], OI[id][oVehicle_12_PosZ], OI[id][oVehicle_12_PosA], OI[id][oColor_1], OI[id][oColor_2], -1); }
  553. Org3D[ id ] = Create3DTextLabel(string10 ,COLOR_GREEN, OI[ id ][ oPosExtX ], OI[ id ][oPosExtY ], OI[ id ][ oPosExtZ ], 25, 0, 1 );
  554. OrgSafeLabel[ id ] = Create3DTextLabel( "{FF6200}Press {FFFFFF}'SPACE' {FF6200}to open safe menu{FF6200}" ,COLOR_GREEN, OI[ id ][ oSafePosX ], OI[ id ][ oSafePosY ], OI[ id ][ oSafePosZ ], 25, OI[ id ][ oVw ], 1);
  555. OrgSafePickup[ id ] = CreateDynamicPickup( 1239, 1, OI[ id ][ oSafePosX ], OI[ id ][ oSafePosY ], OI[ id ][ oSafePosZ ], OI[ id ][ oVw ] );
  556. Orge3D( id );
  557. }
  558. }
  559. return 1;
  560. }
  561.  
  562.  
  563. public OnPlayerConnect(playerid)
  564. {
  565. OrgCreate[ playerid ] = 0;
  566. return 1;
  567. }
  568.  
  569. public OnPlayerSpawn(playerid)
  570. {
  571. if( PI[ playerid ][ xMember ] != 0 ) // spawn in base if player is member of organization
  572. {
  573. new OrgID = PI[ playerid ][ xMember ];
  574. SetPlayerPos( playerid, OI[ OrgID ][ oPosIntX ], OI[ OrgID ][ oPosIntY ] , OI[ OrgID ][ oPosIntZ ] );
  575. SetPlayerHealth( playerid, 40 );
  576. SetCameraBehindPlayer( playerid );
  577. SetPlayerInterior( playerid, OI[ OrgID ][ oInt ] );
  578. SetPlayerVirtualWorld( playerid, OI[ OrgID ][ oVw ]);
  579. }
  580. return 1;
  581. }
  582.  
  583. public OnPlayerStateChange(playerid, newstate, oldstate)
  584. {
  585. if( newstate == PLAYER_STATE_DRIVER ) // Enter Vehicle of organization
  586. {
  587. for( new i = 1; i < MAX_ORG; i++ )
  588. {
  589. for(new d = 0; d < 12; d++)
  590. {
  591. if( GetPlayerVehicleID(playerid) == OrgVehicle[ i ][ d ] ) {
  592. new OrgID = PI[ playerid ][ xMember ];
  593. if( OrgID == i ) { }
  594. else
  595. {
  596. SendClientMessage( playerid, COLOR_RED, "You have not keys of that vehicle." );
  597. RemovePlayerFromVehicle( playerid);
  598. TogglePlayerControllable( playerid, 1 );
  599. }
  600. }
  601. }
  602. }
  603. }
  604. return 1;
  605. }
  606.  
  607. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  608. {
  609. if(newkeys == KEY_SECONDARY_ATTACK) // enter/exit from interior of organization
  610. {
  611. if(GetPlayerState(playerid) == 1)
  612. {
  613. for(new i= 1; i < MAX_ORG; i++)
  614. {
  615. if( IsPlayerInRangeOfPoint( playerid, 2.0, OI[ i ][ oPosExtX ], OI[ i ][ oPosExtY ], OI[ i ][ oPosExtZ ] ) )
  616. {
  617. SetPlayerPos( playerid, OI[ i ][ oPosIntX ], OI[ i ][ oPosIntY ], OI[ i ][ oPosIntZ ] );
  618. SetCameraBehindPlayer( playerid );
  619. SetPlayerInterior( playerid, OI[ i ][ oInt ]);
  620. SetPlayerVirtualWorld( playerid, OI[ i ][ oVw ]);
  621. }
  622. else if( IsPlayerInRangeOfPoint( playerid, 2.0, OI[ i ][ oPosIntX ], OI[ i ][ oPosIntY ], OI[ i ][ oPosIntZ ] ) && GetPlayerVirtualWorld(playerid) == OI[ i ][ oVw ] )
  623. {
  624. SetPlayerPos( playerid, OI[ i ][ oPosExtX ], OI[ i ][ oPosExtY ], OI[ i ][ oPosExtZ ] );
  625. SetCameraBehindPlayer( playerid );
  626. SetPlayerInterior( playerid, 0);
  627. SetPlayerVirtualWorld( playerid, 0);
  628. }
  629. }
  630. }
  631. }
  632. if( newkeys == KEY_SPRINT ) // Activate safe menu
  633. {
  634. new ime_string[128], OrgID = PI[ playerid ][ xMember ];
  635. format( ime_string, sizeof( ime_string ),"{FFFFFF}%s", OI[ OrgID ][ oName ] );
  636. if( OI[ OrgID ][ oSafe ] == 1 )
  637. {
  638. if(IsPlayerInRangeOfPoint(playerid, 1.0, OI[ OrgID ][ oSafePosX ], OI[ OrgID ][ oSafePosY ], OI[ OrgID ][ oSafePosZ ] ) )
  639. {
  640. if( PI[ playerid ][ xMember ] != 0 )
  641. {
  642. ShowPlayerDialog( playerid, DIALOG_OSAFE, DIALOG_STYLE_LIST, ime_string, "Safe info\nTake materials\nPut materials\nTake money\nPut money\nTake drugs\nPut drugs", "Confirm", "Cancel" );
  643. }
  644. }
  645. }
  646. }
  647. return 1;
  648. }
  649.  
  650. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  651. {
  652. if( dialogid == DIALOG_ORGEDIT ) {
  653. if( listitem == 0 ) {
  654. ShowPlayerDialog(playerid, DIALOG_ORGNAME, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter ID and name of organization!", "Confirm", "Cancel" ); }
  655. if( listitem == 1 ) {
  656. ShowPlayerDialog( playerid, DIALOG_ORGINT1, DIALOG_STYLE_LIST, "Dimi Scripting", "Default Interior\nEnter your cordinates", "Confirm", "Cancel" ); }
  657. if( listitem == 2 ) {
  658. ShowPlayerDialog( playerid, DIALOG_ORGRANKS, DIALOG_STYLE_LIST, "Dimi Scripting", "Rank 1\nRank 2\nRank 3\nRank 4\nRank 5\nRank 6", "Confirm", "Cancel" ); }
  659. if( listitem == 3 ) {
  660. ShowPlayerDialog( playerid, DIALOG_ORGSKINS, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter IDs of skins for ranks of organization:\n There must be 6 IDs for each rank(rank1-6)\nExample: 54 29 31 45 123 121", "Confirm", "Cancel" ); }
  661. if( listitem == 4 ) {
  662. ShowPlayerDialog( playerid, DIALOG_ORGTYPE, DIALOG_STYLE_LIST, "Dimi Scripting", "Type: Legal organization\nType: Gang\nType: Mafia", "Confirm", "Cancel" ); }
  663. if( listitem == 5 ) {
  664. SendClientMessage( playerid, COLOR_ORANGE, "To change color of vehicles use '/orgcolor'" ); }
  665. if( listitem == 6 ) {
  666. SendClientMessage( playerid, COLOR_ORANGE, "To add vehicle for organization use '/orgvehicle'" ); }
  667. }
  668. if( dialogid == DIALOG_ORGRANKS ) {
  669. if(listitem == 0) {
  670. ShowPlayerDialog( playerid, DIALOG_ORGRANK1, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 1 of this organization.", "Confirm", "Cancel" ); }
  671. if(listitem == 1) {
  672. ShowPlayerDialog( playerid, DIALOG_ORGRANK2, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 2 of this organization.", "Confirm", "Cancel" ); }
  673. if(listitem == 2) {
  674. ShowPlayerDialog( playerid, DIALOG_ORGRANK3, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 3 of this organization.", "Confirm", "Cancel" ); }
  675. if(listitem == 3) {
  676. ShowPlayerDialog( playerid, DIALOG_ORGRANK4, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 4 of this organization.", "Confirm", "Cancel" ); }
  677. if(listitem == 4) {
  678. ShowPlayerDialog( playerid, DIALOG_ORGRANK5, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 5 of this organization.", "Confirm", "Cancel" ); }
  679. if(listitem == 5) {
  680. ShowPlayerDialog( playerid, DIALOG_ORGRANK6, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 6 of this organization.", "Confirm", "Cancel" ); }
  681. }
  682. if( dialogid == DIALOG_ORGNAME && response ) {
  683. new id, ime[ ORG_NAME ], ImaFajl[ 50 ];
  684. if(sscanf( inputtext, "is[128]", id, ime ) ) return ShowPlayerDialog(playerid, DIALOG_ORGNAME, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter ID and name of organization!", "Confirm", "Cancel");
  685. format( ImaFajl, sizeof( ImaFajl ), O_FILE, id );
  686. if( !fexist( ImaFajl ) ) return SendClientMessage(playerid, COLOR_RED, "That organization doesn't exist." );
  687. if( OrgCreate[ playerid ] == 0 ) {
  688. strmid(OI[id][oName], ime, 0, strlen(ime), ORG_NAME);
  689. SaveOrganization( id ) ; Orge3D( id );
  690. va_SendClientMessage( playerid, COLOR_GREEN, "Promenili ste ime organizacije(ID: %d ) u %s!", id, ime ); }
  691. }
  692. if( dialogid == DIALOG_ORGDELETE && response ) {
  693. new id, ImaFajl[50];
  694. if( !IsNumeric( inputtext ) ) return SendClientMessage( playerid, COLOR_RED, "Unesi samo ID orge!" );
  695. if(sscanf( inputtext, "i", id ) ) return ShowPlayerDialog( playerid, DIALOG_ORGDELETE, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter ID of organization u want to be deleted!", "Confirm", "Cancel" );
  696. format( ImaFajl, sizeof( ImaFajl ), O_FILE, id );
  697. if( !fexist( ImaFajl ) ) return SendClientMessage(playerid, COLOR_RED, "That organization doesn't exist." );
  698. Delete3DTextLabel( Org3D[id] );
  699. DestroyPickup( OrgPickup[id] );
  700. new string[ 128 ];
  701. format( string, sizeof( string ), O_FILE, id );
  702. fremove( string );
  703. va_SendClientMessage( playerid, COLOR_GREEN, "Successfully deleted organization id %d.", id );
  704. }
  705. if( dialogid == DIALOG_ORGSCREATE && response ) {
  706. new id, ImaFajl[50], Float:PozX, Float:PozY, Float:PozZ;
  707. GetPlayerPos( playerid, PozX, PozY, PozZ );
  708. if(sscanf( inputtext, "i", id ) ) return ShowPlayerDialog(playerid, DIALOG_ORGSCREATE, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter ID of organization which make the safe.", "Confirm", "Cancel");
  709. format( ImaFajl, sizeof( ImaFajl ), O_FILE, id );
  710. if( !fexist( ImaFajl ) ) return SendClientMessage(playerid, COLOR_RED, "That organization doesn't exist." );
  711. if( OI[ id ][ oSafe ] == 1 ) return SendClientMessage(playerid, COLOR_RED, "That organization already have safe." );
  712. OI[ id ][ oSafePosX ] = PozX; OI[ id ][ oSafePosY ] = PozY; OI[ id ][ oSafePosZ ] = PozZ;
  713. OI[ id ][ oSafe ] = 1; OI[ id ][ oSafeDrugs ] = 0; OI[ id ][ oSafeMats ] = 0; OI[ id ][ oSafeMoney ] = 0;
  714. SaveOrganization( id );
  715. SendClientMessage( playerid, COLOR_GREEN, "Successfully created safe for organization." );
  716. OrgSafeLabel[ id ] = Create3DTextLabel( "{FF6200}Press {FFFFFF}'SPACE' {FF6200}to open safe menu{FF6200}" ,COLOR_GREEN, OI[ id ][ oSafePosX ], OI[ id ][ oSafePosY ], OI[ id ][ oSafePosZ ], 25, OI[ id ][ oVw ], 1);
  717. OrgSafePickup[ id ] = CreateDynamicPickup( 1239, 1, OI[ id ][ oSafePosX ], OI[ id ][ oSafePosY ], OI[ id ][ oSafePosZ ], OI[ id ][ oVw ] );
  718. Orge3D( id );
  719. }
  720. if( dialogid == DIALOG_ORGCREATE && response ) {
  721. new ime[ ORG_NAME ], fileorge[ 40 ], string[512], Float:PozX, Float:PozY, Float:PozZ;
  722. GetPlayerPos( playerid, PozX, PozY, PozZ );
  723. if(sscanf( inputtext, "s[128]", ime ) ) return ShowPlayerDialog(playerid, DIALOG_ORGCREATE, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter the name of organization!", "Confirm", "Cancel");
  724. for( new id = 1; id < MAX_ORG; id++ ) {
  725. format(fileorge, sizeof( fileorge ), O_FILE, id);
  726. if( !fexist( fileorge ) ) {
  727. strmid(OI[id][oName], ime, 0, strlen(ime), ORG_NAME);
  728. OI[id][oID] = id;
  729. strmid(OI[id][oLeader], "No-one", 0, strlen("No-one"), ORG_LEADER);
  730.  
  731. strmid(OI[id][oMember1], "No-one", 0, strlen("No-one"), ORG_MEMBER);
  732. strmid(OI[id][oMember2], "No-one", 0, strlen("No-one"), ORG_MEMBER);
  733. strmid(OI[id][oMember3], "No-one", 0, strlen("No-one"), ORG_MEMBER);
  734. strmid(OI[id][oMember4], "No-one", 0, strlen("No-one"), ORG_MEMBER);
  735. strmid(OI[id][oMember5], "No-one", 0, strlen("No-one"), ORG_MEMBER);
  736. strmid(OI[id][oMember6], "No-one", 0, strlen("No-one"), ORG_MEMBER);
  737. strmid(OI[id][oMember7], "No-one", 0, strlen("No-one"), ORG_MEMBER);
  738. strmid(OI[id][oMember8], "No-one", 0, strlen("No-one"), ORG_MEMBER);
  739. strmid(OI[id][oMember9], "No-one", 0, strlen("No-one"), ORG_MEMBER);
  740. strmid(OI[id][oMember10], "No-one", 0, strlen("No-one"), ORG_MEMBER);
  741. strmid(OI[id][oMember11], "No-one", 0, strlen("No-one"), ORG_MEMBER);
  742. strmid(OI[id][oMember12], "No-one", 0, strlen("No-one"), ORG_MEMBER);
  743.  
  744. OI[id][oColor_1] = -1; OI[id][oColor_2] = -1;
  745. OI[id][oPosExtX] = PozX; OI[id][oPosExtY] = PozY; OI[id][oPosExtZ] = PozZ;
  746.  
  747. OI[ id ][ oSafePosX ] = 0; OI[ id ][ oSafePosY ] = 0; OI[ id ][ oSafePosZ ] = 0;
  748. OI[ id ][ oSafe ] = 0; OI[ id ][ oSafeDrugs ] = 0; OI[ id ][ oSafeMats ] = 0; OI[ id ][ oSafeMoney ] = 0;
  749.  
  750. OrgCreate[ playerid ] = id;
  751. SaveOrganization( id) ;
  752. format(string,sizeof(string),"{FFFFFF}%s\n{FF6200}Leader: {FFFFFF}%s\n{FF6200}For entrance click\n{FFFFFF}'ENTER'", OI[ id ][ oName ], OI[ id ][ oLeader ] );
  753. Org3D[ id ] = Create3DTextLabel(string , COLOR_GREEN, PozX, PozY, PozZ, 25, 0, 1);
  754. OrgPickup[ id ] = CreateDynamicPickup(1314, 1, PozX, PozY, PozZ);
  755. ShowPlayerDialog( playerid, DIALOG_ORGINT1, DIALOG_STYLE_LIST, "Dimi Scripting", "Default Interior\nEnter your cordinates", "Confirm", "Cancel" );
  756. break; } }
  757. }
  758. if(dialogid == DIALOG_ORGINT1 && response) {
  759. new id = IsPlayerNearOrganization(playerid);
  760. if( listitem == 0 ) {
  761. if( OrgCreate[ playerid ] == 0 ) {
  762. OI[ id ][ oPosIntX ] = 246.7840;
  763. OI[ id ][ oPosIntY ] = 63.9002;
  764. OI[ id ][ oPosIntZ ] = 1003.6406;
  765. OI[ id ][ oInt ] = 6;
  766. OI[ id ][ oVw ] = id;
  767. SaveOrganization( id ); SendClientMessage( playerid, COLOR_GREEN, "Successfully maked default interior!" ); }
  768. else {
  769. OI[ id ][ oPosIntX ] = 246.7840;
  770. OI[ id ][ oPosIntY ] = 63.9002;
  771. OI[ id ][ oPosIntZ ] = 1003.6406;
  772. OI[ id ][ oInt ] = 6;
  773. OI[ id ][ oVw ] = id;
  774. SaveOrganization( id );
  775. ShowPlayerDialog( playerid, DIALOG_ORGTYPE, DIALOG_STYLE_LIST, "Dimi Scripting", "Type: Legal organization\nType: Gang\nType: Mafia", "Confirm", "Cancel" ); } }
  776. if( listitem == 1 ) {
  777. ShowPlayerDialog( playerid, DIALOG_ORGINT2, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter cordinates of interior and ID of interior\n Example: 246.7840 63.9002 1003.6406 6", "Confirm", "Cancel" ); }
  778. }
  779. if(dialogid == DIALOG_ORGINT2 && response) {
  780. new id = IsPlayerNearOrganization(playerid);
  781. new Float:Poz[3];
  782. new intid;
  783. if(sscanf(inputtext, "fffi", Poz[0],Poz[1],Poz[2],intid)) return ShowPlayerDialog(playerid, DIALOG_ORGINT2, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter cordinates of interior and ID of interior\n Example: 246.7840 63.9002 1003.6406 6", "Confirm", "Cancel" );
  784. if( OrgCreate[ playerid ] == 0 ) {
  785. OI[ id ][ oPosIntX ] = Poz[0];
  786. OI[ id ][ oPosIntY ] = Poz[1];
  787. OI[ id ][ oPosIntZ ] = Poz[2];
  788. OI[ id ][ oInt ] = intid;
  789. OI[ id ][ oVw ] = id;
  790. SaveOrganization( id ); SendClientMessage( playerid, COLOR_RED, "Successfully changed interior!" ); }
  791. else {
  792. OI[ id ][ oPosIntX ] = Poz[0];
  793. OI[ id ][ oPosIntY ] = Poz[1];
  794. OI[ id ][ oPosIntZ ] = Poz[2];
  795. OI[ id ][ oInt ] = intid;
  796. OI[ id ][ oVw ] = id;
  797. SaveOrganization( id );
  798. ShowPlayerDialog( playerid, DIALOG_ORGTYPE, DIALOG_STYLE_LIST, "Dimi Scripting", "Type: Legal organization\nType: Gang\nType: Mafia", "Confirm", "Cancel" ); }
  799. }
  800. if(dialogid == DIALOG_ORGTYPE && response) {
  801. new id = IsPlayerNearOrganization(playerid);
  802. if( OrgCreate[ playerid ] == 0 ) {
  803. if(listitem == 0) {
  804. OI[ id ][ oType ] = 1;
  805. SaveOrganization( id );
  806. SendClientMessage(playerid, COLOR_GREEN, "Type : Legal organization" ); }
  807. if(listitem == 1) {
  808. OI[ id][ oType ] = 2;
  809. SaveOrganization( id );
  810. SendClientMessage(playerid, COLOR_GREEN, "Type : Gang" ); }
  811. if(listitem == 2) {
  812. OI[ id ][ oType ] = 3;
  813. SaveOrganization( id );
  814. SendClientMessage(playerid, COLOR_GREEN, "Type : Mafia" ); } }
  815. else {
  816. if(listitem == 0) {
  817. OI[ id ][ oType ] = 1;
  818. SaveOrganization( id );
  819. SendClientMessage(playerid, COLOR_GREEN, "Type : Legal organization" ); }
  820. if(listitem == 1) {
  821. OI[ id][ oType ] = 2;
  822. SaveOrganization( id );
  823. SendClientMessage(playerid, COLOR_GREEN, "Type : Gang" ); }
  824. if(listitem == 2) {
  825. OI[ id ][ oType ] = 3;
  826. SaveOrganization( id );
  827. SendClientMessage(playerid, COLOR_GREEN, "Type : Mafia" ); }
  828. ShowPlayerDialog(playerid, DIALOG_ORGSKINS, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter IDs of skins for ranks of organization:\n There must be 6 IDs for each rank(rank1-6)\nExample: 54 29 31 45 123 121", "Confirm", "Cancel"); }
  829. return 1;
  830. }
  831. if(dialogid == DIALOG_ORGSKINS && response) {
  832. new id = IsPlayerNearOrganization(playerid);
  833. new rank1, rank2, rank3, rank4, rank5, rank6;
  834. if(sscanf(inputtext, "iiiiii", rank1, rank2, rank3, rank4, rank5, rank6)) return ShowPlayerDialog(playerid, DIALOG_ORGSKINS, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter IDs of skins for ranks of organization:\n There must be 6 IDs for each rank(rank1-6)\nExample: 54 29 31 45 123 121", "Confirm", "Cancel" );
  835. if( OrgCreate[ playerid ] == 0 ) {
  836. OI[ id ][ oSkin1 ] = rank1;
  837. OI[ id ][ oSkin2 ] = rank2;
  838. OI[ id ][ oSkin3 ] = rank3;
  839. OI[ id ][ oSkin4 ] = rank4;
  840. OI[ id ][ oSkin5 ] = rank5;
  841. OI[ id ][ oSkin6 ] = rank6;
  842. SaveOrganization( id ); SendClientMessage( playerid, COLOR_GREEN, "Successfully changed IDs of skins for ranks." ); }
  843. else {
  844. OI[ id ][ oSkin1 ] = rank1;
  845. OI[ id ][ oSkin2 ] = rank2;
  846. OI[ id ][ oSkin3 ] = rank3;
  847. OI[ id ][ oSkin4 ] = rank4;
  848. OI[ id ][ oSkin5 ] = rank5;
  849. OI[ id ][ oSkin6 ] = rank6;
  850. SaveOrganization( id );
  851. ShowPlayerDialog( playerid, DIALOG_ORGRANK1, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 1 of this organization.", "Confirm", "Cancel" ); }
  852. }
  853. if(dialogid == DIALOG_ORGRANK1) {
  854. new id = IsPlayerNearOrganization(playerid);
  855. new ime[ORG_RANK];
  856. if(sscanf(inputtext, "s[64]", ime)) return ShowPlayerDialog(playerid, DIALOG_ORGRANK1, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 1 of this organization.", "Confirm", "Cancel" );
  857. if( OrgCreate[ playerid ] == 0 ) {
  858. strmid( OI[ id ][ oRank1 ], ime, 0, strlen(ime), ORG_RANK);
  859. SaveOrganization(id);
  860. va_SendClientMessage( playerid, COLOR_GREEN, "The name of this rank is %s", OI[ id ][ oRank1 ] ); }
  861. else {
  862. strmid( OI[ id ][ oRank1 ], ime, 0, strlen(ime), ORG_RANK);
  863. SaveOrganization(id);
  864. va_SendClientMessage( playerid, COLOR_GREEN, "The name of this rank is %s", OI[ id ][ oRank1 ] );
  865. ShowPlayerDialog( playerid, DIALOG_ORGRANK2, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 2 of this organization.", "Confirm", "Cancel" ); }
  866. }
  867. if(dialogid == DIALOG_ORGRANK2) {
  868. new id = IsPlayerNearOrganization(playerid);
  869. new ime[ORG_RANK];
  870. if(sscanf(inputtext, "s[64]", ime)) return ShowPlayerDialog(playerid, DIALOG_ORGRANK2, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 2 of this organization.", "Confirm", "Cancel" );
  871. if( OrgCreate[ playerid ] == 0 ) {
  872. strmid( OI[ id ][ oRank2 ], ime, 0, strlen(ime), ORG_RANK);
  873. SaveOrganization(id);
  874. va_SendClientMessage(playerid, COLOR_GREEN, "The name of this rank is %s", OI[ id ][ oRank2 ]); }
  875. else {
  876. strmid( OI[ id ][ oRank2 ], ime, 0, strlen(ime), ORG_RANK);
  877. SaveOrganization(id);
  878. va_SendClientMessage(playerid, COLOR_GREEN, "The name of this rank is %s", OI[ id ][ oRank2 ]);
  879. ShowPlayerDialog(playerid, DIALOG_ORGRANK3, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 3 of this organization.", "Confirm", "Cancel"); }
  880. }
  881. if(dialogid == DIALOG_ORGRANK3) {
  882. new id = IsPlayerNearOrganization(playerid);
  883. new ime[ORG_RANK];
  884. if(sscanf(inputtext, "s[64]", ime)) return ShowPlayerDialog(playerid, DIALOG_ORGRANK3, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 3 of this organization.", "Confirm", "Cancel" );
  885. if( OrgCreate[ playerid ] == 0 ) {
  886. strmid(OI[ id ][ oRank3 ], ime, 0, strlen(ime), ORG_RANK);
  887. SaveOrganization(id);
  888. va_SendClientMessage(playerid, COLOR_GREEN, "The name of this rank is %s", OI[ id ][ oRank3 ]); }
  889. else {
  890. strmid(OI[ id ][ oRank3 ], ime, 0, strlen(ime), ORG_RANK);
  891. SaveOrganization(id);
  892. va_SendClientMessage(playerid, COLOR_GREEN, "The name of this rank is %s", OI[ id ][ oRank3 ]);
  893. ShowPlayerDialog(playerid, DIALOG_ORGRANK4, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 4 of this organization.", "Confirm", "Cancel" ); }
  894. }
  895. if(dialogid == DIALOG_ORGRANK4) {
  896. new id = IsPlayerNearOrganization(playerid);
  897. new ime[ORG_RANK];
  898. if(sscanf(inputtext, "s[64]", ime)) return ShowPlayerDialog(playerid, DIALOG_ORGRANK4, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 4 of this organization.", "Confirm", "Cancel" );
  899. if( OrgCreate[ playerid ] == 0 ) {
  900. strmid( OI[ id][ oRank4 ], ime, 0, strlen(ime), ORG_RANK);
  901. SaveOrganization(id);
  902. va_SendClientMessage(playerid, COLOR_GREEN, "The name of this rank is %s", OI[id][ oRank4 ]); }
  903. else {
  904. strmid( OI[ id][ oRank4 ], ime, 0, strlen(ime), ORG_RANK);
  905. SaveOrganization(id);
  906. va_SendClientMessage(playerid, COLOR_GREEN, "The name of this rank is %s", OI[id][ oRank4 ]);
  907. ShowPlayerDialog(playerid, DIALOG_ORGRANK5, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 5 of this organization.", "Confirm", "Cancel" ); }
  908. }
  909. if(dialogid == DIALOG_ORGRANK5) {
  910. new id = IsPlayerNearOrganization(playerid);
  911. new ime[ORG_RANK];
  912. if(sscanf(inputtext, "s[64]", ime)) return ShowPlayerDialog(playerid, DIALOG_ORGRANK5, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 5 of this organization.", "Confirm", "Cancel" );
  913. if( OrgCreate[ playerid ] == 0 ) {
  914. strmid( OI[ id ][ oRank5 ], ime, 0, strlen(ime), ORG_RANK);
  915. SaveOrganization(id);
  916. va_SendClientMessage(playerid, COLOR_GREEN, "The name of this rank is %s", OI[ id ][ oRank5 ]); }
  917. else {
  918. strmid( OI[ id ][ oRank5 ], ime, 0, strlen(ime), ORG_RANK);
  919. SaveOrganization(id);
  920. va_SendClientMessage(playerid, COLOR_GREEN, "The name of this rank is %s", OI[ id ][ oRank5 ]);
  921. ShowPlayerDialog(playerid, DIALOG_ORGRANK6, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 6 of this organization.", "Confirm", "Cancel" ); }
  922. }
  923. if(dialogid == DIALOG_ORGRANK6) {
  924. new id = IsPlayerNearOrganization(playerid);
  925. new ime[ORG_RANK];
  926. if( sscanf( inputtext, "s[64]", ime ) ) return ShowPlayerDialog( playerid, DIALOG_ORGRANK6, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 6 of this organization.", "Confirm", "Cancel" );
  927. strmid( OI[ id ][ oRank6 ], ime, 0, strlen(ime), ORG_RANK);
  928. SaveOrganization( id );
  929. va_SendClientMessage( playerid, COLOR_GREEN, "The name of this rank is %s", OI[ id ][ oRank6 ] );
  930. OrgCreate[ playerid ] = 0;
  931. }
  932. if( dialogid == DIALOG_LEADER && response ) {
  933. switch(listitem) {
  934. case 0: {
  935. ShowPlayerDialog(playerid, DIALOG_INVITE, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter ID of player who want invite.", "Confirm", "Cancel"); }
  936. case 1: {
  937. ShowPlayerDialog(playerid, DIALOG_UNINVITE, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter ID of player who want uninvite.", "Confirm", "Cancel"); }
  938. case 2: {
  939. ShowPlayerDialog(playerid, DIALOG_GIVERANK, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter ID of player and number of rank which u want give to player.", "Confirm", "Cancel"); }
  940. case 3: {
  941. new cla_string[ 512 ], OrgID = PI[ playerid ][ xLeader ];
  942. format( cla_string, sizeof( cla_string ), "Leader: %s\nMember 1: %s\nMember 2: %s\nMember 3: %s\nMember 4: %s\nMember 5: %s\nMember 6: %s\nMember 7: %s\nMember 8: %s\nMember 9: %s\nMember 10: %s\nMember 11: %s\nMember 12: %s" ,
  943. OI[ OrgID ][ oLeader ],
  944. OI[ OrgID ][ oMember1 ],
  945. OI[ OrgID ][ oMember2 ],
  946. OI[ OrgID ][ oMember3 ],
  947. OI[ OrgID ][ oMember4 ],
  948. OI[ OrgID ][ oMember5 ],
  949. OI[ OrgID ][ oMember6 ],
  950. OI[ OrgID ][ oMember7 ],
  951. OI[ OrgID ][ oMember8 ],
  952. OI[ OrgID ][ oMember9 ],
  953. OI[ OrgID ][ oMember10 ],
  954. OI[ OrgID ][ oMember11 ],
  955. OI[ OrgID ][ oMember12 ] );
  956. ShowPlayerDialog(playerid, DIALOG_ALLMEMBERS, DIALOG_STYLE_MSGBOX, "Dimi Scripting", cla_string, "Confirm", "Cancel"); } }
  957. }
  958. if( dialogid == DIALOG_INVITE && response ) {
  959. new igrac;
  960. if( sscanf( inputtext, "u", igrac ) ) return SendClientMessage( playerid, COLOR_RED, "Irregural ID" );
  961. if( igrac == INVALID_PLAYER_ID ) return SendClientMessage( playerid, COLOR_RED, "Player is offline or wrong ID!" );
  962. if( PI[ igrac ][ xMember ] != 0 ) return SendClientMessage( playerid, COLOR_RED, "Player is already member of some organization!" );
  963. if( PI[ igrac ][ xLeader ] != 0 ) return SendClientMessage( playerid, COLOR_RED, "Player is already member of some organization!" );
  964. if( PI[ igrac ][ xLevel ] < 2 ) return SendClientMessage( playerid, COLOR_RED, "Level of this player is less then 2!" );
  965. new OrgID = PI[ playerid ][ xLeader ], ime[ MAX_PLAYER_NAME ];
  966. GetPlayerName(igrac, ime, sizeof ime);
  967. if( !strcmp( OI[ OrgID ][ oMember1 ], "No-one", true ) ) { strmid( OI[ OrgID ][ oMember1 ], ime, 0, strlen(ime), 255); }
  968. else if( !strcmp( OI[ OrgID ][ oMember2 ], "No-one", true ) ) { strmid( OI[ OrgID ][ oMember2 ], ime, 0, strlen(ime), 255); }
  969. else if( !strcmp( OI[ OrgID ][ oMember3 ], "No-one", true ) ) { strmid( OI[ OrgID ][ oMember3 ], ime, 0, strlen(ime), 255); }
  970. else if( !strcmp( OI[ OrgID ][ oMember4 ], "No-one", true ) ) { strmid( OI[ OrgID ][ oMember4 ], ime, 0, strlen(ime), 255); }
  971. else if( !strcmp( OI[ OrgID ][ oMember5 ], "No-one", true ) ) { strmid( OI[ OrgID ][ oMember5 ], ime, 0, strlen(ime), 255); }
  972. else if( !strcmp( OI[ OrgID ][ oMember6 ], "No-one", true ) ) { strmid( OI[ OrgID ][ oMember6 ], ime, 0, strlen(ime), 255); }
  973. else if( !strcmp( OI[ OrgID ][ oMember7 ], "No-one", true ) ) { strmid( OI[ OrgID ][ oMember7 ], ime, 0, strlen(ime), 255); }
  974. else if( !strcmp( OI[ OrgID ][ oMember8 ], "No-one", true ) ) { strmid( OI[ OrgID ][ oMember8 ], ime, 0, strlen(ime), 255); }
  975. else if( !strcmp( OI[ OrgID ][ oMember9 ], "No-one", true ) ) { strmid( OI[ OrgID ][ oMember9 ], ime, 0, strlen(ime), 255); }
  976. else if( !strcmp( OI[ OrgID ][ oMember10 ], "No-one", true ) ) { strmid( OI[ OrgID ][ oMember10 ], ime, 0, strlen(ime), 255); }
  977. else if( !strcmp( OI[ OrgID ][ oMember11 ], "No-one", true ) ) { strmid( OI[ OrgID ][ oMember11 ], ime, 0, strlen(ime), 255); }
  978. else if( !strcmp( OI[ OrgID ][ oMember12 ], "No-one", true ) ) { strmid( OI[ OrgID ][ oMember12 ], ime, 0, strlen(ime), 255); }
  979. else { SendClientMessage( playerid, COLOR_RED,"You have a maximum members in your organization!" ); return true; }
  980. PI[ igrac ][ xMember ] = OrgID; PI[ igrac ][ xRank ] = 1;
  981. PI[ igrac ][ xSkin ] = OI[ OrgID ][ oSkin1 ];
  982. SetPlayerSkin( igrac, OI[ OrgID ][ oSkin1 ] );
  983. SaveOrganization( OrgID );
  984. va_SendClientMessage(igrac, COLOR_GREEN, "Congratulations, you enter in organization %s, by leader %s.", OI[ OrgID ][ oName ], OI[ OrgID ][ oLeader ] );
  985. va_SendClientMessage(playerid, COLOR_GREEN, "You invite %s in your organization.", ime);
  986. }
  987. if( dialogid == DIALOG_UNINVITE && response ) {
  988. new igrac, OrgID = PI[ playerid ][ xLeader ];
  989. if( sscanf( inputtext, "u", igrac ) ) return SendClientMessage( playerid, COLOR_RED, "Irregural ID!" );
  990. if( igrac == INVALID_PLAYER_ID ) return SendClientMessage( playerid, COLOR_RED, "Player is offline or wrong ID!" );
  991. if( PI[ igrac ][ xMember ] != OrgID ) return SendClientMessage( playerid, COLOR_RED, "Player is not a member of your organization!" );
  992. if( strcmp( PlayerName(igrac), OI[ OrgID ][ oMember1 ], true ) == 0) { strmid( OI[ OrgID ][ oMember1], "No-one", 0, strlen("No-one"), 255); }
  993. else if( strcmp( PlayerName(igrac), OI[ OrgID ][ oMember2 ], true ) == 0) { strmid( OI[ OrgID ][ oMember2 ], "No-one", 0, strlen("No-one"), 255 ); }
  994. else if( strcmp( PlayerName(igrac), OI[ OrgID ][ oMember3 ], true ) == 0) { strmid( OI[ OrgID ][ oMember3 ], "No-one", 0, strlen("No-one"), 255 ); }
  995. else if( strcmp( PlayerName(igrac), OI[ OrgID ][ oMember4 ], true ) == 0) { strmid( OI[ OrgID ][ oMember4 ], "No-one", 0, strlen("No-one"), 255 ); }
  996. else if( strcmp( PlayerName(igrac), OI[ OrgID ][ oMember5 ], true ) == 0) { strmid( OI[ OrgID ][ oMember5 ], "No-one", 0, strlen("No-one"), 255 ); }
  997. else if( strcmp( PlayerName(igrac), OI[ OrgID ][ oMember6 ], true ) == 0) { strmid( OI[ OrgID ][ oMember6 ], "No-one", 0, strlen("No-one"), 255 ); }
  998. else if( strcmp( PlayerName(igrac), OI[ OrgID ][ oMember7 ], true ) == 0) { strmid( OI[ OrgID ][ oMember7 ], "No-one", 0, strlen("No-one"), 255 ); }
  999. else if( strcmp( PlayerName(igrac), OI[ OrgID ][ oMember8 ], true ) == 0) { strmid( OI[ OrgID ][ oMember8 ], "No-one", 0, strlen("No-one"), 255 ); }
  1000. else if( strcmp( PlayerName(igrac), OI[ OrgID ][ oMember9 ], true ) == 0) { strmid( OI[ OrgID ][ oMember9 ], "No-one", 0, strlen("No-one"), 255 ); }
  1001. else if( strcmp( PlayerName(igrac), OI[ OrgID ][ oMember10 ], true ) == 0) { strmid( OI[ OrgID ][ oMember10 ], "No-one", 0, strlen("No-one"), 255 ); }
  1002. else if( strcmp( PlayerName(igrac), OI[ OrgID ][ oMember11 ], true ) == 0) { strmid( OI[ OrgID ][ oMember11 ], "No-one", 0, strlen("No-one"), 255 ); }
  1003. else if( strcmp( PlayerName(igrac), OI[ OrgID ][ oMember12 ], true ) == 0) { strmid( OI[ OrgID ][ oMember12 ], "No-one", 0, strlen("No-one"), 255 ); }
  1004. else { SendClientMessage( playerid, COLOR_RED, "lalala!" ); return true; }
  1005. PI[ igrac ][ xMember ] = 0; PI[ igrac ][ xRank ] = 0; PI[ igrac ][ xSkin ] = 5;
  1006. SetPlayerSkin( igrac, 5 );
  1007. SaveOrganization( OrgID );
  1008. va_SendClientMessage(igrac, COLOR_RED, "You are uninvite from organization %s.", OI[ OrgID ][ oName ]);
  1009. va_SendClientMessage(playerid, COLOR_RED, "You uninvite %s from your organization.", PlayerName(igrac));
  1010. }
  1011. if( dialogid == DIALOG_GIVERANK && response ) {
  1012. new member, OrgID = PI[ playerid ][ xLeader ], rank;
  1013. if( sscanf( inputtext, "ui", member, rank ) ) return ShowPlayerDialog(playerid, DIALOG_GIVERANK, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter ID of player and number of rank which u want give to player.", "Confirm", "Cancel");
  1014. if( rank < 1 || rank > 5) return SendClientMessage( playerid, COLOR_RED, "Rank can't be bigger then 5 and lower then 1.!" );
  1015. if( member == INVALID_PLAYER_ID ) return SendClientMessage( playerid, COLOR_RED, "Player is offline or wrong ID!" );
  1016. if( PI[ member ][ xMember ] != OrgID ) return SendClientMessage( playerid, COLOR_RED, "Player is not a member of your organization." );
  1017. if( rank == 1 ) { PI[ member ][ xSkin ] = OI[ OrgID ][ oSkin1 ]; SetPlayerSkin( member, OI[ OrgID ][ oSkin1 ] ); }
  1018. else if( rank == 2 ) { PI[ member ][ xSkin ] = OI[ OrgID ][ oSkin2 ]; SetPlayerSkin( member, OI[ OrgID ][ oSkin2 ] ); }
  1019. else if( rank == 3 ) { PI[ member ][ xSkin ] = OI[ OrgID ][ oSkin3 ]; SetPlayerSkin( member, OI[ OrgID ][ oSkin3 ] ); }
  1020. else if( rank == 4 ) { PI[ member ][ xSkin ] = OI[ OrgID ][ oSkin4 ]; SetPlayerSkin( member, OI[ OrgID ][ oSkin4 ] ); }
  1021. else if( rank == 5 ) { PI[ member ][ xSkin ] = OI[ OrgID ][ oSkin5 ]; SetPlayerSkin( member, OI[ OrgID ][ oSkin5 ] ); }
  1022. else { return true; }
  1023. PI[ member ][ xRank ] = rank;
  1024. va_SendClientMessage( member, COLOR_GREEN, "Lider give u rank %d!", rank );
  1025. va_SendClientMessage( playerid, COLOR_GREEN, "U give rank %d to player %s!", PlayerName( member ), rank );
  1026. }
  1027. if( dialogid == DIALOG_OSAFE ) {
  1028. if( !response ) return true;
  1029. new string[ 256 ], OrgID = PI[ playerid ][ xMember ];
  1030. switch(listitem) {
  1031. case 0: {
  1032. format(string,sizeof(string),"{FFFFFF}%s {FF6200}Sef information\n\n{FF6200}Materials: {FFFFFF}%d\n{FF6200}Money: {FFFFFF}%d$\n{FF6200}Drugs: {FFFFFF}%d", OI[ OrgID ][ oName ], OI[ OrgID ][ oSafeMats ], OI[ OrgID ][ oSafeMoney ], OI[ OrgID ][ oSafeDrugs ] );
  1033. ShowPlayerDialog( playerid, DIALOG_SAFE_INFO, DIALOG_STYLE_MSGBOX, "Dimi Scripting", string, "Confirm", "Cancel" ); }
  1034. case 1: {
  1035. if( PI[ playerid ][ xLeader ] == 0) return SendClientMessage( playerid, COLOR_RED, "Only leader can take from safe!" );
  1036. ShowPlayerDialog( playerid, DIALOG_SAFE_TMATS, DIALOG_STYLE_INPUT , "Dimi Scripting", "Enter the amount of materials which u want take.", "Take", "Cancel" ); }
  1037. case 2: {
  1038. ShowPlayerDialog( playerid, DIALOG_SAFE_PMATS, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter the amount of materials which u want put", "Put", "Cancel" ); }
  1039. case 3: {
  1040. if( PI[ playerid ][ xLeader ] == 0) return SendClientMessage( playerid, COLOR_RED, "Only leader can take from safe!" );
  1041. ShowPlayerDialog( playerid, DIALOG_SAFE_TMONEY, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter the amount of money which u want take", "Take", "Cancel" ); }
  1042. case 4: {
  1043. ShowPlayerDialog( playerid, DIALOG_SAFE_DMONEY, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter the amount of money which u want put.", "Put", "Cancel" ); }
  1044. case 5: {
  1045. if( PI[ playerid ][ xLeader ] == 0) return SendClientMessage( playerid, COLOR_RED, "Only leader can take from safe!" );
  1046. ShowPlayerDialog( playerid, DIALOG_SAFE_TDRUGS, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter the amount of drugs which u want take.", "Take", "Cancel" ); }
  1047. case 6: {
  1048. ShowPlayerDialog( playerid, DIALOG_SAFE_PDRUGS, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter the amount of drugs which u want put.", "Put", "Cancel" ); } }
  1049. }
  1050. if( dialogid == DIALOG_SAFE_TMATS ) {
  1051. if( !response ) return true;
  1052. if( response ) {
  1053. new iznos, string[ 256 ], OrgID = PI[ playerid ][ xMember ];
  1054. if( sscanf( inputtext, "i", iznos ) ) return SendClientMessage( playerid, COLOR_RED, "You did not enter amount of materials.!" );
  1055. if( iznos < 1 || iznos > 10000 ) return SendClientMessage( playerid, COLOR_RED, "Amount of materials can't be lower then 1 and bigger then 10000." );
  1056. if( iznos > OI[ OrgID ][ oSafeMats ] ) return SendClientMessage( playerid, COLOR_RED, "No such materials in a safe!" );
  1057. PI[ playerid ][ xMats ] += iznos; OI[ OrgID ][ oSafeMats ] -= iznos; SaveOrganization( OrgID );
  1058. va_SendClientMessage( playerid, COLOR_GREEN,"You take %d materials from safe.!", iznos );
  1059. format(string, sizeof(string), "* %s take some things from safe.", PlayerName( playerid ) );
  1060. ProxDetector( 20.0, playerid ,string,COLOR_PURPLE ); }
  1061. }
  1062. if( dialogid == DIALOG_SAFE_PMATS ) {
  1063. if( !response ) return true;
  1064. if( response ) {
  1065. new iznos, string[ 256 ], OrgID = PI[ playerid ][ xMember ];
  1066. if( sscanf( inputtext, "i", iznos ) ) return SendClientMessage( playerid, COLOR_RED, "You did not enter amount of materials!" );
  1067. if( iznos < 1 || iznos > 10000 ) return SendClientMessage( playerid, COLOR_RED, "Amount of materials can't be lower then 1 and bigger then 10000." );
  1068. if( iznos > PI[ playerid ][ xMats ] ) return SendClientMessage( playerid, COLOR_RED, "No such materials with you!" );
  1069. PI[ playerid ][ xMats ] -= iznos; OI[ OrgID ][ oSafeMats ] += iznos; SaveOrganization( OrgID );
  1070. va_SendClientMessage( playerid, COLOR_GREEN,"You put %d materials in safe!", iznos );
  1071. format(string, sizeof(string), "* %s put some things in safe.", PlayerName( playerid ) );
  1072. ProxDetector( 20.0, playerid ,string,COLOR_PURPLE ); }
  1073. }
  1074. if( dialogid == DIALOG_SAFE_TDRUGS ) {
  1075. if( !response ) return true;
  1076. if( response ) {
  1077. new iznos, string[ 256 ], OrgID = PI[ playerid ][ xMember ];
  1078. if( sscanf( inputtext, "i", iznos ) ) return SendClientMessage( playerid, COLOR_RED, "You did not enter amount of drugs!" );
  1079. if( iznos < 1 || iznos > 10000 ) return SendClientMessage( playerid, COLOR_RED, "Amount of drugs can't be lower then 1 and bigger then 10000." );
  1080. if( iznos > OI[ OrgID ][ oSafeDrugs ] ) return SendClientMessage( playerid, COLOR_RED, "No such drugs in a safe!" );
  1081. PI[ playerid ][ xDrugs ] += iznos; OI[ OrgID ][ oSafeDrugs ] -= iznos; SaveOrganization( OrgID );
  1082. va_SendClientMessage( playerid, COLOR_GREEN,"You take %dg drugs from safe.!", iznos );
  1083. format(string, sizeof(string), "* %s take some things from safe.", PlayerName( playerid ) );
  1084. ProxDetector( 20.0, playerid ,string,COLOR_PURPLE ); }
  1085. }
  1086. if( dialogid == DIALOG_SAFE_PDRUGS ) {
  1087. if( !response ) return true;
  1088. if( response ) {
  1089. new iznos, string[ 256 ], OrgID = PI[ playerid ][ xMember ];
  1090. if( sscanf( inputtext, "i", iznos ) ) return SendClientMessage( playerid, COLOR_RED, "You did not enter amount of drugs!" );
  1091. if( iznos < 1 || iznos > 10000 ) return SendClientMessage( playerid, COLOR_RED, "Amount of drugs can't be lower then 1 and bigger then 10000." );
  1092. if( iznos > PI[ playerid ][ xDrugs ] ) return SendClientMessage( playerid, COLOR_RED, "No such drugs with you!" );
  1093. PI[ playerid ][ xDrugs ] -= iznos; OI[ OrgID ][ oSafeDrugs ] += iznos; SaveOrganization( OrgID );
  1094. va_SendClientMessage( playerid, COLOR_GREEN,"You put %dg drugs in safe!", iznos );
  1095. format(string, sizeof(string), "* %s put some things in safe.", PlayerName( playerid ) );
  1096. ProxDetector( 20.0, playerid ,string,COLOR_PURPLE ); }
  1097. }
  1098. if(dialogid == DIALOG_SAFE_TMONEY)
  1099. {
  1100. if(!response) return true;
  1101. if(response)
  1102. {
  1103. new iznos,string[256], OrgID = PI[ playerid ][ xMember ];
  1104. if(sscanf(inputtext, "i", iznos)) return SendClientMessage( playerid, COLOR_RED, "You did not enter amount of money!");
  1105. if(iznos < 1 || iznos > 10000) return SendClientMessage( playerid, COLOR_RED, "Amount of money can't be lower then 1 and bigger then 10000.");
  1106. if(iznos > OI[ OrgID ][ oSafeMoney ]) return SendClientMessage( playerid, COLOR_RED, "No such money in a safe!");
  1107. GivePlayerMoney(playerid, iznos); OI[ OrgID ][ oSafeMoney ] -= iznos; SaveOrganization( OrgID );
  1108. va_SendClientMessage( playerid, COLOR_GREEN, "You take %d$ money from safe.!",iznos);
  1109. format(string, sizeof(string), "* %s take some things from safe.", PlayerName(playerid));
  1110. ProxDetector(20.0,playerid,string,COLOR_PURPLE ); }
  1111. }
  1112. if(dialogid == DIALOG_SAFE_DMONEY)
  1113. {
  1114. if( !response ) return true;
  1115. if( response )
  1116. {
  1117. new iznos,string[256], OrgID = PI[ playerid ][ xMember ];
  1118. if(sscanf(inputtext, "i", iznos)) return SendClientMessage( playerid, COLOR_RED, "You did not enter amount of money!");
  1119. if(iznos < 1 || iznos > 10000) return SendClientMessage( playerid, COLOR_RED, "Amount of money can't be lower then 1 and bigger then 10000.");
  1120. if(iznos > GetPlayerMoney(playerid)) return SendClientMessage( playerid, COLOR_RED, "No such money with you!");
  1121. GivePlayerMoney(playerid, -iznos); OI[ OrgID ][ oSafeMoney ] += iznos; SaveOrganization( OrgID );
  1122. va_SendClientMessage( playerid, COLOR_GREEN, "You put %d$ money in safe!",iznos);
  1123. format(string, sizeof(string), "* %s put some things in safe.", PlayerName(playerid));
  1124. ProxDetector(20.0,playerid,string,COLOR_PURPLE ); }
  1125. }
  1126. return 1;
  1127. }
  1128.  
  1129. // Org System
  1130. YCMD:leader(playerid, params[], help) { // leader command
  1131. if( PI [ playerid ][ xLeader ] < 1) return SendClientMessage( playerid, COLOR_RED, "You can't use this command. " );
  1132. ShowPlayerDialog( playerid, DIALOG_LEADER, DIALOG_STYLE_LIST, "Dimi Scripting", "Invite player\nUninvite player\nGive rank\nAll members", "Confirm", "Cancel" );
  1133. return true;
  1134. }
  1135.  
  1136. YCMD:orghelp(playerid, params[], help) // command for see all cmds for organization
  1137. {
  1138. SendClientMessage( playerid, COLOR_GREEN, "/makeorganization /makesafeorg /editorganization /orglist");
  1139. SendClientMessage( playerid, COLOR_GREEN, "/orgvehicle /orgcolor /r /f /members /leader /makeleader");
  1140. return true;
  1141. }
  1142.  
  1143. YCMD:makeorganization(playerid, params[], help) // command for make a organization
  1144. {
  1145. // if( PI[ playerid ][ xAdmin ] < 1) return SendClientMessage(playerid, COLOR_RED, "You can't use this command." );
  1146. ShowPlayerDialog( playerid, DIALOG_ORGCREATE, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter name for organization!", "Confirm", "Cancel" );
  1147. return true;
  1148. }
  1149.  
  1150. YCMD:makeleader(playerid, params[], help) // command for make a safe for organization
  1151. {
  1152. // if( PI[ playerid ][ xAdmin ] < 1) return SendClientMessage(playerid, COLOR_RED, "You can't use this command." );
  1153. new id,orga,ImaFajl[50],ime1[MAX_PLAYER_NAME],podatak;
  1154. if(sscanf(params, "ui", id, orga)) return SendClientMessage( playerid, COLOR_GREEN, "Usage: /makeleader [ID player] [ID org]");
  1155. GetPlayerName(id, ime1, sizeof ime1);
  1156. format( ImaFajl, sizeof( ImaFajl ), O_FILE, orga );
  1157. if( orga == 0) {
  1158. if( PI[ id ][ xLeader ] == 0) return SendClientMessage(playerid, COLOR_GREEN, "That player isn't leader of any organization." );
  1159. podatak = PI[ id ][ xLeader ];
  1160. strmid( OI[ podatak ][ oLeader ], "No-one", 0, strlen("No-one"), ORG_LEADER);
  1161. SaveOrganization( podatak ); Orge3D( podatak );
  1162. PI[ id ][ xLeader ] = 0; PI[ id ][ xRank ] = 0; PI[ id ][ xMember ] = 0; PI[ id ][ xSkin ] = 3;
  1163. SetPlayerSkin( id, 3 );
  1164. SendClientMessage(id, COLOR_GREEN, "You are demoted from leader of organization.");
  1165. SendClientMessage(playerid, COLOR_GREEN, "You demoted player from leader of organization.");
  1166. }
  1167. else {
  1168. if( !fexist( ImaFajl ) ) return SendClientMessage(playerid, COLOR_GREEN, "That organization doesn't exist." );
  1169. if( !strcmp( OI[ orga ][ oLeader ], "No-one", true ) )
  1170. {
  1171. PI[ id ][ xLeader ] = orga;
  1172. PI[ id ][ xMember ] = orga;
  1173. PI[ id ][ xRank ] = 6;
  1174. PI[ id ][ xSkin ] = OI[ orga ][ oSkin6 ];
  1175. SetPlayerSkin( id, OI[ orga ][ oSkin6 ] );
  1176. SendClientMessage(id, COLOR_GREEN, "You are promoted for leader of organization.");
  1177. SendClientMessage(playerid, COLOR_GREEN, "You promoted player for leader of organization.");
  1178. strmid( OI[ orga ][ oLeader ], ime1, 0, strlen( ime1 ), 255 );
  1179. SaveOrganization( orga ); Orge3D( orga );
  1180. }
  1181. else return SendClientMessage(playerid, COLOR_RED, "That organization already have a leader!");
  1182. }
  1183. return 1;
  1184. }
  1185.  
  1186. YCMD:makesafeorg(playerid, params[], help) // command for make a safe for organization
  1187. {
  1188. // if( PI[ playerid ][ xAdmin ] < 1) return SendClientMessage(playerid, COLOR_RED, "You can't use this command." );
  1189. ShowPlayerDialog( playerid, DIALOG_ORGSCREATE, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter ID of organization which u make a safe.!", "Confirm", "Cancel" );
  1190. return true;
  1191. }
  1192.  
  1193. YCMD:editorganization(playerid, params[], help) // command for edit organization
  1194. {
  1195. // if( PI[ playerid ][ xAdmin ] < 1) return SendClientMessage(playerid, COLOR_RED, "You can't use this command." );
  1196. ShowPlayerDialog( playerid, DIALOG_ORGEDIT, DIALOG_STYLE_LIST, "Dimi Scripting", "Change name\nChange Interior\nChange Ranks\nChange Skins\nPromeni Tip\nChange Color\nAddd Vehicles", "Confirm", "Cancel" );
  1197. return true;
  1198. }
  1199.  
  1200. YCMD:orglist(playerid, params[], help) { // command for list of created organization
  1201. // if( PI[ playerid ][ xAdmin ] < 1) return SendClientMessage(playerid, COLOR_RED, "You can't use this command." );
  1202. new info[1024];
  1203. for(new i = 1; i < MAX_ORG; i++)
  1204. {
  1205. new oFile[100];
  1206. format(oFile, 100, O_FILE, i);
  1207. if(fexist(oFile))
  1208. {
  1209. new string[256];
  1210. format(string, sizeof(string), "ID : %d | Organization Name: %s\n", OI[ i ][ oID ], OI[ i ][ oName ]);
  1211. strcat(info, string, sizeof(info));
  1212. }
  1213. }
  1214. ShowPlayerDialog(playerid, DIALOG_ORGLIST, DIALOG_STYLE_MSGBOX, "Dimi Scripting", info, "Confirm", "Cancel");
  1215. return 1;
  1216. }
  1217. YCMD:orgvehicle(playerid, params[], help) { // make a vehicle for organization
  1218. // if( PI[ playerid ][ xAdmin ] < 1) return SendClientMessage(playerid, COLOR_RED, "You can't use this command." );
  1219. new VehicleID, OrgID, SlotNumber, ImaFajl[50], Float:PozX, Float:PozY, Float:PozZ, Float:PozA;
  1220. if( sscanf( params, "iii", OrgID, VehicleID, SlotNumber) ) return SendClientMessage( playerid, COLOR_WHITE, "Usage: /orgvehicle [ ID of org] [ ID vehicle ] [ Number of vehicle slot(1-12)]." );
  1221. format( ImaFajl, sizeof( ImaFajl ), O_FILE, OrgID );
  1222. if( !fexist( ImaFajl ) ) return SendClientMessage(playerid, COLOR_RED, "That organization doesn't exist." );
  1223. if( OI[ OrgID ][ oColor_1 ] < 0 ) return SendClientMessage( playerid, COLOR_RED, "First u need change a color of organization(/orgcolor)." );
  1224. if( VehicleID < 400 || VehicleID > 611 ) return SendClientMessage(playerid, COLOR_RED, "ID of vehicle can't be bigger then 611 and lower then 400." );
  1225. if( SlotNumber < 1 || SlotNumber > 12 ) return SendClientMessage(playerid, COLOR_RED, "The number of slot can't be bigger then 12 and lower then 1." );
  1226. GetPlayerPos( playerid , PozX, PozY, PozZ );
  1227. GetPlayerFacingAngle( playerid , PozA );
  1228. if( SlotNumber == 1 ) {
  1229. if( OI[ OrgID ][ oVehicle_1 ] != 0 ) return SendClientMessage(playerid, COLOR_RED, "In this slot already exist vehicle.");
  1230. OI[ OrgID ][ oVehicle_1 ] = VehicleID;
  1231. OI[ OrgID ][ oVehicle_1_PosX ] = PozX;
  1232. OI[ OrgID ][ oVehicle_1_PosY ] = PozY;
  1233. OI[ OrgID ][ oVehicle_1_PosZ ] = PozZ;
  1234. OI[ OrgID ][ oVehicle_1_PosA ] = PozA;
  1235. OrgVehicle[OrgID][0] = CreateVehicle(VehicleID, PozX, PozY, PozZ, PozA, OI[ OrgID ][ oColor_1 ], OI[ OrgID ][ oColor_2 ], -1);
  1236. SaveOrganization( OrgID ); SendClientMessage( playerid, COLOR_GREEN, "Successfully created vehicle for organization." ); }
  1237. else if( SlotNumber == 2 ) {
  1238. if( OI[ OrgID ][ oVehicle_2 ] != 0 ) return SendClientMessage(playerid, COLOR_RED, "In this slot already exist vehicle.");
  1239. OI[ OrgID ][ oVehicle_2 ] = VehicleID;
  1240. OI[ OrgID ][ oVehicle_2_PosX ] = PozX;
  1241. OI[ OrgID ][ oVehicle_2_PosY ] = PozY;
  1242. OI[ OrgID ][ oVehicle_2_PosZ ] = PozZ;
  1243. OI[ OrgID ][ oVehicle_2_PosA ] = PozA;
  1244. OrgVehicle[OrgID][1] = CreateVehicle(VehicleID, PozX, PozY, PozZ, PozA, OI[ OrgID ][ oColor_1 ], OI[ OrgID ][ oColor_2 ], -1);
  1245. SaveOrganization( OrgID ); SendClientMessage( playerid, COLOR_GREEN, "Successfully created vehicle for organization." ); }
  1246. else if( SlotNumber == 3 ) {
  1247. if( OI[ OrgID ][ oVehicle_3 ] != 0 ) return SendClientMessage(playerid, COLOR_RED, "In this slot already exist vehicle.");
  1248. OI[ OrgID ][ oVehicle_3 ] = VehicleID;
  1249. OI[ OrgID ][ oVehicle_3_PosX ] = PozX;
  1250. OI[ OrgID ][ oVehicle_3_PosY ] = PozY;
  1251. OI[ OrgID ][ oVehicle_3_PosZ ] = PozZ;
  1252. OI[ OrgID ][ oVehicle_3_PosA ] = PozA;
  1253. OrgVehicle[OrgID][2] = CreateVehicle(VehicleID, PozX, PozY, PozZ, PozA, OI[ OrgID ][ oColor_1 ], OI[ OrgID ][ oColor_2 ], -1);
  1254. SaveOrganization( OrgID ); SendClientMessage( playerid, COLOR_GREEN, "Successfully created vehicle for organization." ); }
  1255. else if( SlotNumber == 4 ) {
  1256. if( OI[ OrgID ][ oVehicle_4 ] != 0 ) return SendClientMessage(playerid, COLOR_RED, "In this slot already exist vehicle.");
  1257. OI[ OrgID ][ oVehicle_4 ] = VehicleID;
  1258. OI[ OrgID ][ oVehicle_4_PosX ] = PozX;
  1259. OI[ OrgID ][ oVehicle_4_PosY ] = PozY;
  1260. OI[ OrgID ][ oVehicle_4_PosZ ] = PozZ;
  1261. OI[ OrgID ][ oVehicle_4_PosA ] = PozA;
  1262. OrgVehicle[OrgID][3] = CreateVehicle(VehicleID, PozX, PozY, PozZ, PozA, OI[ OrgID ][ oColor_1 ], OI[ OrgID ][ oColor_2 ], -1);
  1263. SaveOrganization( OrgID ); SendClientMessage( playerid, COLOR_GREEN, "Successfully created vehicle for organization." ); }
  1264. else if( SlotNumber == 5 ) {
  1265. if( OI[ OrgID ][ oVehicle_5 ] != 0 ) return SendClientMessage(playerid, COLOR_RED, "In this slot already exist vehicle.");
  1266. OI[ OrgID ][ oVehicle_5 ] = VehicleID;
  1267. OI[ OrgID ][ oVehicle_5_PosX ] = PozX;
  1268. OI[ OrgID ][ oVehicle_5_PosY ] = PozY;
  1269. OI[ OrgID ][ oVehicle_5_PosZ ] = PozZ;
  1270. OI[ OrgID ][ oVehicle_5_PosA ] = PozA;
  1271. OrgVehicle[OrgID][4] = CreateVehicle(VehicleID, PozX, PozY, PozZ, PozA, OI[ OrgID ][ oColor_1 ], OI[ OrgID ][ oColor_2 ], -1);
  1272. SaveOrganization( OrgID ); SendClientMessage( playerid, COLOR_GREEN, "Successfully created vehicle for organization." ); }
  1273. else if( SlotNumber == 6 ) {
  1274. if( OI[ OrgID ][ oVehicle_6 ] != 0 ) return SendClientMessage(playerid, COLOR_RED, "In this slot already exist vehicle.");
  1275. OI[ OrgID ][ oVehicle_6 ] = VehicleID;
  1276. OI[ OrgID ][ oVehicle_6_PosX ] = PozX;
  1277. OI[ OrgID ][ oVehicle_6_PosY ] = PozY;
  1278. OI[ OrgID ][ oVehicle_6_PosZ ] = PozZ;
  1279. OI[ OrgID ][ oVehicle_6_PosA ] = PozA;
  1280. OrgVehicle[OrgID][5] = CreateVehicle(VehicleID, PozX, PozY, PozZ, PozA, OI[ OrgID ][ oColor_1 ], OI[ OrgID ][ oColor_2 ], -1);
  1281. SaveOrganization( OrgID ); SendClientMessage( playerid, COLOR_GREEN, "Successfully created vehicle for organization." ); }
  1282. else if( SlotNumber == 7 ) {
  1283. if( OI[ OrgID ][ oVehicle_7 ] != 0 ) return SendClientMessage(playerid, COLOR_RED, "In this slot already exist vehicle.");
  1284. OI[ OrgID ][ oVehicle_7 ] = VehicleID;
  1285. OI[ OrgID ][ oVehicle_7_PosX ] = PozX;
  1286. OI[ OrgID ][ oVehicle_7_PosY ] = PozY;
  1287. OI[ OrgID ][ oVehicle_7_PosZ ] = PozZ;
  1288. OI[ OrgID ][ oVehicle_7_PosA ] = PozA;
  1289. OrgVehicle[OrgID][6] = CreateVehicle(VehicleID, PozX, PozY, PozZ, PozA, OI[ OrgID ][ oColor_1 ], OI[ OrgID ][ oColor_2 ], -1);
  1290. SaveOrganization( OrgID ); SendClientMessage( playerid, COLOR_GREEN, "Successfully created vehicle for organization." ); }
  1291. else if( SlotNumber == 8 ) {
  1292. if( OI[ OrgID ][ oVehicle_8 ] != 0 ) return SendClientMessage(playerid, COLOR_RED, "In this slot already exist vehicle.");
  1293. OI[ OrgID ][ oVehicle_8 ] = VehicleID;
  1294. OI[ OrgID ][ oVehicle_8_PosX ] = PozX;
  1295. OI[ OrgID ][ oVehicle_8_PosY ] = PozY;
  1296. OI[ OrgID ][ oVehicle_8_PosZ ] = PozZ;
  1297. OI[ OrgID ][ oVehicle_8_PosA ] = PozA;
  1298. OrgVehicle[OrgID][7] = CreateVehicle(VehicleID, PozX, PozY, PozZ, PozA, OI[ OrgID ][ oColor_1 ], OI[ OrgID ][ oColor_2 ], -1);
  1299. SaveOrganization( OrgID ); SendClientMessage( playerid, COLOR_GREEN, "Successfully created vehicle for organization." ); }
  1300. else if( SlotNumber == 9 ) {
  1301. if( OI[ OrgID ][ oVehicle_9 ] != 0 ) return SendClientMessage(playerid, COLOR_RED, "In this slot already exist vehicle.");
  1302. OI[ OrgID ][ oVehicle_9 ] = VehicleID;
  1303. OI[ OrgID ][ oVehicle_9_PosX ] = PozX;
  1304. OI[ OrgID ][ oVehicle_9_PosY ] = PozY;
  1305. OI[ OrgID ][ oVehicle_9_PosZ ] = PozZ;
  1306. OI[ OrgID ][ oVehicle_9_PosA ] = PozA;
  1307. OrgVehicle[OrgID][8] = CreateVehicle(VehicleID, PozX, PozY, PozZ, PozA, OI[ OrgID ][ oColor_1 ], OI[ OrgID ][ oColor_2 ], -1);
  1308. SaveOrganization( OrgID ); SendClientMessage( playerid, COLOR_GREEN, "Successfully created vehicle for organization." ); }
  1309. else if( SlotNumber == 10 ) {
  1310. if( OI[ OrgID ][ oVehicle_10 ] != 0 ) return SendClientMessage(playerid, COLOR_RED, "In this slot already exist vehicle.");
  1311. OI[ OrgID ][ oVehicle_10 ] = VehicleID;
  1312. OI[ OrgID ][ oVehicle_10_PosX ] = PozX;
  1313. OI[ OrgID ][ oVehicle_10_PosY ] = PozY;
  1314. OI[ OrgID ][ oVehicle_10_PosZ ] = PozZ;
  1315. OI[ OrgID ][ oVehicle_10_PosA ] = PozA;
  1316. OrgVehicle[OrgID][9] = CreateVehicle(VehicleID, PozX, PozY, PozZ, PozA, OI[ OrgID ][ oColor_1 ], OI[ OrgID ][ oColor_2 ], -1);
  1317. SaveOrganization( OrgID ); SendClientMessage( playerid, COLOR_GREEN, "Successfully created vehicle for organization." ); }
  1318. else if( SlotNumber == 11 ) {
  1319. if( OI[ OrgID ][ oVehicle_11 ] != 0 ) return SendClientMessage(playerid, COLOR_RED, "In this slot already exist vehicle.");
  1320. OI[ OrgID ][ oVehicle_11 ] = VehicleID;
  1321. OI[ OrgID ][ oVehicle_11_PosX ] = PozX;
  1322. OI[ OrgID ][ oVehicle_11_PosY ] = PozY;
  1323. OI[ OrgID ][ oVehicle_11_PosZ ] = PozZ;
  1324. OI[ OrgID ][ oVehicle_11_PosA ] = PozA;
  1325. OrgVehicle[OrgID][10] = CreateVehicle(VehicleID, PozX, PozY, PozZ, PozA, OI[ OrgID ][ oColor_1 ], OI[ OrgID ][ oColor_2 ], -1);
  1326. SaveOrganization( OrgID ); SendClientMessage( playerid, COLOR_GREEN, "Successfully created vehicle for organization." ); }
  1327. else if( SlotNumber == 12 ) {
  1328. if( OI[ OrgID ][ oVehicle_12 ] != 0 ) return SendClientMessage(playerid, COLOR_RED, "In this slot already exist vehicle.");
  1329. OI[ OrgID ][ oVehicle_12 ] = VehicleID;
  1330. OI[ OrgID ][ oVehicle_12_PosX ] = PozX;
  1331. OI[ OrgID ][ oVehicle_12_PosY ] = PozY;
  1332. OI[ OrgID ][ oVehicle_12_PosZ ] = PozZ;
  1333. OI[ OrgID ][ oVehicle_12_PosA ] = PozA;
  1334. OrgVehicle[OrgID][11] = CreateVehicle(VehicleID, PozX, PozY, PozZ, PozA, OI[ OrgID ][ oColor_1 ], OI[ OrgID ][ oColor_2 ], -1);
  1335. SaveOrganization( OrgID ); SendClientMessage( playerid, COLOR_GREEN, "Successfully created vehicle for organization." ); }
  1336. else {
  1337. SendClientMessage(playerid, COLOR_RED, "The number of slot can't be bigger then 12 and lower then 1."); }
  1338. return true;
  1339. }
  1340.  
  1341. YCMD:orgcolor(playerid, params[], help) { // change a color of vehicle
  1342. // if( PI[ playerid ][ xAdmin ] < 6) return SendClientMessage(playerid, COLOR_RED, "You can't use this command.");
  1343. new color, OrgID, ImaFajl[50];
  1344. if( sscanf( params, "iii", OrgID, color) ) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /orgcolor [ ID of org ] [ Color ].");
  1345. format( ImaFajl, sizeof( ImaFajl ), O_FILE, OrgID );
  1346. if( !fexist( ImaFajl ) ) return SendClientMessage(playerid, COLOR_RED, "That organization doesn't exist." );
  1347. if( color < 0 || color > 255 ) return SendClientMessage(playerid, COLOR_RED, "The ID of color can't be bigger then 255 or lower then 0." );
  1348. OI[ OrgID ][ oColor_1 ] = color; OI[ OrgID ][ oColor_2 ] = color;
  1349. SaveOrganization( OrgID );
  1350. SendClientMessage(playerid, COLOR_GREEN, "Successfully changed color for organization.");
  1351. return true;
  1352. }
  1353.  
  1354. YCMD:r(playerid, params[], help) { // chat for legal organization(radio)
  1355. new message[256], string[512];
  1356. if( OI[ PI[ playerid ][ xMember ] ][ oType ] != 1 ) return SendClientMessage(playerid, COLOR_RED, "You can't use this command.");
  1357. if(sscanf(params, "s[256]", message)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /r [Text]");
  1358. if( PI[ playerid ][ xLeader ] > 0 || PI[ playerid ][ xMember ] > 0) {
  1359. if( PI[ playerid ][ xRank ] == 1) format(string, sizeof string, "** %s %s: %s, over. **", OI[ PI[ playerid ][ xMember ]][ oRank1 ], PlayerName( playerid ), message );
  1360. else if( PI[ playerid ][ xRank ] == 2) format(string, sizeof string, "** %s %s: %s, over. **", OI[ PI[ playerid ][ xMember ]][ oRank2 ], PlayerName( playerid ), message );
  1361. else if( PI[ playerid ][ xRank ] == 3) format(string, sizeof string, "** %s %s: %s, over. **", OI[ PI[ playerid ][ xMember ]][ oRank3 ], PlayerName( playerid ), message );
  1362. else if( PI[ playerid ][ xRank ] == 4) format(string, sizeof string, "** %s %s: %s, over. **", OI[ PI[ playerid ][ xMember ]][ oRank4 ], PlayerName( playerid ), message );
  1363. else if( PI[ playerid ][ xRank ] == 5) format(string, sizeof string, "** %s %s: %s, over. **", OI[ PI[ playerid ][ xMember ]][ oRank5 ], PlayerName( playerid ), message );
  1364. else if( PI[ playerid ][ xRank ] == 6) format(string, sizeof string, "** %s %s: %s, over. **", OI[ PI[ playerid ][ xLeader ]][ oRank6 ], PlayerName( playerid ), message );
  1365. OrgMessage( PI[ playerid ][ xMember ], 0x83BFBFFF, string ); }
  1366. else { SendClientMessage(playerid, COLOR_RED, "You can't use this command."); return true; }
  1367. return true;
  1368. }
  1369.  
  1370. YCMD:members(playerid, params[], help) { // list of online members
  1371. new string[ 140 ], OrgID;
  1372. if( PI[ playerid ][ xMember ] != 0 ) OrgID = PI[ playerid ][ xMember ];
  1373. else return SendClientMessage(playerid, COLOR_RED, "You can't use this command.");
  1374. SendClientMessage(playerid, COLOR_ORANGE, "|----------------Members Online----------------|");
  1375. foreach (Player, i) {
  1376. format(string, sizeof(string), "");
  1377. if( PI[ i ][ xLeader ] == OrgID ) format(string, sizeof(string), "%s (Leader)", PlayerName( i ) );
  1378. else if( PI[ playerid ][ xMember ] == OrgID ) format(string, sizeof(string), "%s, Rank: %d.", PlayerName( i ), PI[ i ][ xRank ] );
  1379. if(strlen(string) > 1) SendClientMessage(playerid, COLOR_ORANGE, string);
  1380. }
  1381. return true;
  1382. }
  1383.  
  1384. YCMD:f(playerid, params[], help) { // chat of ilegal organization
  1385. new message[256], string[512];
  1386. if( OI[ PI[ playerid ][ xMember ] ][ oType ] == 2 && OI[ PI[ playerid ][ xMember ] ][ oType ] == 3 ) return SendClientMessage(playerid, COLOR_RED, "You can't use this command.");
  1387. if(sscanf(params, "s[256]", message)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /f [Text]");
  1388. if( PI[ playerid ][ xLeader ] > 0 || PI[ playerid ][ xMember ] > 0) {
  1389. if( PI[ playerid ][ xRank ] == 1) format(string, sizeof string, "** %s %s: %s. )) **", OI[ PI[ playerid ][ xMember ]][ oRank1 ], PlayerName( playerid ), message );
  1390. else if( PI[ playerid ][ xRank ] == 2) format(string, sizeof string, "** %s %s: %s. )) **", OI[ PI[ playerid ][ xMember ]][ oRank2 ], PlayerName( playerid ), message );
  1391. else if( PI[ playerid ][ xRank ] == 3) format(string, sizeof string, "** %s %s: %s. )) **", OI[ PI[ playerid ][ xMember ]][ oRank3 ], PlayerName( playerid ), message );
  1392. else if( PI[ playerid ][ xRank ] == 4) format(string, sizeof string, "** %s %s: %s. )) **", OI[ PI[ playerid ][ xMember ]][ oRank4 ], PlayerName( playerid ), message );
  1393. else if( PI[ playerid ][ xRank ] == 5) format(string, sizeof string, "** %s %s: %s. )) **", OI[ PI[ playerid ][ xMember ]][ oRank5 ], PlayerName( playerid ), message );
  1394. else if( PI[ playerid ][ xRank ] == 6) format(string, sizeof string, "** %s %s: %s. )) **", OI[ PI[ playerid ][ xLeader ]][ oRank6 ], PlayerName( playerid ), message );
  1395. OrgMessage( PI[ playerid ][ xMember ], 0x01FCFFC8, string ); }
  1396. else { SendClientMessage(playerid, COLOR_RED, "You can't use this command."); return true; }
  1397. return true;
  1398. }
Advertisement
Add Comment
Please, Sign In to add comment