0 registered members (),
683
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Chatsystem für bis zu 4 Leuten gleichzeitig.
[Re: Michael_Schwarz]
#81603
09/19/06 20:15
09/19/06 20:15
|
Joined: Apr 2006
Posts: 1,551 Netherlands
D3D
Serious User
|
Serious User
Joined: Apr 2006
Posts: 1,551
Netherlands
|
@ Michael_Schwarz: When the user doesn't type anything I don't want it to send and tried this. It worked, but the first time player can hit enter and pass. The second time it's prevented. Do you know how to always prevent sending in case nothing was typed? Code:
if(str_len(input_str)>=1 && (result==13)) // Wenn die eingabe mit enter beendet wurde { NachrichtAnServerSenden(); // Bericht verzenden } }
Dusty
|
|
|
Re: Chatsystem für bis zu 4 Leuten gleichzeitig.
[Re: Michael_Schwarz]
#81605
09/19/06 21:32
09/19/06 21:32
|
Joined: Apr 2006
Posts: 1,551 Netherlands
D3D
Serious User
|
Serious User
Joined: Apr 2006
Posts: 1,551
Netherlands
|
Thank you I changed the code to: Code:
function TextEingeben { if(inkey_active) { return; }
inkey(input_str);
if(result==13) { if(str_cmpi(input_str,"")) { return; } NachrichtAnServerSenden(); } }
Only it pass and send empty string the first time the application is loaded when ENTER is hit twice. After that it does prevent sending empty string though. Should I compare the string beforehand?
|
|
|
Re: Chatsystem für bis zu 4 Leuten gleichzeitig.
[Re: Michael_Schwarz]
#81607
09/19/06 21:39
09/19/06 21:39
|
Joined: Apr 2006
Posts: 1,551 Netherlands
D3D
Serious User
|
Serious User
Joined: Apr 2006
Posts: 1,551
Netherlands
|
Yes that worked thank you very much All the best, Dusty
|
|
|
Re: Eine Ganz blöde Frage ;-)
[Re: Berlinermauer]
#81610
12/03/06 18:04
12/03/06 18:04
|
Joined: Jun 2006
Posts: 2,640 Earth
Germanunkol
Expert
|
Expert
Joined: Jun 2006
Posts: 2,640
Earth
|
Ich hab grad zufälligerweise n chat program in "contirbutions" gestellt...das kannst du angucken. Der string "player_name" beinhaltet den spieler name. Am anfang, wenn du das spiel startest, kannst du mit -pl in der command line angeben wie der spieler heist... bsp: -sv -cl -pl Player1 Micha
~"I never let school interfere with my education"~ -Mark Twain
|
|
|
|