Kavi 1 Odesláno: 2. Březen, 2011 Share Odesláno: 2. Březen, 2011 Zdravim all lidi z pawno Dávám sem taký Mini TUT nebo už asi 4lamka se mě na to ptala a hlavne.. pro amatéry PWN. -Spočívá to ve STYLU_BOJE takže nejdříve nadefinujeme ID Dialogu nikam nahoru do modu #define DIALOG_BOJ 1 // 1 = ID xD mužete zmenit Pak Do public OnPlayerCommandText(playerid, cmdtext[]) dcmd(boj,3,cmdtext); dcmd_boj(playerid,params[]) //např /boj { #pragma unused params ShowPlayerDialog(playerid,DIALOG_BOJ,DIALOG_STYLE_LIST,"Vyber boj","Normalní\nBox\nKungfu\nHlavu a Koleno\nGrap Kop\nLoket","Vybrat","Pryč"); return 1; } Po té Do publicOnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) if(dialogid == DIALOG_BOJ) { if(response == 1) { switch(listitem) { case 0: { SetPlayerFightingStyle(playerid, FIGHT_STYLE_NORMAL); SendClientMessage(playerid, RED,"Nastavil sis styl boje Normalní"); } case 1: { SetPlayerFightingStyle(playerid, FIGHT_STYLE_BOXING); SendClientMessage(playerid, RED,"Nastavil sis styl boje Box"); } case 2: { SetPlayerFightingStyle(playerid, FIGHT_STYLE_KUNGFU); SendClientMessage(playerid, RED,"Nastavil sis styl boje Kungfu"); } case 3: { SetPlayerFightingStyle(playerid, FIGHT_STYLE_KNEEHEAD); SendClientMessage(playerid, RED,"Nastavil sis styl boje Hlavu + Koleno"); } case 4: { SetPlayerFightingStyle(playerid, FIGHT_STYLE_GRABKICK); SendClientMessage(playerid, RED,"Nastavil sis styl boje Grap Kop"); } case 5: { SetPlayerFightingStyle(playerid, FIGHT_STYLE_ELBOW); SendClientMessage(playerid, RED,"Nastavil sis styl boje Loket"); } } } } return 1; } a To je všeco... DOBA KODOVÁNÍ = 5MIN ERORRY = Nwm Netestoval sem ale melo by to jít bez problemů kdeby neco pište... erorry Link to comment Share on other sites More sharing options...
Guest JAKE47 Odesláno: 2. Březen, 2011 Share Odesláno: 2. Březen, 2011 no a pride lama chyti CTRLC CTRLV a ma to v mode... SetPlayerFightingStyle tu samizda je 0/10 Link to comment Share on other sites More sharing options...
Kavi 1 Odesláno: 2. Březen, 2011 Author Share Odesláno: 2. Březen, 2011 Hele nedelej zesebe chytrýho asi sem psal že to je skrs lamky!!!!! a nekoukal sem či to tu je... a jestli jo tak ne takhle přehledně pres dialog bych rek .. Link to comment Share on other sites More sharing options...
Lurk 0 Odesláno: 2. Březen, 2011 Share Odesláno: 2. Březen, 2011 lama by se ptala proc ma error u dmcd (nemas definici) jinak fakt to je pro lamy(1/10 za snahu) Link to comment Share on other sites More sharing options...
Kavi 1 Odesláno: 2. Březen, 2011 Author Share Odesláno: 2. Březen, 2011 l*ma by se ptala proc ma error u dmcd (nemas definici) jinak fakt to je pro lamy(1/10 za snahu) xD ajo diky uplně sem zapomel xD = Opraveno xD Link to comment Share on other sites More sharing options...
Marwin37 5 Odesláno: 3. Březen, 2011 Share Odesláno: 3. Březen, 2011 podle mě to máš moc zdlouhavé hodnoty bojovych umeni jsou definované myslím od 0 do 5 a tak by vpoho stacilo if(dialogid == DIALOG_BOJ) { if(response == 1) { SetPlayerFightingStyle(playerid, listitem); }} Link to comment Share on other sites More sharing options...
ErrOro 0 Odesláno: 19. Březen, 2011 Share Odesláno: 19. Březen, 2011 prominte ze pisu do stareho topicu, ale pise mi to jeden a ten samej error a to: error 010: invalid function or declaration a tohle je presne napr radek: if(dialogid == DIALOG_STYLBOJE) tento... Link to comment Share on other sites More sharing options...
RockY.Balboa 0 Odesláno: 19. Březen, 2011 Share Odesláno: 19. Březen, 2011 Je to tady už.. Link to comment Share on other sites More sharing options...
Petr 44 Odesláno: 19. Březen, 2011 Share Odesláno: 19. Březen, 2011 Musíš ten název změnit i v definici Link to comment Share on other sites More sharing options...
ErrOro 0 Odesláno: 19. Březen, 2011 Share Odesláno: 19. Březen, 2011 to sem udělal Link to comment Share on other sites More sharing options...
Petr 44 Odesláno: 19. Březen, 2011 Share Odesláno: 19. Březen, 2011 ukaž celej ten dialog Link to comment Share on other sites More sharing options...
Kavi 1 Odesláno: 19. Březen, 2011 Author Share Odesláno: 19. Březen, 2011 no uka ten dialog Link to comment Share on other sites More sharing options...
ErrOro 0 Odesláno: 19. Březen, 2011 Share Odesláno: 19. Březen, 2011 if(dialogid == DIALOG_STYLBOJE) { if(response == 1) { switch(listitem) { case 0: { SetPlayerFightingStyle(playerid, FIGHT_STYLE_NORMAL); SendClientMessage(playerid, COLOR_LIME,"[ ! ] Nastavil sis styl boje Normalní !"); SetPlayerColor(playerid,COLOR_AQUA); } case 1: { SetPlayerFightingStyle(playerid, FIGHT_STYLE_BOXING); SendClientMessage(playerid, COLOR_LIME,"[ ! ] Nastavil sis styl boje Box !"); SetPlayerColor(playerid,COLOR_RED); } case 2: { SetPlayerFightingStyle(playerid, FIGHT_STYLE_KUNGFU); SendClientMessage(playerid, COLOR_LIME,"[ ! ] Nastavil sis styl boje Kungfu !"); SetPlayerColor(playerid,COLOR_LIME); } case 3: { SetPlayerFightingStyle(playerid, FIGHT_STYLE_KNEEHEAD); SendClientMessage(playerid, COLOR_LIME,"[ ! ] Nastavil sis styl boje Hlavu + Koleno !"); SetPlayerColor(playerid,COLOR_GREEN); } case 4: { SetPlayerFightingStyle(playerid, FIGHT_STYLE_GRABKICK); SendClientMessage(playerid, COLOR_LIME,"[ ! ] Nastavil sis styl boje Grap Kick !"); SetPlayerColor(playerid,COLOR_YELLOW); } case 5: { SetPlayerFightingStyle(playerid, FIGHT_STYLE_ELBOW); SendClientMessage(playerid, COLOR_LIME,"[ ! ] Nastavil sis styl boje Loket !"); SetPlayerColor(playerid,COLOR_CRIMSON); } } } } return 1; } Link to comment Share on other sites More sharing options...
Kavi 1 Odesláno: 19. Březen, 2011 Author Share Odesláno: 19. Březen, 2011 if(dialogid == DIALOG_STYLBOJE) { if(response == 1) { switch(listitem) { case 0: { SetPlayerFightingStyle(playerid, FIGHT_STYLE_NORMAL); SendClientMessage(playerid, COLOR_LIME,"[ ! ] Nastavil sis styl boje Normalní !"); SetPlayerColor(playerid,COLOR_AQUA); } case 1: { SetPlayerFightingStyle(playerid, FIGHT_STYLE_BOXING); SendClientMessage(playerid, COLOR_LIME,"[ ! ] Nastavil sis styl boje Box !"); SetPlayerColor(playerid,COLOR_RED); } case 2: { SetPlayerFightingStyle(playerid, FIGHT_STYLE_KUNGFU); SendClientMessage(playerid, COLOR_LIME,"[ ! ] Nastavil sis styl boje Kungfu !"); SetPlayerColor(playerid,COLOR_LIME); } case 3: { SetPlayerFightingStyle(playerid, FIGHT_STYLE_KNEEHEAD); SendClientMessage(playerid, COLOR_LIME,"[ ! ] Nastavil sis styl boje Hlavu + Koleno !"); SetPlayerColor(playerid,COLOR_GREEN); } case 4: { SetPlayerFightingStyle(playerid, FIGHT_STYLE_GRABKICK); SendClientMessage(playerid, COLOR_LIME,"[ ! ] Nastavil sis styl boje Grap Kick !"); SetPlayerColor(playerid,COLOR_YELLOW); } case 5: { SetPlayerFightingStyle(playerid, FIGHT_STYLE_ELBOW); SendClientMessage(playerid, COLOR_LIME,"[ ! ] Nastavil sis styl boje Loket !"); SetPlayerColor(playerid,COLOR_CRIMSON); } } } } return 1; } to je jediné co je v publicu OnDialog? Link to comment Share on other sites More sharing options...
ErrOro 0 Odesláno: 19. Březen, 2011 Share Odesláno: 19. Březen, 2011 myslis z toho prikazu styl boje jako dialogu nebo z celeho publiku Link to comment Share on other sites More sharing options...
Guest Odesláno: 19. Březen, 2011 Share Odesláno: 19. Březen, 2011 podle mě to máš moc zdlouhavéhodnoty bojovych umeni jsou definované myslím od 0 do 5 a tak by vpoho stacilo if(dialogid == DIALOG_BOJ) { if(response == 1) { SetPlayerFightingStyle(playerid, listitem); }} aj ja som to chcel postnuť ale toto som zistil #define FIGHT_STYLE_NORMAL 4 #define FIGHT_STYLE_BOXING 5 #define FIGHT_STYLE_KUNGFU 6 #define FIGHT_STYLE_KNEEHEAD 7 #define FIGHT_STYLE_GRABKICK 15 #define FIGHT_STYLE_ELBOW 16 Link to comment Share on other sites More sharing options...
ErrOro 0 Odesláno: 19. Březen, 2011 Share Odesláno: 19. Březen, 2011 ale porad to pise: error 010: invalid function or declaration :-D Link to comment Share on other sites More sharing options...
Kavi 1 Odesláno: 19. Březen, 2011 Author Share Odesláno: 19. Březen, 2011 řadek? Link to comment Share on other sites More sharing options...
ErrOro 0 Odesláno: 19. Březen, 2011 Share Odesláno: 19. Březen, 2011 if(dialogid == DIALOGID) tam jich je vic, ale určo na stejnym principu Link to comment Share on other sites More sharing options...
Petr 44 Odesláno: 19. Březen, 2011 Share Odesláno: 19. Březen, 2011 Ukaž kód od 1.řádku až po řádek, kde začíná 1.public Link to comment Share on other sites More sharing options...
ErrOro 0 Odesláno: 19. Březen, 2011 Share Odesláno: 19. Březen, 2011 if(dialogid == DIALOGID) { if(response) { if(listitem == 0) { ShowPlayerDialog(playerid, DIALOGID+1, DIALOG_STYLE_LIST, "Bojove Styly", "Elbow\nBoxing\nGrabkick\nKneehead\nKungfu\nNormal", "Select", "Cancel"); } } return 1; } if(dialogid == DIALOGID+1) { if(response) { if(listitem == 0) { SetPlayerFightingStyle (playerid, FIGHT_STYLE_ELBOW); } if(listitem == 1) { SetPlayerFightingStyle (playerid, FIGHT_STYLE_BOXING); } if(listitem == 2) { SetPlayerFightingStyle (playerid, FIGHT_STYLE_GRABKICK); } if(listitem == 3) { SetPlayerFightingStyle (playerid, FIGHT_STYLE_KNEEHEAD); } if(listitem == 4) { SetPlayerFightingStyle (playerid, FIGHT_STYLE_KUNGFU); } if(listitem == 5) { SetPlayerFightingStyle (playerid, FIGHT_STYLE_NORMAL); } } return 1; } return 0; } je to co si chtel? -- sob 19. bře 2011 22:37:00 -- jinak od zacatku OnDialog... po prvni public je to tak: public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if (response && dialogid == DIALOGID_PM) { if (!IsPlayerConnected(PlayerPMTarget[playerid])) return SendClientMessage(playerid, 0xE10000AA, "[ ! ] Hráč neni připojen!"); new msg[128]; new msg2[128]; format(msg, 128, "[PM] Od %s : %s", Jmeno(playerid), inputtext); SendClientMessage(PlayerPMTarget[playerid], 0xFFFF00AA, msg); format(msg2, 128, "[PM] Odeslana hraci %s : %s", Jmeno(PlayerPMTarget[playerid]), inputtext); SendClientMessage(playerid, 0xFFFF00AA, msg2); PlayerPMTarget[playerid] = INVALID_PLAYER_ID; } return 1; } //----------------------------------------------------------------------------// if(dialogid == DIALOGID) { if(response) { if(listitem == 0) { ShowPlayerDialog(playerid, DIALOGID+1, DIALOG_STYLE_LIST, "Bojove Styly", "Elbow\nBoxing\nGrabkick\nKneehead\nKungfu\nNormal", "Select", "Cancel"); } } return 1; } if(dialogid == DIALOGID+1) { if(response) { if(listitem == 0) { SetPlayerFightingStyle (playerid, FIGHT_STYLE_ELBOW); } if(listitem == 1) { SetPlayerFightingStyle (playerid, FIGHT_STYLE_BOXING); } if(listitem == 2) { SetPlayerFightingStyle (playerid, FIGHT_STYLE_GRABKICK); } if(listitem == 3) { SetPlayerFightingStyle (playerid, FIGHT_STYLE_KNEEHEAD); } if(listitem == 4) { SetPlayerFightingStyle (playerid, FIGHT_STYLE_KUNGFU); } if(listitem == 5) { SetPlayerFightingStyle (playerid, FIGHT_STYLE_NORMAL); } } return 1; } return 0; } Link to comment Share on other sites More sharing options...
Petr 44 Odesláno: 19. Březen, 2011 Share Odesláno: 19. Březen, 2011 Tu chybu jsem už našel, ale potrápím tě a řeknu ti jen to, že si přepočítej a logicky uprav { a } Pokud na to nepříjdeš, tak pisni PM, ale fakt to zkus najít sám, pomůže ti to. Link to comment Share on other sites More sharing options...
ErrOro 0 Odesláno: 19. Březen, 2011 Share Odesláno: 19. Březen, 2011 no nejde to sh*t :-D zavorky sem zkousel vsude odebrat, pridat, ale asi blbe.... max 3 errory sundam... Link to comment Share on other sites More sharing options...
Kavi 1 Odesláno: 19. Březen, 2011 Author Share Odesláno: 19. Březen, 2011 ach jo však je to uplne easy a vy si tu nad tim lamete hlavu xD Link to comment Share on other sites More sharing options...
ErrOro 0 Odesláno: 19. Březen, 2011 Share Odesláno: 19. Březen, 2011 tak rikej co mi tam chybi chytraku :-D Link to comment Share on other sites More sharing options...
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