DaDo_TO 0 Odesláno: 16. Prosinec, 2013 Share Odesláno: 16. Prosinec, 2013 Zdravím mám problém mám spravené šatne pre určité zložky keď do nejakej tej šatne vstúpim dialog som sa mi zobrazí ale ako náhle si chcem nastaviť nejaký skin alebo zobrať zbraň tak mi to nenastaví . Za pomoc a radu ďakujem Tu je kód : public OnGameModeInit() { pichazzsatnik = CreatePickup(1275, 1, 2035.5431,-2098.3115,13.5469,-1); picpzsrsatnik = CreatePickup(1275, 1, 1462.9403,-1766.0197,3285.2859,-1); piczzssatnik = CreatePickup(1275, 1, 1026.1835,-1088.8015,23.8349,-1); //****************************************************************************** return 1; } public OnPlayerPickUpPickup(playerid, pickupid) { if(pickupid == pichazzsatnik) { ShowPlayerDialog(playerid, 150, DIALOG_STYLE_LIST,"HaZZ Šatňa","Veliteľ\nVeliteľ z ADP\nHasič\nHasič z ADP\nChemický oblek OPCH\nOblek proti sálavému teplu\nPotápač\nSekera\nHasiací prístroj\nMotorová píla","Obliecť","Zrušit"); } if(pickupid == picpzsrsatnik) { ShowPlayerDialog(playerid, 158, DIALOG_STYLE_LIST,"PZSR Šatňa","Policajt\nDopravný policajt\nPištol\nAK-47","Obliecť","Zrušit"); } if(pickupid == piczzssatnik) { ShowPlayerDialog(playerid, 155, DIALOG_STYLE_LIST,"ZZS Šatňa","Doktor\nBatoh","Obliecť","Zrušit"); return 1; } } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == 150) { if(response) // ľavé tlačítko, pre pravé daj 0 { if(listitem == 0) { SetPlayerSkin(playerid, 277);//z ADP } else if(listitem == 1) { SetPlayerSkin(playerid, 279);//bez AP } else if(listitem == 2) { SetPlayerSkin(playerid, 278); //VZ } else if(listitem == 3) { GivePlayerWeapon(playerid, 42,500000); // zbran 1 } else if(listitem == 4) { GivePlayerWeapon(playerid, 9,50000); //zbran 2 } else if(listitem == 5) { SetPlayerSkin(playerid, 273); //skin 273 } } } if(dialogid == 155) { if(response) // ľavé tlačítko, pre pravé daj 0 { if(listitem == 0) { SetPlayerSkin(playerid, 274);//ZZS } else if(listitem == 1) { GivePlayerWeapon(playerid, 43,50000); //zbran 2 } } } if(dialogid == 158) { if(response) // ľavé tlačítko, pre pravé daj 0 { if(listitem == 0) { SetPlayerSkin(playerid, 286);//DP } else if(listitem == 1) { SetPlayerSkin(playerid, 281);//normal } else if(listitem == 2) { GivePlayerWeapon(playerid, 24,50000); //zbran 2 } } } return 1; } Link to comment Share on other sites More sharing options...
0 Akai 1 Odesláno: 17. Prosinec, 2013 Share Odesláno: 17. Prosinec, 2013 Příšerná úprava, kdo se v tom má vyznatZkus toto: public OnGameModeInit() { pichazzsatnik = CreatePickup(1275, 1, 2035.5431, -2098.3115, 13.5469, -1); picpzsrsatnik = CreatePickup(1275, 1, 1462.9403, -1766.0197, 3285.2859, -1); piczzssatnik = CreatePickup(1275, 1, 1026.1835, -1088.8015, 23.8349, -1); //************************************************************************** return 1; } public OnPlayerPickUpPickup(playerid, pickupid) { switch(pickupid) { case pichazzsatnik: ShowPlayerDialog(playerid, 150, DIALOG_STYLE_LIST, "HaZZ Šatňa", "Veliteľ\nVeliteľ z ADP\nHasič\nHasič z ADP\nChemický oblek OPCH\nOblek proti sálavému teplu\nPotápač\nSekera\nHasiací prístroj\nMotorová píla", "Obliecť", "Zrušit"); case picpzsrsatnik: ShowPlayerDialog(playerid, 158, DIALOG_STYLE_LIST, "PZSR Šatňa", "Policajt\nDopravný policajt\nPištol\nAK-47", "Obliecť", "Zrušit"); case piczzssatnik: ShowPlayerDialog(playerid, 155, DIALOG_STYLE_LIST, "ZZS Šatňa", "Doktor\nBatoh", "Obliecť", "Zrušit"); } return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { switch(dialogid) { case 150: { if(!response) return 1; //Pravé tlačítko ne switch(listitem) { case 0: SetPlayerSkin(playerid, 277); //z ADP case 1: SetPlayerSkin(playerid, 279); //bez AP case 2: SetPlayerSkin(playerid, 278); //VZ case 3: GivePlayerWeapon(playerid, 42, 500000); //zbran 1 case 4: GivePlayerWeapon(playerid, 9, 50000); //zbran 2 case 5: SetPlayerSkin(playerid, 273); //skin 273 } return 1; } case 155: { if(!response) return 1; //Pravé tlačítko ne switch(listitem) { case 0: SetPlayerSkin(playerid, 274); //ZZS case 1: GivePlayerWeapon(playerid, 43, 50000); //zbran 2 } return 1; } case 158: { if(!response) return 1; //Pravé tlačítko ne switch(listitem) { case 0: SetPlayerSkin(playerid, 286); //DP case 1: SetPlayerSkin(playerid, 281); //normal case 2: GivePlayerWeapon(playerid, 24, 50000); //zbran 2 } return 1; } } return 1; } Link to comment Share on other sites More sharing options...
0 Amenadiel 286 Odesláno: 17. Prosinec, 2013 Share Odesláno: 17. Prosinec, 2013 Příšerná úprava, kdo se v tom má vyznat Zkus toto: public OnGameModeInit() { pichazzsatnik = CreatePickup(1275, 1, 2035.5431, -2098.3115, 13.5469, -1); picpzsrsatnik = CreatePickup(1275, 1, 1462.9403, -1766.0197, 3285.2859, -1); piczzssatnik = CreatePickup(1275, 1, 1026.1835, -1088.8015, 23.8349, -1); //************************************************************************** return 1; } public OnPlayerPickUpPickup(playerid, pickupid) { switch(pickupid) { case pichazzsatnik: ShowPlayerDialog(playerid, 150, DIALOG_STYLE_LIST, "HaZZ Šatňa", "Veliteľ\nVeliteľ z ADP\nHasič\nHasič z ADP\nChemický oblek OPCH\nOblek proti sálavému teplu\nPotápač\nSekera\nHasiací prístroj\nMotorová píla", "Obliecť", "Zrušit"); case picpzsrsatnik: ShowPlayerDialog(playerid, 158, DIALOG_STYLE_LIST, "PZSR Šatňa", "Policajt\nDopravný policajt\nPištol\nAK-47", "Obliecť", "Zrušit"); case piczzssatnik: ShowPlayerDialog(playerid, 155, DIALOG_STYLE_LIST, "ZZS Šatňa", "Doktor\nBatoh", "Obliecť", "Zrušit"); } return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { switch(dialogid) { case 150: { if(!response) return 1; //Pravé tlačítko ne switch(listitem) { case 0: SetPlayerSkin(playerid, 277); //z ADP case 1: SetPlayerSkin(playerid, 279); //bez AP case 2: SetPlayerSkin(playerid, 278); //VZ case 3: GivePlayerWeapon(playerid, 42, 500000); //zbran 1 case 4: GivePlayerWeapon(playerid, 9, 50000); //zbran 2 case 5: SetPlayerSkin(playerid, 273); //skin 273 } return 1; } case 155: { if(!response) return 1; //Pravé tlačítko ne switch(listitem) { case 0: SetPlayerSkin(playerid, 274); //ZZS case 1: GivePlayerWeapon(playerid, 43, 50000); //zbran 2 } return 1; } case 158: { if(!response) return 1; //Pravé tlačítko ne switch(listitem) { case 0: SetPlayerSkin(playerid, 286); //DP case 1: SetPlayerSkin(playerid, 281); //normal case 2: GivePlayerWeapon(playerid, 24, 50000); //zbran 2 } return 1; } } return 1; } a skoušel jsi jestli ti to jde ? :DD Link to comment Share on other sites More sharing options...
0 Akai 1 Odesláno: 17. Prosinec, 2013 Share Odesláno: 17. Prosinec, 2013 a skoušel jsi jestli ti to jde ? :DD Ne, prostě jsem v podstatě přepsal to, co tam měl. Šlo spíš o lepší úpravu. Link to comment Share on other sites More sharing options...
0 DaDo_TO 0 Odesláno: 17. Prosinec, 2013 Author Share Odesláno: 17. Prosinec, 2013 C:\Users\Uzivatel\Desktop\Priečinok\satnik.pwn(167) : error 008: must be a constant expression; assumed zero C:\Users\Uzivatel\Desktop\Priečinok\satnik.pwn(168) : error 008: must be a constant expression; assumed zero C:\Users\Uzivatel\Desktop\Priečinok\satnik.pwn(169) : error 008: must be a constant expression; assumed zero Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase 3 Errors. switch(pickupid) { case pichazzsatnik: ShowPlayerDialog(playerid, 150, DIALOG_STYLE_LIST, "HaZZ Šatňa", "Veliteľ\nVeliteľ z ADP\nHasič\nHasič z ADP\nChemický oblek OPCH\nOblek proti sálavému teplu\nPotápač\nSekera\nHasiací prístroj\nMotorová píla", "Obliecť", "Zrušit"); case picpzsrsatnik: ShowPlayerDialog(playerid, 158, DIALOG_STYLE_LIST, "PZSR Šatňa", "Policajt\nDopravný policajt\nPištol\nAK-47", "Obliecť", "Zrušit"); case piczzssatnik: ShowPlayerDialog(playerid, 155, DIALOG_STYLE_LIST, "ZZS Šatňa", "Doktor\nBatoh", "Obliecť", "Zrušit"); } return 1; } Link to comment Share on other sites More sharing options...
0 rhsCZ 19 Odesláno: 17. Prosinec, 2013 Share Odesláno: 17. Prosinec, 2013 skus mazat přebytečné returny v OnDialogResponse a ten poslední dej return 0; Link to comment Share on other sites More sharing options...
0 DaDo_TO 0 Odesláno: 17. Prosinec, 2013 Author Share Odesláno: 17. Prosinec, 2013 Stále to isté Link to comment Share on other sites More sharing options...
0 Tanga 131 Odesláno: 17. Prosinec, 2013 Share Odesláno: 17. Prosinec, 2013 Musíš použiť if nie switch (v OnPickUpPickup).switch má rád len konštanty. Link to comment Share on other sites More sharing options...
0 DaDo_TO 0 Odesláno: 17. Prosinec, 2013 Author Share Odesláno: 17. Prosinec, 2013 Stále error ja už neviem Link to comment Share on other sites More sharing options...
0 rhsCZ 19 Odesláno: 17. Prosinec, 2013 Share Odesláno: 17. Prosinec, 2013 možná se překrívají dialogid skus dat větší id dialogů např. 5726 Link to comment Share on other sites More sharing options...
0 Tanga 131 Odesláno: 17. Prosinec, 2013 Share Odesláno: 17. Prosinec, 2013 (upraveno) Stále error ja už neviem -- Nemožné. Úprava: Tu máš funkčný kód, kde som spravil to, čo si mal spraviť ty podla mojej rady. #include <a_samp> new pichazzsatnik; new picpzsrsatnik; new piczzssatnik; public OnGameModeInit() { pichazzsatnik = CreatePickup(1275, 1, 2035.5431, -2098.3115, 13.5469, -1); picpzsrsatnik = CreatePickup(1275, 1, 1462.9403, -1766.0197, 3285.2859, -1); piczzssatnik = CreatePickup(1275, 1, 1026.1835, -1088.8015, 23.8349, -1); //************************************************************************** return 1; } public OnPlayerPickUpPickup(playerid, pickupid) { if (pickupid == pichazzsatnik) ShowPlayerDialog(playerid, 150, DIALOG_STYLE_LIST, "HaZZ Šatňa", "Veliteľ\nVeliteľ z ADP\nHasič\nHasič z ADP\nChemický oblek OPCH\nOblek proti sálavému teplu\nPotápač\nSekera\nHasiací prístroj\nMotorová píla", "Obliecť", "Zrušit"); else if (pickupid == picpzsrsatnik) ShowPlayerDialog(playerid, 158, DIALOG_STYLE_LIST, "PZSR Šatňa", "Policajt\nDopravný policajt\nPištol\nAK-47", "Obliecť", "Zrušit"); else if (pickupid == piczzssatnik) ShowPlayerDialog(playerid, 155, DIALOG_STYLE_LIST, "ZZS Šatňa", "Doktor\nBatoh", "Obliecť", "Zrušit"); return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { switch(dialogid) { case 150: { if(!response) return 1; //Pravé tlačítko ne switch(listitem) { case 0: SetPlayerSkin(playerid, 277); //z ADP case 1: SetPlayerSkin(playerid, 279); //bez AP case 2: SetPlayerSkin(playerid, 278); //VZ case 3: GivePlayerWeapon(playerid, 42, 500000); //zbran 1 case 4: GivePlayerWeapon(playerid, 9, 50000); //zbran 2 case 5: SetPlayerSkin(playerid, 273); //skin 273 } return 1; } case 155: { if(!response) return 1; //Pravé tlačítko ne switch(listitem) { case 0: SetPlayerSkin(playerid, 274); //ZZS case 1: GivePlayerWeapon(playerid, 43, 50000); //zbran 2 } return 1; } case 158: { if(!response) return 1; //Pravé tlačítko ne switch(listitem) { case 0: SetPlayerSkin(playerid, 286); //DP case 1: SetPlayerSkin(playerid, 281); //normal case 2: GivePlayerWeapon(playerid, 24, 50000); //zbran 2 } return 1; } } return 1; } možná se překrívají dialogid skus dat větší id dialogů např. 5726 -- Blbosť. Edited 17. Prosinec, 2013 by Tango Link to comment Share on other sites More sharing options...
0 rhsCZ 19 Odesláno: 17. Prosinec, 2013 Share Odesláno: 17. Prosinec, 2013 -- Nemožné. Úprava: Tu máš funkčný kód, kde som spravil to, čo si mal spraviť ty podla mojej rady. #include <a_samp> new pichazzsatnik; new picpzsrsatnik; new piczzssatnik; public OnGameModeInit() { pichazzsatnik = CreatePickup(1275, 1, 2035.5431, -2098.3115, 13.5469, -1); picpzsrsatnik = CreatePickup(1275, 1, 1462.9403, -1766.0197, 3285.2859, -1); piczzssatnik = CreatePickup(1275, 1, 1026.1835, -1088.8015, 23.8349, -1); //************************************************************************** return 1; } public OnPlayerPickUpPickup(playerid, pickupid) { if (pickupid == pichazzsatnik) ShowPlayerDialog(playerid, 150, DIALOG_STYLE_LIST, "HaZZ Šatňa", "Veliteľ\nVeliteľ z ADP\nHasič\nHasič z ADP\nChemický oblek OPCH\nOblek proti sálavému teplu\nPotápač\nSekera\nHasiací prístroj\nMotorová píla", "Obliecť", "Zrušit"); else if (pickupid == picpzsrsatnik) ShowPlayerDialog(playerid, 158, DIALOG_STYLE_LIST, "PZSR Šatňa", "Policajt\nDopravný policajt\nPištol\nAK-47", "Obliecť", "Zrušit"); else if (pickupid == piczzssatnik) ShowPlayerDialog(playerid, 155, DIALOG_STYLE_LIST, "ZZS Šatňa", "Doktor\nBatoh", "Obliecť", "Zrušit"); return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { switch(dialogid) { case 150: { if(!response) return 1; //Pravé tlačítko ne switch(listitem) { case 0: SetPlayerSkin(playerid, 277); //z ADP case 1: SetPlayerSkin(playerid, 279); //bez AP case 2: SetPlayerSkin(playerid, 278); //VZ case 3: GivePlayerWeapon(playerid, 42, 500000); //zbran 1 case 4: GivePlayerWeapon(playerid, 9, 50000); //zbran 2 case 5: SetPlayerSkin(playerid, 273); //skin 273 } return 1; } case 155: { if(!response) return 1; //Pravé tlačítko ne switch(listitem) { case 0: SetPlayerSkin(playerid, 274); //ZZS case 1: GivePlayerWeapon(playerid, 43, 50000); //zbran 2 } return 1; } case 158: { if(!response) return 1; //Pravé tlačítko ne switch(listitem) { case 0: SetPlayerSkin(playerid, 286); //DP case 1: SetPlayerSkin(playerid, 281); //normal case 2: GivePlayerWeapon(playerid, 24, 50000); //zbran 2 } return 1; } } return 1; } -- Blbosť. co ty víš co tam cpe za filterscripty apod. Link to comment Share on other sites More sharing options...
0 DaDo_TO 0 Odesláno: 17. Prosinec, 2013 Author Share Odesláno: 17. Prosinec, 2013 Funguje to ale nedá mi to čo si vyberiem v dialogu Link to comment Share on other sites More sharing options...
0 Tanga 131 Odesláno: 17. Prosinec, 2013 Share Odesláno: 17. Prosinec, 2013 co ty víš co tam cpe za filterscripty apod. -- :D Link to comment Share on other sites More sharing options...
0 DaDo_TO 0 Odesláno: 17. Prosinec, 2013 Author Share Odesláno: 17. Prosinec, 2013 Nič tam netrepem proste ide len o jeden fs Link to comment Share on other sites More sharing options...
Dotaz
DaDo_TO 0
Zdravím mám problém mám spravené šatne pre určité zložky keď do nejakej tej šatne vstúpim dialog som sa mi zobrazí ale ako náhle si chcem nastaviť nejaký skin alebo zobrať zbraň tak mi to nenastaví . Za pomoc a radu ďakujem
Tu je kód :
Link to comment
Share on other sites
14 odpovědí na tuto otázku
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now