matajus 0 Odesláno: 18. Červen, 2011 Share Odesláno: 18. Červen, 2011 Čau , potřeboval bych se zeptat do jakého publicu mám vložit toto: if(IsPlayerInRangeOfPoint(playerid, 6.0, -1836.3822,132.5754,15.4022)) { if(IsPlayerInAnyVehicle(playerid)) { if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) { SendClientMessage(playerid, COLOR_WHITE, "Musíš být řidič"); return 1; } ShowPlayerDialog(playerid, NEON, DIALOG_STYLE_LIST, "Vyberte si barvu neonu :","Modrá (5 000$)\nZelená(5 500$)\nŽlutá(4 000$)\nBílá(3 500$)\nRůžová(3 800$)\nOdstranit Neony (100 $)","Koupit","Nic"); } else { SendClientMessage(playerid, COLOR_WHITE, "Musíš být ve vozidle"); } } FUNKCE: má se zobrazit dialog s neony když je hráč vzdálen od 1 místa 6m , nevím do jakého publicu to hodit aby to fungovalo správně Link to comment Share on other sites More sharing options...
0 Globální moderátor HighPrint 177 Odesláno: 18. Červen, 2011 Globální moderátor Share Odesláno: 18. Červen, 2011 if(IsPlayerInRangeOfPoint(playerid, 6.0, -1836.3822,132.5754,15.4022)) změň si range Více info: http://wiki.sa-mp.com/wiki/IsPlayerInRangeOfPoint EDIT: Ne sry, blbě jsem si přečetl otázku No někam kde je ten public často vyvolán. Link to comment Share on other sites More sharing options...
0 booble1428 0 Odesláno: 18. Červen, 2011 Share Odesláno: 18. Červen, 2011 Jeste zjistit kde si to zkopčil... LOL Do OnPlayerCommandText Link to comment Share on other sites More sharing options...
0 matajus 0 Odesláno: 18. Červen, 2011 Author Share Odesláno: 18. Červen, 2011 a proč do onplayercmdtext? já to nechci přes příkaz ale normál ž když tam je tak se to zobrazí, neskopčil , udělal Link to comment Share on other sites More sharing options...
0 Guest Odesláno: 18. Červen, 2011 Share Odesláno: 18. Červen, 2011 udělej si třeba public .. forward public(playerid); public public(playerid) { // sem to dej return true; } Link to comment Share on other sites More sharing options...
0 matajus 0 Odesláno: 18. Červen, 2011 Author Share Odesláno: 18. Červen, 2011 díky, zkusím to Link to comment Share on other sites More sharing options...
0 booble1428 0 Odesláno: 18. Červen, 2011 Share Odesláno: 18. Červen, 2011 Ale na ten public co si uděláš si musíš dát timer aby obnovoval Link to comment Share on other sites More sharing options...
0 Petr 44 Odesláno: 18. Červen, 2011 Share Odesláno: 18. Červen, 2011 udělej si třeba public .. forward public(playerid); public public(playerid) { // sem to dej return true; } Zapomněl jsi timer. Navíc bych to spíš udělal přes public bez parametrů, SetTimer a optimalizovaný cyklus. Link to comment Share on other sites More sharing options...
0 matajus 0 Odesláno: 18. Červen, 2011 Author Share Odesláno: 18. Červen, 2011 udělal jsem to takto jak jte mi radili : forward neonpub(playerid); SetTimer("neonpub",1000,1); public neonpub(playerid) { if(IsPlayerInRangeOfPoint(playerid, 6.0, -1836.3822,132.5754,15.4022)) { if(IsPlayerInAnyVehicle(playerid)) { if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) { SendClientMessage(playerid, COLOR_WHITE, "Musíš být řidič"); return 1; } ShowPlayerDialog(playerid, NEON, DIALOG_STYLE_LIST, "Vyberte si barvu neonu :","Modrá (5 000$)\nZelená(5 500$)\nŽlutá(4 000$)\nBílá(3 500$)\nRůžová(3 800$)\nOdstranit Neony (100 $)","Koupit","Nic"); } else { SendClientMessage(playerid, COLOR_WHITE, "Musíš být ve vozidle"); } } if (IsPlayerInSphere(playerid, 362.4413,173.4329,1008.3828,3) == 1) { ShowPlayerDialog(playerid,infa,DIALOG_STYLE_MSGBOX,"Informace","Nyní se nacházíš na Městském úřadě! Zde si můžeš zřídit všemožné potřebné věci ke hraní!","Ok","Konec"); } return true; } a nejede Link to comment Share on other sites More sharing options...
0 Petr 44 Odesláno: 18. Červen, 2011 Share Odesláno: 18. Červen, 2011 Neudělal jsi to tak jak jsme radili, když dáš SetTimer, tak se ti nepřenese hodnota (playerid) do toho publicu, takže buď použij SetTimerEx nebo tam dej cyklus for, public nech bez parametrů a přes ten cyklus určuj playerid, samozřejmě nesmí chybět IsPlayerConnected. public ... { for { IsPlayerConnected { //tvůj kod } } return } Link to comment Share on other sites More sharing options...
0 Guest Odesláno: 19. Červen, 2011 Share Odesláno: 19. Červen, 2011 Petr- nešlo by timer smazat a dát ten public do OnPlayerUpdate ? -- ned 19. čer 2011 10:45:56 -- if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) { SendClientMessage(playerid, COLOR_WHITE, "Musíš být řidič"); return 1; } nemá být return false; ? Link to comment Share on other sites More sharing options...
0 Petr 44 Odesláno: 19. Červen, 2011 Share Odesláno: 19. Červen, 2011 OnPlayerUpdate: This callback is called everytime a client/player updates the server with their status. Víš jak často to nastane během jediné sekundy? No a ty by to takhle vyvolával pro každého hráče zvlášť. Bylo by to sice nejpřesnější, ale zatěžovalo by to pěkně, pokud by jsi měl na serveru víc lidí. Ten timer se ti přece jen vyvolává méněkrát, je pravda že je tam cyklus, ale pokud to zoptimalizuje podle návodu, co tu mám, tak to bude zatěžovat několikrát méně, než to s tím OnPlayerUpdate (při větší návštěvnosti) Link to comment Share on other sites More sharing options...
0 matajus 0 Odesláno: 19. Červen, 2011 Author Share Odesláno: 19. Červen, 2011 Když to dám takto : public neonpub(playerid) { for { if(IsPlayerConnected(playerid)) { if(IsPlayerInRangeOfPoint(playerid, 6.0, -1836.3822,132.5754,15.4022)) { if(IsPlayerInAnyVehicle(playerid)) { if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) { SendClientMessage(playerid, COLOR_WHITE, "Musíš být řidič"); return 1; } ShowPlayerDialog(playerid, NEON, DIALOG_STYLE_LIST, "Vyberte si barvu neonu :","Modrá (5 000$)\nZelená(5 500$)\nŽlutá(4 000$)\nBílá(3 500$)\nRůžová(3 800$)\nOdstranit Neony (100 $)","Koupit","Nic"); } else { SendClientMessage(playerid, COLOR_WHITE, "Musíš být ve vozidle"); } } } return 1; } tak mi to vypíše error: C:\Documents and Settings\Renek\Dokumenty\HRY\SAMP\samp03csvr_win32(2)\gamemodes\worldgta.pwn(12563 -- 12564) : error 029: invalid expression, assumed zero Link to comment Share on other sites More sharing options...
0 Guest Odesláno: 19. Červen, 2011 Share Odesláno: 19. Červen, 2011 cyklus je: for(new i;i ale přečti si petrův tut Link to comment Share on other sites More sharing options...
0 matajus 0 Odesláno: 19. Červen, 2011 Author Share Odesláno: 19. Červen, 2011 dobře přečet, ale když tam dám for for(new i=0; i tak mi to zase dá error: [code]C:\Documents and Settings\Renek\Dokumenty\HRY\SAMP\samp03csvr_win32(2)\gamemodes\worldgta.pwn(12585) : error 030: compound statement not closed at the end of file (started at line 12562) Link to comment Share on other sites More sharing options...
0 TonySVK 0 Odesláno: 19. Červen, 2011 Share Odesláno: 19. Červen, 2011 chýba ti za tím niečo napr. SendClientMessage alebo ; Link to comment Share on other sites More sharing options...
0 Petr 44 Odesláno: 19. Červen, 2011 Share Odesláno: 19. Červen, 2011 chýba ti za tím niečo napr. SendClientMessage alebo ; Blbost, neraď když nevíš. Tut jak správně závorkovat.... Link to comment Share on other sites More sharing options...
0 matajus 0 Odesláno: 20. Červen, 2011 Author Share Odesláno: 20. Červen, 2011 no dobře už nemám ani warning ale ten dialog se stejně nezobrazí Link to comment Share on other sites More sharing options...
0 Petr 44 Odesláno: 20. Červen, 2011 Share Odesláno: 20. Červen, 2011 Co třeba ukázat kód? Link to comment Share on other sites More sharing options...
Dotaz
matajus 0
Čau , potřeboval bych se zeptat do jakého publicu mám vložit toto:
FUNKCE:
má se zobrazit dialog s neony když je hráč vzdálen od 1 místa 6m , nevím do jakého publicu to hodit aby to fungovalo správně
Link to comment
Share on other sites
18 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