Advertisement
Guest User

Skinshop By IPROTOTYPEI

a guest
Apr 23rd, 2014
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 42.58 KB | None | 0 0
  1. /*
  2. SKINSHOPSYSTEM BY IPROTOTYPEI
  3. You should make some settings, for example the player-variables, add your admin statments and add a function to get the player name.
  4. */
  5.  
  6. #if !defined _A_
  7. forward public _A_();
  8. _A_()<_A_:unhooked>{}
  9. _A_()<_A_:hooked>{}
  10. _A_()<>{}
  11. #endif
  12.  
  13. #if !defined _ALS_
  14. forward public _ALS_();
  15. _ALS_()<_ALS_:unhooked>{}
  16. _ALS_()<_ALS_:hooked>{}
  17. _ALS_()<>{}
  18. #endif
  19.  
  20. forward @LOAD_SKINSHOP_DATA();
  21. forward @GETID(id);
  22.  
  23. #define Compare9BitBlock(%0,%1,%2) (((%0 >>> (%2*9))& ~(0xFFFFFE00)) == %1)
  24. #define GetSkin(%0) ((SkinArray[(ArrayMarker[%0] >> 8)] >>> ((ArrayMarker[%0] & ~(0xFF<<8))*9))& ~(0xFFFFFF<<9))
  25. #define GetSecoundArrayMarker(%0) (ArrayMarker[%0] >> 8)
  26. #define GetFirstArrayMarker(%0) (ArrayMarker[%0] & ~(0xFF<<8))
  27. #define SetSecoundArrayMarker(%0,%1) ArrayMarker[%0] |= (((ArrayMarker[%0] >>> 8) + %1) << 16),ArrayMarker[%0] &= ~(0xFF<< 8),ArrayMarker[%0] |= ((ArrayMarker[%0] >>> 16)<< 8),ArrayMarker[%0] &= ~(0xFF<< 16)
  28. #define SetFirstArrayMarker(%0,%1) ArrayMarker[%0] |= (((ArrayMarker[%0] & ~(0xFF<<8))+ %1) << 16), ArrayMarker[%0] &= ~(0xFF),ArrayMarker[%0] |= (ArrayMarker[%0] >>> 16),ArrayMarker[%0] &= ~(0xFF << 16)
  29.  
  30.  
  31. #define MAX_SKINSHOPS 10
  32. #define _SKIN_PRICE 100
  33.  
  34. #define HOST "localhost"
  35. #define USER "root"
  36. #define DATABASE "amazing"
  37. #define PASSWORD ""
  38. #define PORT 3306
  39.  
  40.  
  41. enum PlayerVars {
  42. pGeschlecht,
  43. pSkin,
  44. };
  45. new PlayerInfo[MAX_PLAYERS][PlayerVars];
  46.  
  47.  
  48. //Skinshop system
  49. stock const static SkinArray[76]={
  50. 0x80200,0x180A04,0x3C1C08,0x4C240C,
  51. 0x5C2C10,0x6C3414,0x803C18,0x90461C,0xB05620,
  52. 0xC05E24,0xD06628,0xF4782C,0x1108630,0x1249034,
  53. 0x144A038,0x158A83C,0x184C040,0x194C844,0x1A4D048,
  54. 0x1B4D84C,0x1C4E050,0x1D4E854,0x1E4F058,0x1F8FA5C,
  55. 0x2150860,0x2251064,0x2492068,0x269326C,0x27D3C70,
  56. 0x28D4474,0x29D4C78,0x2B5567C,0x2C56080,0x2D96A84,
  57. 0x2E97288,0x3217A8C,0x3399890,0x365A494,0x37DBA98,
  58. 0x399CA9C,0x3BE00A0,0x3DDE4A4,0x3F1F4A8,0x409FEAC,
  59. 0x41A0AB0,0x43216B4,0x4421EB8,0x45226BC,0x4622EC0,
  60. 0x47236C4,0x4823EC8,0x49246CC,0x4A24ED0,0xD4,
  61. /////////////////////Männer//////////////////////
  62. 0x2C1409,0x983E0D,
  63. 0xD45228,0xE47037,0x1148240,0x1549A4C,0x168B258,
  64. 0x1E8BA5C,0x2290682,0x2451A8C,0x2612E96,0x2C958A9,
  65. 0x30580BF,0x31588C3,0x33592C7,0x355A8D3,0x369B0D7,
  66. 0x389C2E0,0x3B1D2E8,0x3D1E6EE,0x405F6F6,0x2550A,
  67. /////////////////////Frauen//////////////////////
  68. };
  69.  
  70. enum _INT {
  71. ID,
  72. Float:X,
  73. Float:Y,
  74. Float:Z,
  75. Float:A,
  76. INT,
  77. Float:uPUX,
  78. Float:uPUY,
  79. Float:uPUZ,
  80. Float:uX,
  81. Float:uY,
  82. Float:uZ,
  83. Float:uA,
  84. Float:uCPX,
  85. Float:uCPY,
  86. Float:uCPZ,
  87. };
  88.  
  89. stock const static InteriorArray[][_INT] ={
  90. {0,207.054992, -138.804992, 1003.507812, 0.000000, 3, 200.524475, -131.777420, 1003.507812,199.716766, -127.406845, 1003.515197, 357.493438, 198.9963, -129.6429, 1004.3490},
  91. {0,226.294006, -7.431529, 1002.210937, 89.999992, 5, 206.169006, -3.942841, 1001.210937, 224.805191, -12.096853, 1002.210937, 359.324218, 224.805191, -9.096853, 1003.210937},
  92. {0,203.777618, -48.492076, 1001.804687, 0.000000, 1, 213.776901, -41.958171, 1002.023437, 200.302169, -33.911346, 1002.304016, 180.000015, 200.302169, -36.911346, 1003.304016},
  93. {0,161.391006, -95.285598, 1001.804687, 0.000000, 18, 179.811080, -88.213218, 1002.023437, 181.521392, -88.197052, 1002.023437, -270.699188, 178.521392, -88.197052, 1003.023437},
  94. {0,204.332992, -166.695007, 1000.523437, 0.000000, 14, 215.057617, -156.022125, 1000.523437, 216.101577, -155.486923, 1000.523437, -270.072448, 213.101577, -155.486923, 1001.523437}
  95. };
  96.  
  97. enum {
  98. DIALOG_SKINSHOP_KONFIG = 10000,
  99. DIALOG_SKINSHOP_EDIT,
  100. DIALOG_SKINSHOP_EDIT_NAME,
  101. DIALOG_SKINSHOP_EDIT_KASSE,
  102. DIALOG_SKINSHOP_EDIT_PRICE,
  103. DIALOG_SKINSHOP_EDIT_INTERIOR,
  104. DIALOG_SKINSHOP_CREATE,
  105. DIALOG_SKINSHOP_CREATE_NAME,
  106. DIALOG_SKINSHOP_CREATE_KASSE,
  107. DIALOG_SKINSHOP_CREATE_PRICE,
  108. DIALOG_SKINSHOP_CREATE_INTERIOR,
  109. DIALOG_SKINSHOP_PLAYER_KONFIG,
  110. DIALOG_SKINSHOP_PLAYER_KASSE,
  111. DIALOG_SKINSHOP_PLAYER_AUSZAHL,
  112. DIALOG_SKINSHOP_PLAYER_EINZAHL,
  113. };
  114.  
  115.  
  116. enum _SH {
  117. ID,
  118. INT,
  119. Float:X,
  120. Float:Y,
  121. Float:Z,
  122. OWNER[MAX_PLAYER_NAME],
  123. CASH,
  124. PRICE,
  125. Text3D:LABELEn,
  126. Text3D:LABELEx,
  127. PICKUPEn,
  128. PICKUPEx,
  129. Text3D:LABELINT,
  130. PICKUPINT,
  131. };
  132.  
  133. enum _TD {
  134. Text:sSkinSelectionBU,
  135. Text:sSkinSelectionBO,
  136. Text:sSkinSelectionLeft,
  137. Text:sSkinSelectionRight,
  138. Text:sSkinSelectionBuy,
  139. };
  140.  
  141. new static stock SkinShop[MAX_SKINSHOPS][_SH],
  142. ArrayMarker[MAX_PLAYERS],
  143. EditSkinShop[MAX_PLAYERS char],
  144. ALLSTR[200],
  145. ALLSTR2[200],
  146. GlobalTextdraw[_TD],
  147. con_Handle;
  148.  
  149.  
  150.  
  151.  
  152. stock static bool:SetArrayMarker(playerid){
  153. ArrayMarker[playerid] = 0;
  154. PlayerInfo[playerid][pSkin] = GetPlayerSkin(playerid);
  155.  
  156. for(new i; i != 54; ++i){
  157. for(new x; x != 3; ++x){
  158. if(!Compare9BitBlock(SkinArray[i],PlayerInfo[playerid][pSkin] ,x))continue;
  159. ArrayMarker[playerid]|=x,
  160. ArrayMarker[playerid]|= (i << 8);
  161. return true;
  162. }
  163. }
  164. for(new i = 54; i != 76; ++i){
  165. for(new x; x != 3; ++x){
  166. if(!Compare9BitBlock(SkinArray[i],PlayerInfo[playerid][pSkin] ,x))continue;
  167. ArrayMarker[playerid]|=x,
  168. ArrayMarker[playerid]|= (i << 8);
  169. return false;
  170. }
  171. }
  172. return !!printf("Der Skin %d befindet sich nicht im Array %d",PlayerInfo[playerid][pSkin]);
  173. }
  174. @GETID(id){
  175. SkinShop[id][ID] = cache_insert_id();
  176. SkinShop[id][PICKUPEn] = CreateDynamicPickup(1275, 1, SkinShop[id][X], SkinShop[id][Y], SkinShop[id][Z]);
  177. SkinShop[id][PICKUPEx] = CreateDynamicPickup(1275, 1, InteriorArray[SkinShop[id][INT]][X],InteriorArray[SkinShop[id][INT]][Y],InteriorArray[SkinShop[id][INT]][Z],SkinShop[id][ID],SkinShop[id][INT]);
  178. SkinShop[id][PICKUPINT] = CreateDynamicPickup(1275, 1, InteriorArray[SkinShop[id][INT]][uPUX],InteriorArray[SkinShop[id][INT]][uPUY],InteriorArray[SkinShop[id][INT]][uPUZ],SkinShop[id][ID],SkinShop[id][INT]);
  179. format(ALLSTR2,200,"Zum Verkauf\n Preis: %d\n Besitzer: %s",SkinShop[id][PRICE],SkinShop[id][OWNER]);
  180. SkinShop[id][LABELEn] = CreateDynamic3DTextLabel(ALLSTR2, -1, SkinShop[id][X], SkinShop[id][Y], SkinShop[id][Z]+1.0, 100.0);
  181. SkinShop[id][LABELEx] = CreateDynamic3DTextLabel("Benutze Linke Maustaste um das Gebäude zu verlassen", -1, InteriorArray[SkinShop[id][INT]][X],InteriorArray[SkinShop[id][INT]][Y],InteriorArray[SkinShop[id][INT]][Z]+1.0, 100.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,SkinShop[id][ID],SkinShop[id][INT]);
  182. SkinShop[id][LABELINT] = CreateDynamic3DTextLabel("Drücke hier Linke Maustaste um zur Skinauswahl zu kommen", -1, InteriorArray[SkinShop[id][INT]][uPUX],InteriorArray[SkinShop[id][INT]][uPUY],InteriorArray[SkinShop[id][INT]][uPUZ]+1.0, 100.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,SkinShop[id][ID],SkinShop[id][INT]);
  183. return 1;
  184. }
  185.  
  186. _UPDATE_SKINSHOP(id){
  187. new str[64];
  188. SkinShop[id][PICKUPEn] = CreateDynamicPickup(1275, 1, SkinShop[id][X], SkinShop[id][Y], SkinShop[id][Z]);
  189. SkinShop[id][PICKUPEx] = CreateDynamicPickup(1275, 1, InteriorArray[SkinShop[id][INT]][X],InteriorArray[SkinShop[id][INT]][Y],InteriorArray[SkinShop[id][INT]][Z],SkinShop[id][ID],InteriorArray[SkinShop[id][INT]][INT]);
  190. SkinShop[id][PICKUPINT] = CreateDynamicPickup(1275, 1, InteriorArray[SkinShop[id][INT]][uPUX],InteriorArray[SkinShop[id][INT]][uPUY],InteriorArray[SkinShop[id][INT]][uPUZ],SkinShop[id][ID],InteriorArray[SkinShop[id][INT]][INT]);
  191. (strcmp(SkinShop[id][OWNER],"Niemand",false) != 0) && format(str,64,"Besitzer: %s\n Benutze: Linke Maustaste um einzutreten.",SkinShop[id][OWNER]) || format(str,64,"Besitzer: %s\n zu verkaufen \n Preise %d",SkinShop[id][OWNER],SkinShop[id][PRICE]);
  192. SkinShop[id][LABELEn] = CreateDynamic3DTextLabel(str, -1, SkinShop[id][X], SkinShop[id][Y], SkinShop[id][Z]+1.0, 100.0);
  193. SkinShop[id][LABELEx] = CreateDynamic3DTextLabel("Benutze Linke Maustaste um das Gebäude zu verlassen", -1, InteriorArray[SkinShop[id][INT]][X],InteriorArray[SkinShop[id][INT]][Y],InteriorArray[SkinShop[id][INT]][Z]+1.0, 100.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,SkinShop[id][ID],InteriorArray[SkinShop[id][INT]][INT]);
  194. SkinShop[id][LABELINT] = CreateDynamic3DTextLabel("Drücke hier Linke Maustaste um zur Skinauswahl zu kommen", -1, InteriorArray[SkinShop[id][INT]][uPUX],InteriorArray[SkinShop[id][INT]][uPUY],InteriorArray[SkinShop[id][INT]][uPUZ]+1.0, 100.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,SkinShop[id][ID],InteriorArray[SkinShop[id][INT]][INT]);
  195. return 1;
  196. }
  197. @LOAD_SKINSHOP_DATA(){
  198. new rows,num,i,str[64];
  199. cache_get_data(rows,num);
  200. for(; i != rows; ++i){
  201. SkinShop[i][ID] = cache_get_row_int(i,0);
  202. SkinShop[i][INT]= cache_get_row_int(i,1);
  203. SkinShop[i][X] = cache_get_row_float(i,2);
  204. SkinShop[i][Y] = cache_get_row_float(i,3);
  205. SkinShop[i][Z] = cache_get_row_float(i,4);
  206. cache_get_row(i,5,SkinShop[i][OWNER],con_Handle,MAX_PLAYER_NAME);
  207. SkinShop[i][CASH] = cache_get_row_int(i,6);
  208. SkinShop[i][PRICE] = cache_get_row_int(i,7);
  209. SkinShop[i][PICKUPEn] = CreateDynamicPickup(1275, 1, SkinShop[i][X], SkinShop[i][Y], SkinShop[i][Z]);
  210. SkinShop[i][PICKUPEx] = CreateDynamicPickup(1275, 1, InteriorArray[SkinShop[i][INT]][X],InteriorArray[SkinShop[i][INT]][Y],InteriorArray[SkinShop[i][INT]][Z],SkinShop[i][ID],InteriorArray[SkinShop[i][INT]][INT]);
  211. SkinShop[i][PICKUPINT] = CreateDynamicPickup(1275, 1, InteriorArray[SkinShop[i][INT]][uPUX],InteriorArray[SkinShop[i][INT]][uPUY],InteriorArray[SkinShop[i][INT]][uPUZ],SkinShop[i][ID],InteriorArray[SkinShop[i][INT]][INT]);
  212. (strcmp(SkinShop[i][OWNER],"Niemand",false) != 0) && format(str,64,"Besitzer: %s\n Benutze: Linke Maustaste um einzutreten.",SkinShop[i][OWNER]) || format(str,64,"Besitzer: %s\n zu verkaufen \n Preise %d",SkinShop[i][OWNER],SkinShop[i][PRICE]);
  213. SkinShop[i][LABELEn] = CreateDynamic3DTextLabel(str, -1, SkinShop[i][X], SkinShop[i][Y], SkinShop[i][Z]+1.0, 100.0);
  214. SkinShop[i][LABELEx] = CreateDynamic3DTextLabel("Benutze Linke Maustaste um das Gebäude zu verlassen", -1, InteriorArray[SkinShop[i][INT]][X],InteriorArray[SkinShop[i][INT]][Y],InteriorArray[SkinShop[i][INT]][Z]+1.0, 100.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,SkinShop[i][ID],InteriorArray[SkinShop[i][INT]][INT]);
  215. SkinShop[i][LABELINT] = CreateDynamic3DTextLabel("Drücke hier Linke Maustaste um zur Skinauswahl zu kommen", -1, InteriorArray[SkinShop[i][INT]][uPUX],InteriorArray[SkinShop[i][INT]][uPUY],InteriorArray[SkinShop[i][INT]][uPUZ]+1.0, 100.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,SkinShop[i][ID],InteriorArray[SkinShop[i][INT]][INT]);
  216. }
  217. return 1;
  218. }
  219.  
  220.  
  221. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  222. {
  223. state _A_:hooked;
  224. switch(dialogid) {
  225. case DIALOG_SKINSHOP_KONFIG:{
  226. if(!response)return 1;
  227. switch(listitem){
  228. case 0:{
  229. new i;
  230. for(; i != MAX_SKINSHOPS; ++i){
  231. if(SkinShop[i][ID] == 0 || !IsPlayerInRangeOfPoint(playerid,5.0,SkinShop[i][X],SkinShop[i][Y],SkinShop[i][Z]))continue;
  232. EditSkinShop{playerid} = i;
  233. format(ALLSTR,200,"Besitzer: %s\nPosition: %f,%f,%f\nKasse: %d\nInterior: %d\nPreis %d\nSpeichern",SkinShop[i][OWNER],SkinShop[i][X],SkinShop[i][Y],SkinShop[i][Z],SkinShop[i][CASH],SkinShop[i][INT],SkinShop[i][PRICE]);
  234. return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_EDIT, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
  235. }
  236. return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_KONFIG, DIALOG_STYLE_LIST,"Skinshop","Bearbeiten\nErstellen\nEntfernen","Auswählen","Beenden"), SendClientMessage(playerid,-1,"Kein Skinshop gefunden!");
  237. } case 1: {
  238. new i;
  239. for(; i != MAX_SKINSHOPS; ++i){
  240. if(SkinShop[i][ID] != 0)continue;
  241. EditSkinShop{playerid} = i;
  242. strcat(SkinShop[i][OWNER],"Niemand",MAX_PLAYER_NAME);
  243. SkinShop[i][INT] = -1;
  244. return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_CREATE, DIALOG_STYLE_LIST,"Skinshop","Besitzer: Niemand \nPosition: Keine\nInterior: Keins\nPreis: 0\nSpeichern","Auswählen","Zurück");
  245. }
  246. return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_KONFIG, DIALOG_STYLE_LIST,"Skinshop","Bearbeiten\nErstellen\nEntfernen","Auswählen","Beenden"), SendClientMessage(playerid,-1,"Du kannst kein Skinshop erstellen!");
  247. } case 2: {
  248. new i,x;
  249. for(; i != MAX_SKINSHOPS; ++i){
  250. if(SkinShop[i][ID] == 0 || !IsPlayerInRangeOfPoint(playerid,5.0,SkinShop[i][X],SkinShop[i][Y],SkinShop[i][Z]))continue;
  251. printf("%d",i);
  252. DestroyDynamicPickup(SkinShop[i][PICKUPEn]);
  253. DestroyDynamicPickup(SkinShop[i][PICKUPEx]);
  254. DestroyDynamicPickup(SkinShop[i][PICKUPINT]);
  255. DestroyDynamic3DTextLabel(SkinShop[i][LABELEn]);
  256. DestroyDynamic3DTextLabel(SkinShop[i][LABELEx]);
  257. DestroyDynamic3DTextLabel(SkinShop[i][LABELINT]);
  258. mysql_format(con_Handle,ALLSTR,200,"DELETE FROM `skinshops` WHERE `id` = %d;",SkinShop[i][ID]);
  259. mysql_tquery(con_Handle,ALLSTR,"","");
  260. for(; x != _:_SH ; ++i)SkinShop[i][_SH:x]= 0;
  261. SendClientMessage(playerid,-1,"Skinshop gelöscht");
  262. return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_KONFIG, DIALOG_STYLE_LIST,"Skinshop","Bearbeiten\nErstellen\nEntfernen","Auswählen","Beenden");
  263. }
  264. return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_KONFIG, DIALOG_STYLE_LIST,"Skinshop","Bearbeiten\nErstellen\nEntfernen","Auswählen","Beenden"), SendClientMessage(playerid,-1,"Kein Skinshop gefunden!");
  265. }
  266. }
  267. } case DIALOG_SKINSHOP_EDIT: {
  268. if(!response)return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_KONFIG, DIALOG_STYLE_LIST,"Skinshop","Bearbeiten\nErstellen\nEntfernen","Auswählen","Beenden");
  269. switch(listitem){
  270. case 0: return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_EDIT_NAME, DIALOG_STYLE_INPUT,"Skinshop","Gebe hier den Namen ein und Niemand für keinen Besitzer.","Ändern","Zurück");
  271. case 1:{
  272. GetPlayerPos(playerid,SkinShop[EditSkinShop{playerid}][X],SkinShop[EditSkinShop{playerid}][Y],SkinShop[EditSkinShop{playerid}][Z]);
  273. SendClientMessage(playerid,-1,"Du hast den Eingangspunkt erfolgreich geändert");
  274. format(ALLSTR,200,"Besitzer: %s\nPosition: %f,%f,%f\nKasse: %d\nInterior: %d\nPreis %d\nSpeichern",SkinShop[EditSkinShop{playerid}][OWNER],SkinShop[EditSkinShop{playerid}][X],SkinShop[EditSkinShop{playerid}][Y],SkinShop[EditSkinShop{playerid}][Z],SkinShop[EditSkinShop{playerid}][CASH],SkinShop[EditSkinShop{playerid}][INT],SkinShop[EditSkinShop{playerid}][PRICE]);
  275. return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_EDIT, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
  276. }
  277. case 2: return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_EDIT_KASSE, DIALOG_STYLE_INPUT,"Skinshop","Gebe hier den Betrag in der Bizkasse ein","Ändern","Zurück");
  278. case 3: return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_EDIT_INTERIOR, DIALOG_STYLE_LIST,"Skinshop","Prolaps\nVictim\nSuburban\nZip\nDidier sachs","Ändern","Zurück");
  279. case 4: return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_EDIT_PRICE, DIALOG_STYLE_INPUT,"Skinshop","Gebe hier den Verkaufspreis ein des Bizes","Ändern","Zurück");
  280. case 5:{
  281. DestroyDynamicPickup(SkinShop[EditSkinShop{playerid}][PICKUPEn]);
  282. DestroyDynamicPickup(SkinShop[EditSkinShop{playerid}][PICKUPEx]);
  283. DestroyDynamicPickup(SkinShop[EditSkinShop{playerid}][PICKUPINT]);
  284. DestroyDynamic3DTextLabel(SkinShop[EditSkinShop{playerid}][LABELEn]);
  285. DestroyDynamic3DTextLabel(SkinShop[EditSkinShop{playerid}][LABELEx]);
  286. DestroyDynamic3DTextLabel(SkinShop[EditSkinShop{playerid}][LABELINT]);
  287. _UPDATE_SKINSHOP(EditSkinShop{playerid});
  288. }
  289. }
  290. } case DIALOG_SKINSHOP_EDIT_NAME: {
  291. if(!response){
  292. format(ALLSTR,200,"Besitzer: %s\nPosition: %f,%f,%f\nKasse: %d\nInterior: %d\nPreis %d\nSpeichern",SkinShop[EditSkinShop{playerid}][OWNER],SkinShop[EditSkinShop{playerid}][X],SkinShop[EditSkinShop{playerid}][Y],SkinShop[EditSkinShop{playerid}][Z],SkinShop[EditSkinShop{playerid}][CASH],SkinShop[EditSkinShop{playerid}][INT],SkinShop[EditSkinShop{playerid}][PRICE]);
  293. return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_EDIT, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
  294. }
  295. strdel(SkinShop[EditSkinShop{playerid}][OWNER],0,MAX_PLAYER_NAME);
  296. strcat(SkinShop[EditSkinShop{playerid}][OWNER], inputtext,MAX_PLAYER_NAME);
  297. SendClientMessage(playerid,-1,"Du hast den Besitzer erfolgreich geändert");
  298. format(ALLSTR,200,"Besitzer: %s\nPosition: %f,%f,%f\nKasse: %d\nInterior: %d\nPreis %d\nSpeichern",SkinShop[EditSkinShop{playerid}][OWNER],SkinShop[EditSkinShop{playerid}][X],SkinShop[EditSkinShop{playerid}][Y],SkinShop[EditSkinShop{playerid}][Z],SkinShop[EditSkinShop{playerid}][CASH],SkinShop[EditSkinShop{playerid}][INT],SkinShop[EditSkinShop{playerid}][PRICE]);
  299. return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_EDIT, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
  300. } case DIALOG_SKINSHOP_EDIT_KASSE: {
  301. if(!response){
  302. format(ALLSTR,200,"Besitzer: %s\nPosition: %f,%f,%f\nKasse: %d\nInterior: %d\nPreis %d\nSpeichern",SkinShop[EditSkinShop{playerid}][OWNER],SkinShop[EditSkinShop{playerid}][X],SkinShop[EditSkinShop{playerid}][Y],SkinShop[EditSkinShop{playerid}][Z],SkinShop[EditSkinShop{playerid}][CASH],SkinShop[EditSkinShop{playerid}][INT],SkinShop[EditSkinShop{playerid}][PRICE]);
  303. return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_EDIT, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
  304. }
  305. SkinShop[EditSkinShop{playerid}][CASH] = strval(inputtext);
  306. SendClientMessage(playerid,-1,"Du hast die Bizkasse erfolgreich geändert");
  307. format(ALLSTR,200,"Besitzer: %s\nPosition: %f,%f,%f\nKasse: %d\nInterior: %d\nPreis %d\nSpeichern",SkinShop[EditSkinShop{playerid}][OWNER],SkinShop[EditSkinShop{playerid}][X],SkinShop[EditSkinShop{playerid}][Y],SkinShop[EditSkinShop{playerid}][Z],SkinShop[EditSkinShop{playerid}][CASH],SkinShop[EditSkinShop{playerid}][INT],SkinShop[EditSkinShop{playerid}][PRICE]);
  308. return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_EDIT, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
  309. } case DIALOG_SKINSHOP_EDIT_PRICE: {
  310. if(!response){
  311. format(ALLSTR,200,"Besitzer: %s\nPosition: %f,%f,%f\nKasse: %d\nInterior: %d\nPreis %d\nSpeichern",SkinShop[EditSkinShop{playerid}][OWNER],SkinShop[EditSkinShop{playerid}][X],SkinShop[EditSkinShop{playerid}][Y],SkinShop[EditSkinShop{playerid}][Z],SkinShop[EditSkinShop{playerid}][CASH],SkinShop[EditSkinShop{playerid}][INT],SkinShop[EditSkinShop{playerid}][PRICE]);
  312. return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_EDIT, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
  313. }
  314. SkinShop[EditSkinShop{playerid}][PRICE] = strval(inputtext);
  315. SendClientMessage(playerid,-1,"Du hast den Verkaufspreis erfolgreich geändert");
  316. format(ALLSTR,200,"Besitzer: %s\nPosition: %f,%f,%f\nKasse: %d\nInterior: %d\nPreis %d\nSpeichern",SkinShop[EditSkinShop{playerid}][OWNER],SkinShop[EditSkinShop{playerid}][X],SkinShop[EditSkinShop{playerid}][Y],SkinShop[EditSkinShop{playerid}][Z],SkinShop[EditSkinShop{playerid}][CASH],SkinShop[EditSkinShop{playerid}][INT],SkinShop[EditSkinShop{playerid}][PRICE]);
  317. return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_EDIT, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
  318. } case DIALOG_SKINSHOP_EDIT_INTERIOR: {
  319. if(!response)return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_EDIT, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
  320. SkinShop[EditSkinShop{playerid}][INT] = listitem;
  321. format(ALLSTR,200,"Besitzer: %s\nPosition: %f,%f,%f\nKasse: %d\nInterior: %d\nPreis %d\nSpeichern",SkinShop[EditSkinShop{playerid}][OWNER],SkinShop[EditSkinShop{playerid}][X],SkinShop[EditSkinShop{playerid}][Y],SkinShop[EditSkinShop{playerid}][Z],SkinShop[EditSkinShop{playerid}][CASH],SkinShop[EditSkinShop{playerid}][INT],SkinShop[EditSkinShop{playerid}][PRICE]);
  322. return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_EDIT, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
  323. } case DIALOG_SKINSHOP_CREATE: {
  324. if(!response)return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_KONFIG, DIALOG_STYLE_LIST,"Skinshop","Bearbeiten\nErstellen\nEntfernen","Auswählen","Beenden");
  325. switch(listitem){
  326. case 0: return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_CREATE_NAME, DIALOG_STYLE_INPUT,"Skinshop","Gebe hier den Namen ein und Niemand für keinen Besitzer.","Ändern","Zurück");
  327. case 1:{
  328. GetPlayerPos(playerid,SkinShop[EditSkinShop{playerid}][X],SkinShop[EditSkinShop{playerid}][Y],SkinShop[EditSkinShop{playerid}][Z]);
  329. SendClientMessage(playerid,-1,"Du hast den Eingangspunkt erfolgreich geändert");
  330. format(ALLSTR,200,"Besitzer: %s\nPosition: %f,%f,%f\nKasse: %d\nInterior: %d\nPreis %d\nSpeichern",SkinShop[EditSkinShop{playerid}][OWNER],SkinShop[EditSkinShop{playerid}][X],SkinShop[EditSkinShop{playerid}][Y],SkinShop[EditSkinShop{playerid}][Z],SkinShop[EditSkinShop{playerid}][CASH],SkinShop[EditSkinShop{playerid}][INT],SkinShop[EditSkinShop{playerid}][PRICE]);
  331. return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_CREATE, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
  332. }
  333. case 2: return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_CREATE_KASSE, DIALOG_STYLE_INPUT,"Skinshop","Gebe hier den Betrag in der Bizkasse ein","Ändern","Zurück");
  334. case 3: return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_CREATE_INTERIOR, DIALOG_STYLE_LIST,"Skinshop","Prolaps\nVictim\nSuburban\nZip\nDidier sachs","Ändern","Zurück");
  335. case 4: return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_CREATE_PRICE, DIALOG_STYLE_INPUT,"Skinshop","Gebe hier den Verkaufspreis ein des Bizes","Ändern","Zurück");
  336. case 5:{
  337. mysql_format(con_Handle,ALLSTR,200,"INSERT INTO `skinshops` (`id`,`interior`,`x`,`y`,`z`,`owner`,`cash`,`price`) VALUES (0,%d,%f,%f,%f,'%s',%d,%d);",SkinShop[EditSkinShop{playerid}][INT],SkinShop[EditSkinShop{playerid}][X],SkinShop[EditSkinShop{playerid}][Y],SkinShop[EditSkinShop{playerid}][Z],SkinShop[EditSkinShop{playerid}][OWNER],SkinShop[EditSkinShop{playerid}][CASH],SkinShop[EditSkinShop{playerid}][PRICE]);
  338. mysql_tquery(con_Handle,ALLSTR,"@GETID","i",EditSkinShop{playerid});
  339. }
  340. }
  341. } case DIALOG_SKINSHOP_CREATE_NAME: {
  342. if(!response){
  343. format(ALLSTR,200,"Besitzer: %s\nPosition: %f,%f,%f\nKasse: %d\nInterior: %d\nPreis %d\nSpeichern",SkinShop[EditSkinShop{playerid}][OWNER],SkinShop[EditSkinShop{playerid}][X],SkinShop[EditSkinShop{playerid}][Y],SkinShop[EditSkinShop{playerid}][Z],SkinShop[EditSkinShop{playerid}][CASH],SkinShop[EditSkinShop{playerid}][INT],SkinShop[EditSkinShop{playerid}][PRICE]);
  344. return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_CREATE, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
  345. }
  346. strdel(SkinShop[EditSkinShop{playerid}][OWNER],0,MAX_PLAYER_NAME);
  347. strcat(SkinShop[EditSkinShop{playerid}][OWNER], inputtext,MAX_PLAYER_NAME);
  348. SendClientMessage(playerid,-1,"Du hast den Besitzer erfolgreich geändert");
  349. format(ALLSTR,200,"Besitzer: %s\nPosition: %f,%f,%f\nKasse: %d\nInterior: %d\nPreis %d\nSpeichern",SkinShop[EditSkinShop{playerid}][OWNER],SkinShop[EditSkinShop{playerid}][X],SkinShop[EditSkinShop{playerid}][Y],SkinShop[EditSkinShop{playerid}][Z],SkinShop[EditSkinShop{playerid}][CASH],SkinShop[EditSkinShop{playerid}][INT],SkinShop[EditSkinShop{playerid}][PRICE]);
  350. return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_CREATE, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
  351. } case DIALOG_SKINSHOP_CREATE_KASSE: {
  352. if(!response){
  353. format(ALLSTR,200,"Besitzer: %s\nPosition: %f,%f,%f\nKasse: %d\nInterior: %d\nPreis %d\nSpeichern",SkinShop[EditSkinShop{playerid}][OWNER],SkinShop[EditSkinShop{playerid}][X],SkinShop[EditSkinShop{playerid}][Y],SkinShop[EditSkinShop{playerid}][Z],SkinShop[EditSkinShop{playerid}][CASH],SkinShop[EditSkinShop{playerid}][INT],SkinShop[EditSkinShop{playerid}][PRICE]);
  354. return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_CREATE, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
  355. }
  356. SkinShop[EditSkinShop{playerid}][CASH] = strval(inputtext);
  357. SendClientMessage(playerid,-1,"Du hast die Bizkasse erfolgreich geändert");
  358. format(ALLSTR,200,"Besitzer: %s\nPosition: %f,%f,%f\nKasse: %d\nInterior: %d\nPreis %d\nSpeichern",SkinShop[EditSkinShop{playerid}][OWNER],SkinShop[EditSkinShop{playerid}][X],SkinShop[EditSkinShop{playerid}][Y],SkinShop[EditSkinShop{playerid}][Z],SkinShop[EditSkinShop{playerid}][CASH],SkinShop[EditSkinShop{playerid}][INT],SkinShop[EditSkinShop{playerid}][PRICE]);
  359. return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_CREATE, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
  360. } case DIALOG_SKINSHOP_CREATE_PRICE: {
  361. if(!response){
  362. format(ALLSTR,200,"Besitzer: %s\nPosition: %f,%f,%f\nKasse: %d\nInterior: %d\nPreis %d\nSpeichern",SkinShop[EditSkinShop{playerid}][OWNER],SkinShop[EditSkinShop{playerid}][X],SkinShop[EditSkinShop{playerid}][Y],SkinShop[EditSkinShop{playerid}][Z],SkinShop[EditSkinShop{playerid}][CASH],SkinShop[EditSkinShop{playerid}][INT],SkinShop[EditSkinShop{playerid}][PRICE]);
  363. return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_CREATE, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
  364. }
  365. SkinShop[EditSkinShop{playerid}][PRICE] = strval(inputtext);
  366. SendClientMessage(playerid,-1,"Du hast den Verkaufspreis erfolgreich geändert");
  367. format(ALLSTR,200,"Besitzer: %s\nPosition: %f,%f,%f\nKasse: %d\nInterior: %d\nPreis %d\nSpeichern",SkinShop[EditSkinShop{playerid}][OWNER],SkinShop[EditSkinShop{playerid}][X],SkinShop[EditSkinShop{playerid}][Y],SkinShop[EditSkinShop{playerid}][Z],SkinShop[EditSkinShop{playerid}][CASH],SkinShop[EditSkinShop{playerid}][INT],SkinShop[EditSkinShop{playerid}][PRICE]);
  368. return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_CREATE, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
  369. } case DIALOG_SKINSHOP_CREATE_INTERIOR: {
  370. if(!response)return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_CREATE, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
  371. SkinShop[EditSkinShop{playerid}][INT] = listitem;
  372. format(ALLSTR,200,"Besitzer: %s\nPosition: %f,%f,%f\nKasse: %d\nInterior: %d\nPreis %d\nSpeichern",SkinShop[EditSkinShop{playerid}][OWNER],SkinShop[EditSkinShop{playerid}][X],SkinShop[EditSkinShop{playerid}][Y],SkinShop[EditSkinShop{playerid}][Z],SkinShop[EditSkinShop{playerid}][CASH],SkinShop[EditSkinShop{playerid}][INT],SkinShop[EditSkinShop{playerid}][PRICE]);
  373. return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_CREATE, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
  374. } case DIALOG_SKINSHOP_PLAYER_KONFIG: {
  375. if(!response)return 1;
  376. switch(listitem){
  377. case 0: return ShowPlayerDialog(playerid,DIALOG_SKINSHOP_PLAYER_KASSE,DIALOG_STYLE_LIST,"BIZ-Konfig","Einzahlen\nAuszahlen","Auswählen","Zurück");
  378. case 1: {
  379. strdel(SkinShop[EditSkinShop{playerid}][OWNER],0,MAX_PLAYER_NAME);
  380. strcat(SkinShop[EditSkinShop{playerid}][OWNER],"Niemand",MAX_PLAYER_NAME);
  381. format(ALLSTR2,200,"Zum Verkauf\n Preis: %d\n Besitzer: %s",SkinShop[EditSkinShop{playerid}][PRICE],SkinShop[EditSkinShop{playerid}][OWNER]);
  382. UpdateDynamic3DTextLabelText(SkinShop[EditSkinShop{playerid}][LABELEn],-1,ALLSTR2);
  383. SendClientMessage(playerid,-1,"Du hast dein BIZ verkauft");
  384. }
  385. }
  386. } case DIALOG_SKINSHOP_PLAYER_KASSE: {
  387. if(!response)return ShowPlayerDialog(playerid,DIALOG_SKINSHOP_PLAYER_KONFIG,DIALOG_STYLE_LIST,"BIZ-Konfig","Kasse\nVerkaufen","Auswählen","Beenden");
  388. format(ALLSTR2,200,"Du hast %d in deiner Kasse,",SkinShop[EditSkinShop{playerid}][CASH]);
  389. switch(listitem){
  390. case 0:return ShowPlayerDialog(playerid,DIALOG_SKINSHOP_PLAYER_EINZAHL,DIALOG_STYLE_INPUT,"BIZ-Konfig",ALLSTR2,"Auswählen","Zurück");
  391. case 1:return ShowPlayerDialog(playerid,DIALOG_SKINSHOP_PLAYER_AUSZAHL,DIALOG_STYLE_INPUT,"BIZ-Konfig",ALLSTR2,"Auswählen","Zurück");
  392. }
  393. } case DIALOG_SKINSHOP_PLAYER_AUSZAHL: {
  394. if(!response)return ShowPlayerDialog(playerid,DIALOG_SKINSHOP_PLAYER_KASSE,DIALOG_STYLE_LIST,"BIZ-Konfig","Einzahlen\nAuszahlen","Auswählen","Zurück");
  395. new val = strval(inputtext);
  396. if(val < 0 || val > SkinShop[EditSkinShop{playerid}][CASH]) return ShowPlayerDialog(playerid,DIALOG_SKINSHOP_PLAYER_AUSZAHL,DIALOG_STYLE_INPUT,"BIZ-Konfig","Eingabefehler","Auswählen","Zurück");
  397. GivePlayerMoney(playerid,val);
  398. SkinShop[EditSkinShop{playerid}][CASH] -= val;
  399. format(ALLSTR2,200,"Du hast %d in deiner Kasse",SkinShop[EditSkinShop{playerid}][CASH]);
  400. return ShowPlayerDialog(playerid,DIALOG_SKINSHOP_PLAYER_AUSZAHL,DIALOG_STYLE_INPUT,"BIZ-Konfig",ALLSTR2,"Auswählen","Zurück");
  401. } case DIALOG_SKINSHOP_PLAYER_EINZAHL: {
  402. if(!response)return ShowPlayerDialog(playerid,DIALOG_SKINSHOP_PLAYER_KASSE,DIALOG_STYLE_LIST,"BIZ-Konfig","Einzahlen\nAuszahlen","Auswählen","Zurück");
  403. new val = strval(inputtext);
  404. if(val < 0 || val > GetPlayerMoney(playerid)) return ShowPlayerDialog(playerid,DIALOG_SKINSHOP_PLAYER_EINZAHL,DIALOG_STYLE_INPUT,"BIZ-Konfig","Eingabefehler","Auswählen","Zurück");
  405. GivePlayerMoney(playerid,-val);
  406. SkinShop[EditSkinShop{playerid}][CASH] += val;
  407. format(ALLSTR2,200,"Du hast %d in deiner Kasse",SkinShop[EditSkinShop{playerid}][CASH]);
  408. return ShowPlayerDialog(playerid,DIALOG_SKINSHOP_PLAYER_EINZAHL,DIALOG_STYLE_INPUT,"BIZ-Konfig",ALLSTR2,"Auswählen","Zurück");
  409. }
  410. }
  411. return H_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  412. }
  413. forward H_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
  414. #if defined _A_OnDialogResponse
  415. #undef OnDialogResponse
  416. #else
  417. #define _A_OnDialogResponse
  418. #endif
  419. public H_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])<_A_:unhooked> return 1;
  420. public H_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) <> return 1;
  421. #define OnDialogResponse(%0,%1,%2,%3,%4) H_OnDialogResponse(%0,%1,%2,%3,%4)<_A_:hooked>
  422.  
  423.  
  424.  
  425.  
  426. public OnGameModeInit()
  427. {
  428. state _ALS_:hooked;
  429. mysql_log(LOG_DEBUG,LOG_TYPE_TEXT);
  430. con_Handle = mysql_connect(HOST, USER, DATABASE, PASSWORD, PORT);
  431. mysql_tquery(con_Handle,"CREATE TABLE IF NOT EXISTS `skinshops`(`id` INT AUTO_INCREMENT, `interior` TINYINT, `x` FLOAT, `y` FLOAT, `z` FLOAT,`owner` VARCHAR(24), `cash` INT, `price` INT, PRIMARY KEY(`id`)) AUTO_INCREMENT = 1, Engine=MyISAM;","","");
  432.  
  433. mysql_tquery(con_Handle,"SELECT * FROM `skinshops`;","@LOAD_SKINSHOP_DATA","");
  434. GlobalTextdraw[sSkinSelectionBO] = TextDrawCreate(563.599914, 342.726623, "usebox");
  435. TextDrawLetterSize(GlobalTextdraw[sSkinSelectionBO], 0.000000, 1.387037);
  436. TextDrawTextSize(GlobalTextdraw[sSkinSelectionBO], 208.399963, 0.000000);
  437. TextDrawAlignment(GlobalTextdraw[sSkinSelectionBO], 1);
  438. TextDrawColor(GlobalTextdraw[sSkinSelectionBO], 0);
  439. TextDrawUseBox(GlobalTextdraw[sSkinSelectionBO], true);
  440. TextDrawBoxColor(GlobalTextdraw[sSkinSelectionBO], 269748991);
  441. TextDrawSetShadow(GlobalTextdraw[sSkinSelectionBO], 0);
  442. TextDrawSetOutline(GlobalTextdraw[sSkinSelectionBO], 0);
  443. TextDrawFont(GlobalTextdraw[sSkinSelectionBO], 1);
  444. TextDrawSetProportional(GlobalTextdraw[sSkinSelectionBO], 1);
  445.  
  446. GlobalTextdraw[sSkinSelectionBU] = TextDrawCreate(563.799682, 358.659912, "usebox");
  447. TextDrawLetterSize(GlobalTextdraw[sSkinSelectionBU], 0.000000, 1.147037);
  448. TextDrawTextSize(GlobalTextdraw[sSkinSelectionBU], 208.400009, 0.000000);
  449. TextDrawAlignment(GlobalTextdraw[sSkinSelectionBU], 1);
  450. TextDrawColor(GlobalTextdraw[sSkinSelectionBU], 0);
  451. TextDrawUseBox(GlobalTextdraw[sSkinSelectionBU], true);
  452. TextDrawBoxColor(GlobalTextdraw[sSkinSelectionBU], 255);
  453. TextDrawSetShadow(GlobalTextdraw[sSkinSelectionBU], 0);
  454. TextDrawSetOutline(GlobalTextdraw[sSkinSelectionBU], 0);
  455. TextDrawFont(GlobalTextdraw[sSkinSelectionBU], 0);
  456. TextDrawSetProportional(GlobalTextdraw[sSkinSelectionBU], 1);
  457.  
  458. GlobalTextdraw[sSkinSelectionRight] = TextDrawCreate(494.600006, 348.199981, ">>>");
  459. TextDrawLetterSize(GlobalTextdraw[sSkinSelectionRight], 0.449999, 1.600000);
  460. TextDrawAlignment(GlobalTextdraw[sSkinSelectionRight], 1);
  461. TextDrawColor(GlobalTextdraw[sSkinSelectionRight], -399363329);
  462. TextDrawSetShadow(GlobalTextdraw[sSkinSelectionRight], 0);
  463. TextDrawSetOutline(GlobalTextdraw[sSkinSelectionRight], 1);
  464. TextDrawBackgroundColor(GlobalTextdraw[sSkinSelectionRight], 51);
  465. TextDrawFont(GlobalTextdraw[sSkinSelectionRight], 1);
  466. TextDrawSetProportional(GlobalTextdraw[sSkinSelectionRight], 1);
  467. TextDrawSetSelectable(GlobalTextdraw[sSkinSelectionRight], true);
  468. TextDrawTextSize(GlobalTextdraw[sSkinSelectionRight],544.199981, 20.0);
  469.  
  470. GlobalTextdraw[sSkinSelectionBuy] = TextDrawCreate(349.199981, 347.706665, "Kaufen");
  471. TextDrawLetterSize(GlobalTextdraw[sSkinSelectionBuy], 0.449999, 1.600000);
  472. TextDrawAlignment(GlobalTextdraw[sSkinSelectionBuy], 1);
  473. TextDrawColor(GlobalTextdraw[sSkinSelectionBuy], -399363329);
  474. TextDrawSetShadow(GlobalTextdraw[sSkinSelectionBuy], 0);
  475. TextDrawSetOutline(GlobalTextdraw[sSkinSelectionBuy], 1);
  476. TextDrawBackgroundColor(GlobalTextdraw[sSkinSelectionBuy], 51);
  477. TextDrawFont(GlobalTextdraw[sSkinSelectionBuy], 2);
  478. TextDrawSetProportional(GlobalTextdraw[sSkinSelectionBuy], 1);
  479. TextDrawSetSelectable(GlobalTextdraw[sSkinSelectionBuy], true);
  480. TextDrawTextSize(GlobalTextdraw[sSkinSelectionBuy],439.199981, 20.0);
  481.  
  482. GlobalTextdraw[sSkinSelectionLeft] = TextDrawCreate(243.200057, 347.946655, "<<<");
  483. TextDrawLetterSize(GlobalTextdraw[sSkinSelectionLeft], 0.449999, 1.600000);
  484. TextDrawAlignment(GlobalTextdraw[sSkinSelectionLeft], 1);
  485. TextDrawColor(GlobalTextdraw[sSkinSelectionLeft], -399363329);
  486. TextDrawSetShadow(GlobalTextdraw[sSkinSelectionLeft], 0);
  487. TextDrawSetOutline(GlobalTextdraw[sSkinSelectionLeft], 1);
  488. TextDrawBackgroundColor(GlobalTextdraw[sSkinSelectionLeft], 51);
  489. TextDrawFont(GlobalTextdraw[sSkinSelectionLeft], 1);
  490. TextDrawSetProportional(GlobalTextdraw[sSkinSelectionLeft], 1);
  491. TextDrawSetSelectable(GlobalTextdraw[sSkinSelectionLeft], true);
  492. TextDrawTextSize(GlobalTextdraw[sSkinSelectionLeft],283.200057, 20.0);
  493. return H_OnGameModeInit();
  494. }
  495. forward H_OnGameModeInit();
  496. #if defined _ALS_OnGameModeInit
  497. #undef OnGameModeInit
  498. #else
  499. #define _ALS_OnGameModeInit
  500. #endif
  501. public H_OnGameModeInit() <_ALS_:unhooked> return 1;
  502. public H_OnGameModeInit() <> return 1;
  503. #define OnGameModeInit(%0) H_OnGameModeInit(%0)<_ALS_:hooked>
  504.  
  505.  
  506. public OnGameModeExit()
  507. {
  508. state _A_:hooked;
  509. new i;
  510. for(; i != MAX_SKINSHOPS; ++i){
  511. if(SkinShop[i][ID] == 0)continue;
  512. mysql_format(con_Handle,ALLSTR,200,"UPDATE `skinshops` SET `interior` = %d, `owner` = '%e', `cash` = %d WHERE `id` = %d;",SkinShop[i][INT],SkinShop[i][OWNER],SkinShop[i][CASH],SkinShop[i][ID]);
  513. mysql_tquery(con_Handle,ALLSTR,"","");
  514. }
  515. return H_OnGameModeExit();
  516. }
  517. forward H_OnGameModeExit();
  518. #if defined _A_OnGameModeExit
  519. #undef OnGameModeExit
  520. #else
  521. #define _A_OnGameModeExit
  522. #endif
  523. public H_OnGameModeExit() <_A_:unhooked> return 1;
  524. public H_OnGameModeExit() <> return 1;
  525. #define OnGameModeExit(%0) H_OnGameModeExit(%0)<_A_:hooked>
  526.  
  527. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  528. {
  529. state _A_:hooked;
  530. if(newkeys & KEY_FIRE){
  531. new vw=GetPlayerVirtualWorld(playerid);
  532. for(new i; i != MAX_SKINSHOPS; ++i){
  533. if(SkinShop[i][ID] == 0)continue;
  534. if(IsPlayerInRangeOfPoint(playerid,2.0,SkinShop[i][X],SkinShop[i][Y],SkinShop[i][Z])){
  535. printf("%d",i);
  536. SetPlayerInterior(playerid,InteriorArray[SkinShop[i][INT]][INT]);
  537. SetPlayerVirtualWorld(playerid,SkinShop[i][ID]);
  538. SetPlayerPos(playerid,InteriorArray[SkinShop[i][INT]][X],InteriorArray[SkinShop[i][INT]][Y],InteriorArray[SkinShop[i][INT]][Z]);
  539. EditSkinShop{playerid} = i;
  540. return SetPlayerFacingAngle(playerid,InteriorArray[SkinShop[i][INT]][A]);
  541. }else if(vw == SkinShop[i][ID] && IsPlayerInRangeOfPoint(playerid,2.0,InteriorArray[SkinShop[i][INT]][X],InteriorArray[SkinShop[i][INT]][Y],InteriorArray[SkinShop[i][INT]][Z])){
  542. SetPlayerInterior(playerid,0);
  543. SetPlayerVirtualWorld(playerid,0);
  544. return SetPlayerPos(playerid,SkinShop[i][X],SkinShop[i][Y],SkinShop[i][Z]);
  545. }
  546. }
  547. if(IsPlayerInRangeOfPoint(playerid,2.0,InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uPUX],InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uPUY],InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uPUZ])){
  548. PlayerInfo[playerid][pGeschlecht] = SetArrayMarker(playerid);
  549. SetPlayerPos(playerid,InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uX],InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uY],InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uZ]);
  550. SetPlayerFacingAngle(playerid,InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uA]);
  551. SetPlayerCameraLookAt(playerid,InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uX],InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uY],InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uZ]);
  552. SetPlayerCameraPos(playerid,InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uCPX],InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uCPY],InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uCPZ]);
  553. TextDrawShowForPlayer(playerid,GlobalTextdraw[sSkinSelectionBO]);
  554. TextDrawShowForPlayer(playerid,GlobalTextdraw[sSkinSelectionBU]);
  555. TextDrawShowForPlayer(playerid,GlobalTextdraw[sSkinSelectionRight]);
  556. TextDrawShowForPlayer(playerid,GlobalTextdraw[sSkinSelectionBuy]);
  557. TextDrawShowForPlayer(playerid,GlobalTextdraw[sSkinSelectionLeft]);
  558. SelectTextDraw(playerid, 0x00FF00FF);
  559. return SetPlayerVirtualWorld(playerid,SkinShop[EditSkinShop{playerid}][ID]+playerid+10);
  560. }
  561. }
  562. return H_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
  563. }
  564. forward H_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
  565. #if defined _A_OnPlayerKeyStateChange
  566. #undef OnPlayerKeyStateChange
  567. #else
  568. #define _A_OnPlayerKeyStateChange
  569. #endif
  570. public H_OnPlayerKeyStateChange(playerid, newkeys, oldkeys)<_A_:unhooked> return 1;
  571. public H_OnPlayerKeyStateChange(playerid, newkeys, oldkeys) <> return 1;
  572. #define OnPlayerKeyStateChange(%0,%1,%2) H_OnPlayerKeyStateChange(%0,%1,%2)<_A_:hooked>
  573.  
  574.  
  575. public OnPlayerClickTextDraw(playerid, Text:clickedid)
  576. {
  577. state _A_:hooked;
  578. if(_:clickedid == INVALID_TEXT_DRAW){
  579. SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]);
  580. TextDrawHideForPlayer(playerid,GlobalTextdraw[sSkinSelectionBO]);
  581. TextDrawHideForPlayer(playerid,GlobalTextdraw[sSkinSelectionBU]);
  582. TextDrawHideForPlayer(playerid,GlobalTextdraw[sSkinSelectionRight]);
  583. TextDrawHideForPlayer(playerid,GlobalTextdraw[sSkinSelectionBuy]);
  584. TextDrawHideForPlayer(playerid,GlobalTextdraw[sSkinSelectionLeft]);
  585. SetPlayerPos(playerid,InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uPUX]+1.0,InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uPUY],InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uPUZ]);
  586. SetPlayerVirtualWorld(playerid,SkinShop[EditSkinShop{playerid}][ID]);
  587. return SetCameraBehindPlayer(playerid);
  588. }else if(clickedid == GlobalTextdraw[sSkinSelectionBuy]){
  589. if(GetPlayerMoney(playerid) < _SKIN_PRICE)return SendClientMessage(playerid,-1,"Du hast zu wenig Geld!");
  590. SetPlayerPos(playerid,InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uPUX]+1.0,InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uPUY],InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uPUZ]);
  591. SetPlayerVirtualWorld(playerid,SkinShop[EditSkinShop{playerid}][ID]);
  592. TextDrawHideForPlayer(playerid,GlobalTextdraw[sSkinSelectionBO]);
  593. TextDrawHideForPlayer(playerid,GlobalTextdraw[sSkinSelectionBU]);
  594. TextDrawHideForPlayer(playerid,GlobalTextdraw[sSkinSelectionRight]);
  595. TextDrawHideForPlayer(playerid,GlobalTextdraw[sSkinSelectionBuy]);
  596. TextDrawHideForPlayer(playerid,GlobalTextdraw[sSkinSelectionLeft]);
  597. GivePlayerMoney(playerid,-_SKIN_PRICE);
  598. SkinShop[EditSkinShop{playerid}][CASH] += _SKIN_PRICE;
  599. return SetCameraBehindPlayer(playerid);
  600. }else if(clickedid == GlobalTextdraw[sSkinSelectionRight]){
  601. switch(PlayerInfo[playerid][pGeschlecht] ){
  602. case 1:{
  603. if(GetSecoundArrayMarker(playerid) == 53 && GetFirstArrayMarker(playerid) == 0){
  604. ArrayMarker[playerid]= 0;
  605. return SetPlayerSkin(playerid,GetSkin(playerid));
  606. }
  607. } case 0:{
  608. if(GetSecoundArrayMarker(playerid) == 75 && GetFirstArrayMarker(playerid) == 2){
  609. ArrayMarker[playerid] = 0;
  610. ArrayMarker[playerid]|= (54 << 8);
  611. return SetPlayerSkin(playerid,GetSkin(playerid));
  612. }
  613. }
  614. }
  615. if(GetFirstArrayMarker(playerid) == 2){
  616. SetFirstArrayMarker(playerid,-2);
  617. SetSecoundArrayMarker(playerid,1);
  618. }else SetFirstArrayMarker(playerid,1);
  619. return SetPlayerSkin(playerid,GetSkin(playerid));
  620. }else if(clickedid == GlobalTextdraw[sSkinSelectionLeft]){
  621. switch(PlayerInfo[playerid][pGeschlecht] ){
  622. case 1:{
  623. if(GetSecoundArrayMarker(playerid) == 0 && GetFirstArrayMarker(playerid) == 0){
  624. ArrayMarker[playerid] = 0;
  625. ArrayMarker[playerid]|= (53 << 8);
  626. return SetPlayerSkin(playerid,GetSkin(playerid));
  627. }
  628. } case 0: {
  629. if(GetSecoundArrayMarker(playerid) == 54 && GetFirstArrayMarker(playerid) == 0){
  630. ArrayMarker[playerid]= 0;
  631. ArrayMarker[playerid]|= 2;
  632. ArrayMarker[playerid]|= (75 << 8);
  633. return SetPlayerSkin(playerid,GetSkin(playerid));
  634. }
  635. }
  636. }
  637. if(GetFirstArrayMarker(playerid) == 0){
  638. SetFirstArrayMarker(playerid,2);
  639. SetSecoundArrayMarker(playerid,-1);
  640. }else SetFirstArrayMarker(playerid,-1);
  641. return SetPlayerSkin(playerid,GetSkin(playerid));
  642. }
  643. return H_OnPlayerClickTextDraw(playerid, Text:clickedid);
  644. }
  645. forward H_OnPlayerClickTextDraw(playerid, Text:clickedid);
  646. #if defined _A_OnPlayerClickTextDraw
  647. #undef OnPlayerClickTextDraw
  648. #else
  649. #define _A_OnPlayerClickTextDraw
  650. #endif
  651. public H_OnPlayerClickTextDraw(playerid, Text:clickedid) <_A_:unhooked> return 1;
  652. public H_OnPlayerClickTextDraw(playerid, Text:clickedid) <> return 1;
  653. #define OnPlayerClickTextDraw(%0,%1) H_OnPlayerClickTextDraw(%0,%1)<_A_:hooked>
  654.  
  655. CMD->bizkonfig(playerid,params[]){
  656. new i;
  657. for(; i != MAX_SKINSHOPS; ++i){
  658. if(!IsPlayerInRangeOfPoint(playerid,2.0,SkinShop[i][X],SkinShop[i][Y],SkinShop[i][Z]) || strcmp(SkinShop[i][OWNER], PlayerName(playerid), false) != 0)continue;
  659. EditSkinShop{playerid} = i;
  660. return ShowPlayerDialog(playerid,DIALOG_SKINSHOP_PLAYER_KONFIG,DIALOG_STYLE_LIST,"BIZ-Konfig","Kasse\nVerkaufen","Auswählen","Beenden");
  661. }
  662. return 1;
  663. }
  664. CMD->buybiz(playerid,params[]){
  665. new i;
  666. for(; i != MAX_SKINSHOPS; ++i){
  667. if(!IsPlayerInRangeOfPoint(playerid,2.0,SkinShop[i][X],SkinShop[i][Y],SkinShop[i][Z]) || strcmp(SkinShop[i][OWNER], "Niemand", false) != 0)continue;
  668. if(GetPlayerMoney(playerid) < SkinShop[i][PRICE])return SendClientMessage(playerid,-1,"Du hast zu wenig Geld!");
  669. strdel(SkinShop[i][OWNER],0,MAX_PLAYER_NAME);
  670. strcat(SkinShop[i][OWNER],PlayerName(playerid),MAX_PLAYER_NAME);
  671. format(ALLSTR2,200,"Besitzer: %s\n Benutze: Linke Maustaste um einzutreten.",SkinShop[i][OWNER]);
  672. UpdateDynamic3DTextLabelText(SkinShop[i][LABELEn],-1,ALLSTR2);
  673. return SendClientMessage(playerid,-1,"Du hast das Business gekauft");
  674. }
  675. return 1;
  676. }
  677. CMD->edit(playerid,params[]){
  678. return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_KONFIG, DIALOG_STYLE_LIST,"Skinshop","Bearbeiten\nErstellen\nEntfernen","Auswählen","Beenden");
  679. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement