Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- SKINSHOPSYSTEM BY IPROTOTYPEI
- You should make some settings, for example the player-variables, add your admin statments and add a function to get the player name.
- */
- #if !defined _A_
- forward public _A_();
- _A_()<_A_:unhooked>{}
- _A_()<_A_:hooked>{}
- _A_()<>{}
- #endif
- #if !defined _ALS_
- forward public _ALS_();
- _ALS_()<_ALS_:unhooked>{}
- _ALS_()<_ALS_:hooked>{}
- _ALS_()<>{}
- #endif
- forward @LOAD_SKINSHOP_DATA();
- forward @GETID(id);
- #define Compare9BitBlock(%0,%1,%2) (((%0 >>> (%2*9))& ~(0xFFFFFE00)) == %1)
- #define GetSkin(%0) ((SkinArray[(ArrayMarker[%0] >> 8)] >>> ((ArrayMarker[%0] & ~(0xFF<<8))*9))& ~(0xFFFFFF<<9))
- #define GetSecoundArrayMarker(%0) (ArrayMarker[%0] >> 8)
- #define GetFirstArrayMarker(%0) (ArrayMarker[%0] & ~(0xFF<<8))
- #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)
- #define SetFirstArrayMarker(%0,%1) ArrayMarker[%0] |= (((ArrayMarker[%0] & ~(0xFF<<8))+ %1) << 16), ArrayMarker[%0] &= ~(0xFF),ArrayMarker[%0] |= (ArrayMarker[%0] >>> 16),ArrayMarker[%0] &= ~(0xFF << 16)
- #define MAX_SKINSHOPS 10
- #define _SKIN_PRICE 100
- #define HOST "localhost"
- #define USER "root"
- #define DATABASE "amazing"
- #define PASSWORD ""
- #define PORT 3306
- enum PlayerVars {
- pGeschlecht,
- pSkin,
- };
- new PlayerInfo[MAX_PLAYERS][PlayerVars];
- //Skinshop system
- stock const static SkinArray[76]={
- 0x80200,0x180A04,0x3C1C08,0x4C240C,
- 0x5C2C10,0x6C3414,0x803C18,0x90461C,0xB05620,
- 0xC05E24,0xD06628,0xF4782C,0x1108630,0x1249034,
- 0x144A038,0x158A83C,0x184C040,0x194C844,0x1A4D048,
- 0x1B4D84C,0x1C4E050,0x1D4E854,0x1E4F058,0x1F8FA5C,
- 0x2150860,0x2251064,0x2492068,0x269326C,0x27D3C70,
- 0x28D4474,0x29D4C78,0x2B5567C,0x2C56080,0x2D96A84,
- 0x2E97288,0x3217A8C,0x3399890,0x365A494,0x37DBA98,
- 0x399CA9C,0x3BE00A0,0x3DDE4A4,0x3F1F4A8,0x409FEAC,
- 0x41A0AB0,0x43216B4,0x4421EB8,0x45226BC,0x4622EC0,
- 0x47236C4,0x4823EC8,0x49246CC,0x4A24ED0,0xD4,
- /////////////////////Männer//////////////////////
- 0x2C1409,0x983E0D,
- 0xD45228,0xE47037,0x1148240,0x1549A4C,0x168B258,
- 0x1E8BA5C,0x2290682,0x2451A8C,0x2612E96,0x2C958A9,
- 0x30580BF,0x31588C3,0x33592C7,0x355A8D3,0x369B0D7,
- 0x389C2E0,0x3B1D2E8,0x3D1E6EE,0x405F6F6,0x2550A,
- /////////////////////Frauen//////////////////////
- };
- enum _INT {
- ID,
- Float:X,
- Float:Y,
- Float:Z,
- Float:A,
- INT,
- Float:uPUX,
- Float:uPUY,
- Float:uPUZ,
- Float:uX,
- Float:uY,
- Float:uZ,
- Float:uA,
- Float:uCPX,
- Float:uCPY,
- Float:uCPZ,
- };
- stock const static InteriorArray[][_INT] ={
- {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},
- {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},
- {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},
- {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},
- {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}
- };
- enum {
- DIALOG_SKINSHOP_KONFIG = 10000,
- DIALOG_SKINSHOP_EDIT,
- DIALOG_SKINSHOP_EDIT_NAME,
- DIALOG_SKINSHOP_EDIT_KASSE,
- DIALOG_SKINSHOP_EDIT_PRICE,
- DIALOG_SKINSHOP_EDIT_INTERIOR,
- DIALOG_SKINSHOP_CREATE,
- DIALOG_SKINSHOP_CREATE_NAME,
- DIALOG_SKINSHOP_CREATE_KASSE,
- DIALOG_SKINSHOP_CREATE_PRICE,
- DIALOG_SKINSHOP_CREATE_INTERIOR,
- DIALOG_SKINSHOP_PLAYER_KONFIG,
- DIALOG_SKINSHOP_PLAYER_KASSE,
- DIALOG_SKINSHOP_PLAYER_AUSZAHL,
- DIALOG_SKINSHOP_PLAYER_EINZAHL,
- };
- enum _SH {
- ID,
- INT,
- Float:X,
- Float:Y,
- Float:Z,
- OWNER[MAX_PLAYER_NAME],
- CASH,
- PRICE,
- Text3D:LABELEn,
- Text3D:LABELEx,
- PICKUPEn,
- PICKUPEx,
- Text3D:LABELINT,
- PICKUPINT,
- };
- enum _TD {
- Text:sSkinSelectionBU,
- Text:sSkinSelectionBO,
- Text:sSkinSelectionLeft,
- Text:sSkinSelectionRight,
- Text:sSkinSelectionBuy,
- };
- new static stock SkinShop[MAX_SKINSHOPS][_SH],
- ArrayMarker[MAX_PLAYERS],
- EditSkinShop[MAX_PLAYERS char],
- ALLSTR[200],
- ALLSTR2[200],
- GlobalTextdraw[_TD],
- con_Handle;
- stock static bool:SetArrayMarker(playerid){
- ArrayMarker[playerid] = 0;
- PlayerInfo[playerid][pSkin] = GetPlayerSkin(playerid);
- for(new i; i != 54; ++i){
- for(new x; x != 3; ++x){
- if(!Compare9BitBlock(SkinArray[i],PlayerInfo[playerid][pSkin] ,x))continue;
- ArrayMarker[playerid]|=x,
- ArrayMarker[playerid]|= (i << 8);
- return true;
- }
- }
- for(new i = 54; i != 76; ++i){
- for(new x; x != 3; ++x){
- if(!Compare9BitBlock(SkinArray[i],PlayerInfo[playerid][pSkin] ,x))continue;
- ArrayMarker[playerid]|=x,
- ArrayMarker[playerid]|= (i << 8);
- return false;
- }
- }
- return !!printf("Der Skin %d befindet sich nicht im Array %d",PlayerInfo[playerid][pSkin]);
- }
- @GETID(id){
- SkinShop[id][ID] = cache_insert_id();
- SkinShop[id][PICKUPEn] = CreateDynamicPickup(1275, 1, SkinShop[id][X], SkinShop[id][Y], SkinShop[id][Z]);
- 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]);
- 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]);
- format(ALLSTR2,200,"Zum Verkauf\n Preis: %d\n Besitzer: %s",SkinShop[id][PRICE],SkinShop[id][OWNER]);
- SkinShop[id][LABELEn] = CreateDynamic3DTextLabel(ALLSTR2, -1, SkinShop[id][X], SkinShop[id][Y], SkinShop[id][Z]+1.0, 100.0);
- 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]);
- 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]);
- return 1;
- }
- _UPDATE_SKINSHOP(id){
- new str[64];
- SkinShop[id][PICKUPEn] = CreateDynamicPickup(1275, 1, SkinShop[id][X], SkinShop[id][Y], SkinShop[id][Z]);
- 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]);
- 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]);
- (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]);
- SkinShop[id][LABELEn] = CreateDynamic3DTextLabel(str, -1, SkinShop[id][X], SkinShop[id][Y], SkinShop[id][Z]+1.0, 100.0);
- 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]);
- 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]);
- return 1;
- }
- @LOAD_SKINSHOP_DATA(){
- new rows,num,i,str[64];
- cache_get_data(rows,num);
- for(; i != rows; ++i){
- SkinShop[i][ID] = cache_get_row_int(i,0);
- SkinShop[i][INT]= cache_get_row_int(i,1);
- SkinShop[i][X] = cache_get_row_float(i,2);
- SkinShop[i][Y] = cache_get_row_float(i,3);
- SkinShop[i][Z] = cache_get_row_float(i,4);
- cache_get_row(i,5,SkinShop[i][OWNER],con_Handle,MAX_PLAYER_NAME);
- SkinShop[i][CASH] = cache_get_row_int(i,6);
- SkinShop[i][PRICE] = cache_get_row_int(i,7);
- SkinShop[i][PICKUPEn] = CreateDynamicPickup(1275, 1, SkinShop[i][X], SkinShop[i][Y], SkinShop[i][Z]);
- 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]);
- 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]);
- (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]);
- SkinShop[i][LABELEn] = CreateDynamic3DTextLabel(str, -1, SkinShop[i][X], SkinShop[i][Y], SkinShop[i][Z]+1.0, 100.0);
- 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]);
- 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]);
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- state _A_:hooked;
- switch(dialogid) {
- case DIALOG_SKINSHOP_KONFIG:{
- if(!response)return 1;
- switch(listitem){
- case 0:{
- new i;
- for(; i != MAX_SKINSHOPS; ++i){
- if(SkinShop[i][ID] == 0 || !IsPlayerInRangeOfPoint(playerid,5.0,SkinShop[i][X],SkinShop[i][Y],SkinShop[i][Z]))continue;
- EditSkinShop{playerid} = i;
- 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]);
- return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_EDIT, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
- }
- return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_KONFIG, DIALOG_STYLE_LIST,"Skinshop","Bearbeiten\nErstellen\nEntfernen","Auswählen","Beenden"), SendClientMessage(playerid,-1,"Kein Skinshop gefunden!");
- } case 1: {
- new i;
- for(; i != MAX_SKINSHOPS; ++i){
- if(SkinShop[i][ID] != 0)continue;
- EditSkinShop{playerid} = i;
- strcat(SkinShop[i][OWNER],"Niemand",MAX_PLAYER_NAME);
- SkinShop[i][INT] = -1;
- return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_CREATE, DIALOG_STYLE_LIST,"Skinshop","Besitzer: Niemand \nPosition: Keine\nInterior: Keins\nPreis: 0\nSpeichern","Auswählen","Zurück");
- }
- return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_KONFIG, DIALOG_STYLE_LIST,"Skinshop","Bearbeiten\nErstellen\nEntfernen","Auswählen","Beenden"), SendClientMessage(playerid,-1,"Du kannst kein Skinshop erstellen!");
- } case 2: {
- new i,x;
- for(; i != MAX_SKINSHOPS; ++i){
- if(SkinShop[i][ID] == 0 || !IsPlayerInRangeOfPoint(playerid,5.0,SkinShop[i][X],SkinShop[i][Y],SkinShop[i][Z]))continue;
- printf("%d",i);
- DestroyDynamicPickup(SkinShop[i][PICKUPEn]);
- DestroyDynamicPickup(SkinShop[i][PICKUPEx]);
- DestroyDynamicPickup(SkinShop[i][PICKUPINT]);
- DestroyDynamic3DTextLabel(SkinShop[i][LABELEn]);
- DestroyDynamic3DTextLabel(SkinShop[i][LABELEx]);
- DestroyDynamic3DTextLabel(SkinShop[i][LABELINT]);
- mysql_format(con_Handle,ALLSTR,200,"DELETE FROM `skinshops` WHERE `id` = %d;",SkinShop[i][ID]);
- mysql_tquery(con_Handle,ALLSTR,"","");
- for(; x != _:_SH ; ++i)SkinShop[i][_SH:x]= 0;
- SendClientMessage(playerid,-1,"Skinshop gelöscht");
- return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_KONFIG, DIALOG_STYLE_LIST,"Skinshop","Bearbeiten\nErstellen\nEntfernen","Auswählen","Beenden");
- }
- return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_KONFIG, DIALOG_STYLE_LIST,"Skinshop","Bearbeiten\nErstellen\nEntfernen","Auswählen","Beenden"), SendClientMessage(playerid,-1,"Kein Skinshop gefunden!");
- }
- }
- } case DIALOG_SKINSHOP_EDIT: {
- if(!response)return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_KONFIG, DIALOG_STYLE_LIST,"Skinshop","Bearbeiten\nErstellen\nEntfernen","Auswählen","Beenden");
- switch(listitem){
- 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");
- case 1:{
- GetPlayerPos(playerid,SkinShop[EditSkinShop{playerid}][X],SkinShop[EditSkinShop{playerid}][Y],SkinShop[EditSkinShop{playerid}][Z]);
- SendClientMessage(playerid,-1,"Du hast den Eingangspunkt erfolgreich geändert");
- 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]);
- return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_EDIT, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
- }
- case 2: return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_EDIT_KASSE, DIALOG_STYLE_INPUT,"Skinshop","Gebe hier den Betrag in der Bizkasse ein","Ändern","Zurück");
- case 3: return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_EDIT_INTERIOR, DIALOG_STYLE_LIST,"Skinshop","Prolaps\nVictim\nSuburban\nZip\nDidier sachs","Ändern","Zurück");
- case 4: return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_EDIT_PRICE, DIALOG_STYLE_INPUT,"Skinshop","Gebe hier den Verkaufspreis ein des Bizes","Ändern","Zurück");
- case 5:{
- DestroyDynamicPickup(SkinShop[EditSkinShop{playerid}][PICKUPEn]);
- DestroyDynamicPickup(SkinShop[EditSkinShop{playerid}][PICKUPEx]);
- DestroyDynamicPickup(SkinShop[EditSkinShop{playerid}][PICKUPINT]);
- DestroyDynamic3DTextLabel(SkinShop[EditSkinShop{playerid}][LABELEn]);
- DestroyDynamic3DTextLabel(SkinShop[EditSkinShop{playerid}][LABELEx]);
- DestroyDynamic3DTextLabel(SkinShop[EditSkinShop{playerid}][LABELINT]);
- _UPDATE_SKINSHOP(EditSkinShop{playerid});
- }
- }
- } case DIALOG_SKINSHOP_EDIT_NAME: {
- if(!response){
- 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]);
- return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_EDIT, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
- }
- strdel(SkinShop[EditSkinShop{playerid}][OWNER],0,MAX_PLAYER_NAME);
- strcat(SkinShop[EditSkinShop{playerid}][OWNER], inputtext,MAX_PLAYER_NAME);
- SendClientMessage(playerid,-1,"Du hast den Besitzer erfolgreich geändert");
- 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]);
- return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_EDIT, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
- } case DIALOG_SKINSHOP_EDIT_KASSE: {
- if(!response){
- 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]);
- return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_EDIT, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
- }
- SkinShop[EditSkinShop{playerid}][CASH] = strval(inputtext);
- SendClientMessage(playerid,-1,"Du hast die Bizkasse erfolgreich geändert");
- 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]);
- return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_EDIT, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
- } case DIALOG_SKINSHOP_EDIT_PRICE: {
- if(!response){
- 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]);
- return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_EDIT, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
- }
- SkinShop[EditSkinShop{playerid}][PRICE] = strval(inputtext);
- SendClientMessage(playerid,-1,"Du hast den Verkaufspreis erfolgreich geändert");
- 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]);
- return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_EDIT, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
- } case DIALOG_SKINSHOP_EDIT_INTERIOR: {
- if(!response)return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_EDIT, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
- SkinShop[EditSkinShop{playerid}][INT] = listitem;
- 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]);
- return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_EDIT, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
- } case DIALOG_SKINSHOP_CREATE: {
- if(!response)return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_KONFIG, DIALOG_STYLE_LIST,"Skinshop","Bearbeiten\nErstellen\nEntfernen","Auswählen","Beenden");
- switch(listitem){
- 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");
- case 1:{
- GetPlayerPos(playerid,SkinShop[EditSkinShop{playerid}][X],SkinShop[EditSkinShop{playerid}][Y],SkinShop[EditSkinShop{playerid}][Z]);
- SendClientMessage(playerid,-1,"Du hast den Eingangspunkt erfolgreich geändert");
- 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]);
- return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_CREATE, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
- }
- case 2: return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_CREATE_KASSE, DIALOG_STYLE_INPUT,"Skinshop","Gebe hier den Betrag in der Bizkasse ein","Ändern","Zurück");
- case 3: return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_CREATE_INTERIOR, DIALOG_STYLE_LIST,"Skinshop","Prolaps\nVictim\nSuburban\nZip\nDidier sachs","Ändern","Zurück");
- case 4: return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_CREATE_PRICE, DIALOG_STYLE_INPUT,"Skinshop","Gebe hier den Verkaufspreis ein des Bizes","Ändern","Zurück");
- case 5:{
- 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]);
- mysql_tquery(con_Handle,ALLSTR,"@GETID","i",EditSkinShop{playerid});
- }
- }
- } case DIALOG_SKINSHOP_CREATE_NAME: {
- if(!response){
- 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]);
- return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_CREATE, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
- }
- strdel(SkinShop[EditSkinShop{playerid}][OWNER],0,MAX_PLAYER_NAME);
- strcat(SkinShop[EditSkinShop{playerid}][OWNER], inputtext,MAX_PLAYER_NAME);
- SendClientMessage(playerid,-1,"Du hast den Besitzer erfolgreich geändert");
- 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]);
- return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_CREATE, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
- } case DIALOG_SKINSHOP_CREATE_KASSE: {
- if(!response){
- 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]);
- return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_CREATE, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
- }
- SkinShop[EditSkinShop{playerid}][CASH] = strval(inputtext);
- SendClientMessage(playerid,-1,"Du hast die Bizkasse erfolgreich geändert");
- 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]);
- return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_CREATE, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
- } case DIALOG_SKINSHOP_CREATE_PRICE: {
- if(!response){
- 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]);
- return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_CREATE, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
- }
- SkinShop[EditSkinShop{playerid}][PRICE] = strval(inputtext);
- SendClientMessage(playerid,-1,"Du hast den Verkaufspreis erfolgreich geändert");
- 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]);
- return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_CREATE, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
- } case DIALOG_SKINSHOP_CREATE_INTERIOR: {
- if(!response)return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_CREATE, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
- SkinShop[EditSkinShop{playerid}][INT] = listitem;
- 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]);
- return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_CREATE, DIALOG_STYLE_LIST,"Skinshop",ALLSTR,"Auswählen","Zurück");
- } case DIALOG_SKINSHOP_PLAYER_KONFIG: {
- if(!response)return 1;
- switch(listitem){
- case 0: return ShowPlayerDialog(playerid,DIALOG_SKINSHOP_PLAYER_KASSE,DIALOG_STYLE_LIST,"BIZ-Konfig","Einzahlen\nAuszahlen","Auswählen","Zurück");
- case 1: {
- strdel(SkinShop[EditSkinShop{playerid}][OWNER],0,MAX_PLAYER_NAME);
- strcat(SkinShop[EditSkinShop{playerid}][OWNER],"Niemand",MAX_PLAYER_NAME);
- format(ALLSTR2,200,"Zum Verkauf\n Preis: %d\n Besitzer: %s",SkinShop[EditSkinShop{playerid}][PRICE],SkinShop[EditSkinShop{playerid}][OWNER]);
- UpdateDynamic3DTextLabelText(SkinShop[EditSkinShop{playerid}][LABELEn],-1,ALLSTR2);
- SendClientMessage(playerid,-1,"Du hast dein BIZ verkauft");
- }
- }
- } case DIALOG_SKINSHOP_PLAYER_KASSE: {
- if(!response)return ShowPlayerDialog(playerid,DIALOG_SKINSHOP_PLAYER_KONFIG,DIALOG_STYLE_LIST,"BIZ-Konfig","Kasse\nVerkaufen","Auswählen","Beenden");
- format(ALLSTR2,200,"Du hast %d in deiner Kasse,",SkinShop[EditSkinShop{playerid}][CASH]);
- switch(listitem){
- case 0:return ShowPlayerDialog(playerid,DIALOG_SKINSHOP_PLAYER_EINZAHL,DIALOG_STYLE_INPUT,"BIZ-Konfig",ALLSTR2,"Auswählen","Zurück");
- case 1:return ShowPlayerDialog(playerid,DIALOG_SKINSHOP_PLAYER_AUSZAHL,DIALOG_STYLE_INPUT,"BIZ-Konfig",ALLSTR2,"Auswählen","Zurück");
- }
- } case DIALOG_SKINSHOP_PLAYER_AUSZAHL: {
- if(!response)return ShowPlayerDialog(playerid,DIALOG_SKINSHOP_PLAYER_KASSE,DIALOG_STYLE_LIST,"BIZ-Konfig","Einzahlen\nAuszahlen","Auswählen","Zurück");
- new val = strval(inputtext);
- 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");
- GivePlayerMoney(playerid,val);
- SkinShop[EditSkinShop{playerid}][CASH] -= val;
- format(ALLSTR2,200,"Du hast %d in deiner Kasse",SkinShop[EditSkinShop{playerid}][CASH]);
- return ShowPlayerDialog(playerid,DIALOG_SKINSHOP_PLAYER_AUSZAHL,DIALOG_STYLE_INPUT,"BIZ-Konfig",ALLSTR2,"Auswählen","Zurück");
- } case DIALOG_SKINSHOP_PLAYER_EINZAHL: {
- if(!response)return ShowPlayerDialog(playerid,DIALOG_SKINSHOP_PLAYER_KASSE,DIALOG_STYLE_LIST,"BIZ-Konfig","Einzahlen\nAuszahlen","Auswählen","Zurück");
- new val = strval(inputtext);
- if(val < 0 || val > GetPlayerMoney(playerid)) return ShowPlayerDialog(playerid,DIALOG_SKINSHOP_PLAYER_EINZAHL,DIALOG_STYLE_INPUT,"BIZ-Konfig","Eingabefehler","Auswählen","Zurück");
- GivePlayerMoney(playerid,-val);
- SkinShop[EditSkinShop{playerid}][CASH] += val;
- format(ALLSTR2,200,"Du hast %d in deiner Kasse",SkinShop[EditSkinShop{playerid}][CASH]);
- return ShowPlayerDialog(playerid,DIALOG_SKINSHOP_PLAYER_EINZAHL,DIALOG_STYLE_INPUT,"BIZ-Konfig",ALLSTR2,"Auswählen","Zurück");
- }
- }
- return H_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
- }
- forward H_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
- #if defined _A_OnDialogResponse
- #undef OnDialogResponse
- #else
- #define _A_OnDialogResponse
- #endif
- public H_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])<_A_:unhooked> return 1;
- public H_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) <> return 1;
- #define OnDialogResponse(%0,%1,%2,%3,%4) H_OnDialogResponse(%0,%1,%2,%3,%4)<_A_:hooked>
- public OnGameModeInit()
- {
- state _ALS_:hooked;
- mysql_log(LOG_DEBUG,LOG_TYPE_TEXT);
- con_Handle = mysql_connect(HOST, USER, DATABASE, PASSWORD, PORT);
- 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;","","");
- mysql_tquery(con_Handle,"SELECT * FROM `skinshops`;","@LOAD_SKINSHOP_DATA","");
- GlobalTextdraw[sSkinSelectionBO] = TextDrawCreate(563.599914, 342.726623, "usebox");
- TextDrawLetterSize(GlobalTextdraw[sSkinSelectionBO], 0.000000, 1.387037);
- TextDrawTextSize(GlobalTextdraw[sSkinSelectionBO], 208.399963, 0.000000);
- TextDrawAlignment(GlobalTextdraw[sSkinSelectionBO], 1);
- TextDrawColor(GlobalTextdraw[sSkinSelectionBO], 0);
- TextDrawUseBox(GlobalTextdraw[sSkinSelectionBO], true);
- TextDrawBoxColor(GlobalTextdraw[sSkinSelectionBO], 269748991);
- TextDrawSetShadow(GlobalTextdraw[sSkinSelectionBO], 0);
- TextDrawSetOutline(GlobalTextdraw[sSkinSelectionBO], 0);
- TextDrawFont(GlobalTextdraw[sSkinSelectionBO], 1);
- TextDrawSetProportional(GlobalTextdraw[sSkinSelectionBO], 1);
- GlobalTextdraw[sSkinSelectionBU] = TextDrawCreate(563.799682, 358.659912, "usebox");
- TextDrawLetterSize(GlobalTextdraw[sSkinSelectionBU], 0.000000, 1.147037);
- TextDrawTextSize(GlobalTextdraw[sSkinSelectionBU], 208.400009, 0.000000);
- TextDrawAlignment(GlobalTextdraw[sSkinSelectionBU], 1);
- TextDrawColor(GlobalTextdraw[sSkinSelectionBU], 0);
- TextDrawUseBox(GlobalTextdraw[sSkinSelectionBU], true);
- TextDrawBoxColor(GlobalTextdraw[sSkinSelectionBU], 255);
- TextDrawSetShadow(GlobalTextdraw[sSkinSelectionBU], 0);
- TextDrawSetOutline(GlobalTextdraw[sSkinSelectionBU], 0);
- TextDrawFont(GlobalTextdraw[sSkinSelectionBU], 0);
- TextDrawSetProportional(GlobalTextdraw[sSkinSelectionBU], 1);
- GlobalTextdraw[sSkinSelectionRight] = TextDrawCreate(494.600006, 348.199981, ">>>");
- TextDrawLetterSize(GlobalTextdraw[sSkinSelectionRight], 0.449999, 1.600000);
- TextDrawAlignment(GlobalTextdraw[sSkinSelectionRight], 1);
- TextDrawColor(GlobalTextdraw[sSkinSelectionRight], -399363329);
- TextDrawSetShadow(GlobalTextdraw[sSkinSelectionRight], 0);
- TextDrawSetOutline(GlobalTextdraw[sSkinSelectionRight], 1);
- TextDrawBackgroundColor(GlobalTextdraw[sSkinSelectionRight], 51);
- TextDrawFont(GlobalTextdraw[sSkinSelectionRight], 1);
- TextDrawSetProportional(GlobalTextdraw[sSkinSelectionRight], 1);
- TextDrawSetSelectable(GlobalTextdraw[sSkinSelectionRight], true);
- TextDrawTextSize(GlobalTextdraw[sSkinSelectionRight],544.199981, 20.0);
- GlobalTextdraw[sSkinSelectionBuy] = TextDrawCreate(349.199981, 347.706665, "Kaufen");
- TextDrawLetterSize(GlobalTextdraw[sSkinSelectionBuy], 0.449999, 1.600000);
- TextDrawAlignment(GlobalTextdraw[sSkinSelectionBuy], 1);
- TextDrawColor(GlobalTextdraw[sSkinSelectionBuy], -399363329);
- TextDrawSetShadow(GlobalTextdraw[sSkinSelectionBuy], 0);
- TextDrawSetOutline(GlobalTextdraw[sSkinSelectionBuy], 1);
- TextDrawBackgroundColor(GlobalTextdraw[sSkinSelectionBuy], 51);
- TextDrawFont(GlobalTextdraw[sSkinSelectionBuy], 2);
- TextDrawSetProportional(GlobalTextdraw[sSkinSelectionBuy], 1);
- TextDrawSetSelectable(GlobalTextdraw[sSkinSelectionBuy], true);
- TextDrawTextSize(GlobalTextdraw[sSkinSelectionBuy],439.199981, 20.0);
- GlobalTextdraw[sSkinSelectionLeft] = TextDrawCreate(243.200057, 347.946655, "<<<");
- TextDrawLetterSize(GlobalTextdraw[sSkinSelectionLeft], 0.449999, 1.600000);
- TextDrawAlignment(GlobalTextdraw[sSkinSelectionLeft], 1);
- TextDrawColor(GlobalTextdraw[sSkinSelectionLeft], -399363329);
- TextDrawSetShadow(GlobalTextdraw[sSkinSelectionLeft], 0);
- TextDrawSetOutline(GlobalTextdraw[sSkinSelectionLeft], 1);
- TextDrawBackgroundColor(GlobalTextdraw[sSkinSelectionLeft], 51);
- TextDrawFont(GlobalTextdraw[sSkinSelectionLeft], 1);
- TextDrawSetProportional(GlobalTextdraw[sSkinSelectionLeft], 1);
- TextDrawSetSelectable(GlobalTextdraw[sSkinSelectionLeft], true);
- TextDrawTextSize(GlobalTextdraw[sSkinSelectionLeft],283.200057, 20.0);
- return H_OnGameModeInit();
- }
- forward H_OnGameModeInit();
- #if defined _ALS_OnGameModeInit
- #undef OnGameModeInit
- #else
- #define _ALS_OnGameModeInit
- #endif
- public H_OnGameModeInit() <_ALS_:unhooked> return 1;
- public H_OnGameModeInit() <> return 1;
- #define OnGameModeInit(%0) H_OnGameModeInit(%0)<_ALS_:hooked>
- public OnGameModeExit()
- {
- state _A_:hooked;
- new i;
- for(; i != MAX_SKINSHOPS; ++i){
- if(SkinShop[i][ID] == 0)continue;
- 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]);
- mysql_tquery(con_Handle,ALLSTR,"","");
- }
- return H_OnGameModeExit();
- }
- forward H_OnGameModeExit();
- #if defined _A_OnGameModeExit
- #undef OnGameModeExit
- #else
- #define _A_OnGameModeExit
- #endif
- public H_OnGameModeExit() <_A_:unhooked> return 1;
- public H_OnGameModeExit() <> return 1;
- #define OnGameModeExit(%0) H_OnGameModeExit(%0)<_A_:hooked>
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- state _A_:hooked;
- if(newkeys & KEY_FIRE){
- new vw=GetPlayerVirtualWorld(playerid);
- for(new i; i != MAX_SKINSHOPS; ++i){
- if(SkinShop[i][ID] == 0)continue;
- if(IsPlayerInRangeOfPoint(playerid,2.0,SkinShop[i][X],SkinShop[i][Y],SkinShop[i][Z])){
- printf("%d",i);
- SetPlayerInterior(playerid,InteriorArray[SkinShop[i][INT]][INT]);
- SetPlayerVirtualWorld(playerid,SkinShop[i][ID]);
- SetPlayerPos(playerid,InteriorArray[SkinShop[i][INT]][X],InteriorArray[SkinShop[i][INT]][Y],InteriorArray[SkinShop[i][INT]][Z]);
- EditSkinShop{playerid} = i;
- return SetPlayerFacingAngle(playerid,InteriorArray[SkinShop[i][INT]][A]);
- }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])){
- SetPlayerInterior(playerid,0);
- SetPlayerVirtualWorld(playerid,0);
- return SetPlayerPos(playerid,SkinShop[i][X],SkinShop[i][Y],SkinShop[i][Z]);
- }
- }
- if(IsPlayerInRangeOfPoint(playerid,2.0,InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uPUX],InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uPUY],InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uPUZ])){
- PlayerInfo[playerid][pGeschlecht] = SetArrayMarker(playerid);
- SetPlayerPos(playerid,InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uX],InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uY],InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uZ]);
- SetPlayerFacingAngle(playerid,InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uA]);
- SetPlayerCameraLookAt(playerid,InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uX],InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uY],InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uZ]);
- SetPlayerCameraPos(playerid,InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uCPX],InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uCPY],InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uCPZ]);
- TextDrawShowForPlayer(playerid,GlobalTextdraw[sSkinSelectionBO]);
- TextDrawShowForPlayer(playerid,GlobalTextdraw[sSkinSelectionBU]);
- TextDrawShowForPlayer(playerid,GlobalTextdraw[sSkinSelectionRight]);
- TextDrawShowForPlayer(playerid,GlobalTextdraw[sSkinSelectionBuy]);
- TextDrawShowForPlayer(playerid,GlobalTextdraw[sSkinSelectionLeft]);
- SelectTextDraw(playerid, 0x00FF00FF);
- return SetPlayerVirtualWorld(playerid,SkinShop[EditSkinShop{playerid}][ID]+playerid+10);
- }
- }
- return H_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
- }
- forward H_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
- #if defined _A_OnPlayerKeyStateChange
- #undef OnPlayerKeyStateChange
- #else
- #define _A_OnPlayerKeyStateChange
- #endif
- public H_OnPlayerKeyStateChange(playerid, newkeys, oldkeys)<_A_:unhooked> return 1;
- public H_OnPlayerKeyStateChange(playerid, newkeys, oldkeys) <> return 1;
- #define OnPlayerKeyStateChange(%0,%1,%2) H_OnPlayerKeyStateChange(%0,%1,%2)<_A_:hooked>
- public OnPlayerClickTextDraw(playerid, Text:clickedid)
- {
- state _A_:hooked;
- if(_:clickedid == INVALID_TEXT_DRAW){
- SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]);
- TextDrawHideForPlayer(playerid,GlobalTextdraw[sSkinSelectionBO]);
- TextDrawHideForPlayer(playerid,GlobalTextdraw[sSkinSelectionBU]);
- TextDrawHideForPlayer(playerid,GlobalTextdraw[sSkinSelectionRight]);
- TextDrawHideForPlayer(playerid,GlobalTextdraw[sSkinSelectionBuy]);
- TextDrawHideForPlayer(playerid,GlobalTextdraw[sSkinSelectionLeft]);
- SetPlayerPos(playerid,InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uPUX]+1.0,InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uPUY],InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uPUZ]);
- SetPlayerVirtualWorld(playerid,SkinShop[EditSkinShop{playerid}][ID]);
- return SetCameraBehindPlayer(playerid);
- }else if(clickedid == GlobalTextdraw[sSkinSelectionBuy]){
- if(GetPlayerMoney(playerid) < _SKIN_PRICE)return SendClientMessage(playerid,-1,"Du hast zu wenig Geld!");
- SetPlayerPos(playerid,InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uPUX]+1.0,InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uPUY],InteriorArray[SkinShop[EditSkinShop{playerid}][INT]][uPUZ]);
- SetPlayerVirtualWorld(playerid,SkinShop[EditSkinShop{playerid}][ID]);
- TextDrawHideForPlayer(playerid,GlobalTextdraw[sSkinSelectionBO]);
- TextDrawHideForPlayer(playerid,GlobalTextdraw[sSkinSelectionBU]);
- TextDrawHideForPlayer(playerid,GlobalTextdraw[sSkinSelectionRight]);
- TextDrawHideForPlayer(playerid,GlobalTextdraw[sSkinSelectionBuy]);
- TextDrawHideForPlayer(playerid,GlobalTextdraw[sSkinSelectionLeft]);
- GivePlayerMoney(playerid,-_SKIN_PRICE);
- SkinShop[EditSkinShop{playerid}][CASH] += _SKIN_PRICE;
- return SetCameraBehindPlayer(playerid);
- }else if(clickedid == GlobalTextdraw[sSkinSelectionRight]){
- switch(PlayerInfo[playerid][pGeschlecht] ){
- case 1:{
- if(GetSecoundArrayMarker(playerid) == 53 && GetFirstArrayMarker(playerid) == 0){
- ArrayMarker[playerid]= 0;
- return SetPlayerSkin(playerid,GetSkin(playerid));
- }
- } case 0:{
- if(GetSecoundArrayMarker(playerid) == 75 && GetFirstArrayMarker(playerid) == 2){
- ArrayMarker[playerid] = 0;
- ArrayMarker[playerid]|= (54 << 8);
- return SetPlayerSkin(playerid,GetSkin(playerid));
- }
- }
- }
- if(GetFirstArrayMarker(playerid) == 2){
- SetFirstArrayMarker(playerid,-2);
- SetSecoundArrayMarker(playerid,1);
- }else SetFirstArrayMarker(playerid,1);
- return SetPlayerSkin(playerid,GetSkin(playerid));
- }else if(clickedid == GlobalTextdraw[sSkinSelectionLeft]){
- switch(PlayerInfo[playerid][pGeschlecht] ){
- case 1:{
- if(GetSecoundArrayMarker(playerid) == 0 && GetFirstArrayMarker(playerid) == 0){
- ArrayMarker[playerid] = 0;
- ArrayMarker[playerid]|= (53 << 8);
- return SetPlayerSkin(playerid,GetSkin(playerid));
- }
- } case 0: {
- if(GetSecoundArrayMarker(playerid) == 54 && GetFirstArrayMarker(playerid) == 0){
- ArrayMarker[playerid]= 0;
- ArrayMarker[playerid]|= 2;
- ArrayMarker[playerid]|= (75 << 8);
- return SetPlayerSkin(playerid,GetSkin(playerid));
- }
- }
- }
- if(GetFirstArrayMarker(playerid) == 0){
- SetFirstArrayMarker(playerid,2);
- SetSecoundArrayMarker(playerid,-1);
- }else SetFirstArrayMarker(playerid,-1);
- return SetPlayerSkin(playerid,GetSkin(playerid));
- }
- return H_OnPlayerClickTextDraw(playerid, Text:clickedid);
- }
- forward H_OnPlayerClickTextDraw(playerid, Text:clickedid);
- #if defined _A_OnPlayerClickTextDraw
- #undef OnPlayerClickTextDraw
- #else
- #define _A_OnPlayerClickTextDraw
- #endif
- public H_OnPlayerClickTextDraw(playerid, Text:clickedid) <_A_:unhooked> return 1;
- public H_OnPlayerClickTextDraw(playerid, Text:clickedid) <> return 1;
- #define OnPlayerClickTextDraw(%0,%1) H_OnPlayerClickTextDraw(%0,%1)<_A_:hooked>
- CMD->bizkonfig(playerid,params[]){
- new i;
- for(; i != MAX_SKINSHOPS; ++i){
- if(!IsPlayerInRangeOfPoint(playerid,2.0,SkinShop[i][X],SkinShop[i][Y],SkinShop[i][Z]) || strcmp(SkinShop[i][OWNER], PlayerName(playerid), false) != 0)continue;
- EditSkinShop{playerid} = i;
- return ShowPlayerDialog(playerid,DIALOG_SKINSHOP_PLAYER_KONFIG,DIALOG_STYLE_LIST,"BIZ-Konfig","Kasse\nVerkaufen","Auswählen","Beenden");
- }
- return 1;
- }
- CMD->buybiz(playerid,params[]){
- new i;
- for(; i != MAX_SKINSHOPS; ++i){
- if(!IsPlayerInRangeOfPoint(playerid,2.0,SkinShop[i][X],SkinShop[i][Y],SkinShop[i][Z]) || strcmp(SkinShop[i][OWNER], "Niemand", false) != 0)continue;
- if(GetPlayerMoney(playerid) < SkinShop[i][PRICE])return SendClientMessage(playerid,-1,"Du hast zu wenig Geld!");
- strdel(SkinShop[i][OWNER],0,MAX_PLAYER_NAME);
- strcat(SkinShop[i][OWNER],PlayerName(playerid),MAX_PLAYER_NAME);
- format(ALLSTR2,200,"Besitzer: %s\n Benutze: Linke Maustaste um einzutreten.",SkinShop[i][OWNER]);
- UpdateDynamic3DTextLabelText(SkinShop[i][LABELEn],-1,ALLSTR2);
- return SendClientMessage(playerid,-1,"Du hast das Business gekauft");
- }
- return 1;
- }
- CMD->edit(playerid,params[]){
- return ShowPlayerDialog(playerid, DIALOG_SKINSHOP_KONFIG, DIALOG_STYLE_LIST,"Skinshop","Bearbeiten\nErstellen\nEntfernen","Auswählen","Beenden");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement