Neopry 0 Odesláno: 29. Květen, 2014 Share Odesláno: 29. Květen, 2014 Ahoj, Potřeboval bych pomoc s pracema.Udělal jsem si filescript: Policie, Řidič Kamionů. (zatím jenom dvě abych vyzkoušel jestli to funguje) U práce "Policie" nemám problém, ale u Řidiče kamionů se mi zobrazí jenom Dialog. Když kliknu na "Přijmout práci" tak se nic nestane.Možná je to tím že, to chci mít rozdělený ve filescriptech jako každé samostané zaměstnání. Policie: #include <a_samp> #if defined FILTERSCRIPT #define 0xFF0000AA new Povolani[MAX_PLAYERS]; new POLICIE; public OnGameModeInit(){ POLICIE = CreatePickup(1581, 1, 253.1612,64.7975,1003.6406, -1); return 1; } public OnPlayerPickUpPickup(playerid, pickupid) { if(pickupid == POLICIE) ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Policie","Přimout Práci\nPřevléknout se","Vybrat","Konec"); return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){ if(dialogid == 1){ switch(listitem){ case 0: { if(Povolani[playerid] == 1) return SendClientMessage(playerid,-1,"[ ! ] Tady už jsi zaměstnaný!"); SendClientMessage(0xFF0000AA, string); GivePlayerWeapon(playerid,24,1000); GivePlayerWeapon(playerid,25,1000); GivePlayerWeapon(playerid,3,1); SetPlayerColor(playerid,0x0066FFFF); SendClientMessage(playerid,-1,"Připojil jsi se k povolání policie"); SendClientMessage(0xFFFF00AA, string); Povolani[playerid] = 1; } case 1: { if(Povolani[playerid] != 1) return SendClientMessage(playerid,-1,"Nejsi tu zaměstnaný!"); SendClientMessage(0xFF0000AA, string); switch(random(3)) { case 0: SetPlayerSkin(playerid,280); case 1: SetPlayerSkin(playerid,283); case 2: SetPlayerSkin(playerid,284); } SendClientMessage(playerid,-1,"Vzal jsi si skin povolání"); SendClientMessage(0xFF0000AA, string); } } } return 1; } #endif Řidič kamionů: #include <a_samp> #if defined FILTERSCRIPT #define 0xFF0000AA new Povolani2[MAX_PLAYERS]; new RIDICKAMIONU; public OnGameModeInit(){ RIDICKAMIONU = CreatePickup(1581, 1, 2194.0481,-2246.5322,13.5469, -1); return 1; } public OnPlayerPickUpPickup(playerid, pickupid) { if(pickupid == RIDICKAMIONU) ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"Řidič Kamionu","Přimout Práci\nPřevléknout se","Vybrat","Konec"); return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){ if(dialogid == 2){ switch(listitem){ case 0: { if(Povolani2[playerid] == 1) return SendClientMessage(playerid,-1,"V tomto zaměstnání jsi již zaměstnán!"); SendClientMessage(0xFF0000AA, string); GivePlayerWeapon(playerid,32,1000); GivePlayerWeapon(playerid,25,1000); SetPlayerColor(playerid,0xFF00FFFF); SendClientMessage(playerid,-1,"Stal jsi se Řidičem kamionů"); SendClientMessage(0xFFFF00AA, string); Povolani2[playerid] = 2; } case 1: { if(Povolani2[playerid] != 1) return SendClientMessage(playerid,-1,"U toho zaměstání nejsi zaměstnán!"); SendClientMessage(0xFF0000AA, string); switch(random(3)) { case 0: SetPlayerSkin(playerid,128); case 1: SetPlayerSkin(playerid,133); case 2: SetPlayerSkin(playerid,135); } SendClientMessage(playerid,-1,"Převléknul jsi se"); SendClientMessage(0xFF0000AA, string); } } } return 1; } #endif Link to comment Share on other sites More sharing options...
0 Sweet 7 Odesláno: 29. Květen, 2014 Share Odesláno: 29. Květen, 2014 docela se divím, že ti šla i ta policie..jinak ti tam chybí v OnDialogResponse podmínka: if(response) Link to comment Share on other sites More sharing options...
0 Uživatel 0 Odesláno: 29. Květen, 2014 Share Odesláno: 29. Květen, 2014 #include a_samp #define FILTERSCRIPTS new Povolani[MAX_PLAYERS], POLICIE, RIDICKAMIONU; public OnGameModeInit() { POLICIE = CreatePickup(1581, 1, 253.1612,64.7975,1003.6406, -1); RIDICKAMIONU = CreatePickup(1581, 1, 2194.0481,-2246.5322,13.5469, -1); return 1; } public OnPlayerPickUpPickup(playerid, pickupid) { if(pickupid == POLICIE) ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Policie","Přimout Práci\nPřevléknout se","Vybrat","Konec"); if(pickupid == RIDICKAMIONU) ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"Řidič Kamionu","Přimout Práci\nPřevléknout se","Vybrat","Konec"); return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == 1) { if(!response) return 1; switch(listitem) { case 0: { if(Povolani[playerid] == 1) return SendClientMessage(playerid,-1,"[ ! ] Tady už jsi zaměstnaný!"); GivePlayerWeapon(playerid,24,1000); GivePlayerWeapon(playerid,25,1000); GivePlayerWeapon(playerid,3,1); SetPlayerColor(playerid,0x0066FFFF); SendClientMessage(playerid,-1,"Připojil jsi se k povolání policie"); Povolani[playerid] = 1; } case 1: { if(Povolani[playerid] != 1) return SendClientMessage(playerid,-1,"Nejsi tu zaměstnaný!"); switch(random(3)) { case 0: SetPlayerSkin(playerid,280); case 1: SetPlayerSkin(playerid,283); case 2: SetPlayerSkin(playerid,284); } SendClientMessage(playerid,-1,"Vzal jsi si skin povolání"); } } return 1; } if(dialogid == 2) { if(!response) return 1; switch(listitem) { case 0: { if(Povolani[playerid] == 2) return SendClientMessage(playerid,-1,"V tomto zaměstnání jsi již zaměstnán!"); GivePlayerWeapon(playerid,32,1000); GivePlayerWeapon(playerid,25,1000); SetPlayerColor(playerid,0xFF00FFFF); SendClientMessage(playerid,-1,"Stal jsi se Řidičem kamionů"); Povolani[playerid] = 2; } case 1: { if(Povolani[playerid] != 2) return SendClientMessage(playerid,-1,"U toho zaměstání nejsi zaměstnán!"); switch(random(3)) { case 0: SetPlayerSkin(playerid,128); case 1: SetPlayerSkin(playerid,133); case 2: SetPlayerSkin(playerid,135); } SendClientMessage(playerid,-1,"Převléknul jsi se"); } } return 1; } return 0; } - Pokud jsi to rozdělil, tak to je fatální chyba.- A ještě, pokud máš práci 1 je policie, tak proč je to samé číslo i u práce řidiče ?- Taky, proč bude mít 2 různé proměné?- A naposledy, proč posíláš 2 zprávy s tím, že u jednich z nich neznáš třetí parametr (string). To používej jen ve formatech. Link to comment Share on other sites More sharing options...
0 Neopry 0 Odesláno: 29. Květen, 2014 Author Share Odesláno: 29. Květen, 2014 Okey, díky moc. Funguje. Link to comment Share on other sites More sharing options...
Dotaz
Neopry 0
Ahoj,
Potřeboval bych pomoc s pracema.
Udělal jsem si filescript: Policie, Řidič Kamionů. (zatím jenom dvě abych vyzkoušel jestli to funguje)
U práce "Policie" nemám problém, ale u Řidiče kamionů se mi zobrazí jenom Dialog. Když kliknu na
"Přijmout práci" tak se nic nestane.
Možná je to tím že, to chci mít rozdělený ve filescriptech jako každé samostané zaměstnání.
Policie:
Řidič kamionů:
Link to comment
Share on other sites
3 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