Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 683 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 3
Page 3 of 3 1 2 3
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 Offline
Serious User
D3D  Offline
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


smile
Re: Chatsystem für bis zu 4 Leuten gleichzeitig. [Re: D3D] #81604
09/19/06 21:18
09/19/06 21:18
Joined: Aug 2003
Posts: 7,439
Red Dwarf
Michael_Schwarz Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,439
Red Dwarf
Quote:

@ 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




try this:

Code:
  if(result==13)
{
if(str_cmpi(input_str,""))
{
return;
}
NachrichtAnServerSenden();
}




"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
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 Offline
Serious User
D3D  Offline
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?


smile
Re: Chatsystem für bis zu 4 Leuten gleichzeitig. [Re: D3D] #81606
09/19/06 21:35
09/19/06 21:35
Joined: Aug 2003
Posts: 7,439
Red Dwarf
Michael_Schwarz Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,439
Red Dwarf
Quote:

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 on the first time the application is loaded and ENTER is hit twice. After that it does prevent sending empty string. Should I try to do string compare beforehand?




try this:

Code:
function TextEingeben
{
if(inkey_active)
{
return;
}
str_cpy(input_str,"");
inkey(input_str);

if(result==13)
{
if(str_cmpi(input_str,""))
{
return;
}
NachrichtAnServerSenden();
}
}




"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
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 Offline
Serious User
D3D  Offline
Serious User

Joined: Apr 2006
Posts: 1,551
Netherlands
Yes that worked thank you very much

All the best,

Dusty


smile
Re: Chatsystem für bis zu 4 Leuten gleichzeitig. [Re: D3D] #81608
09/19/06 21:41
09/19/06 21:41
Joined: Aug 2003
Posts: 7,439
Red Dwarf
Michael_Schwarz Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,439
Red Dwarf
i am glad i could help you


"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
Eine Ganz blöde Frage ;-) [Re: Michael_Schwarz] #81609
12/03/06 17:27
12/03/06 17:27
Joined: Dec 2006
Posts: 34
Germany,Baden-Württemberg, Kar...
B
Berlinermauer Offline
Newbie
Berlinermauer  Offline
Newbie
B

Joined: Dec 2006
Posts: 34
Germany,Baden-Württemberg, Kar...
woher weis das Skript bzw. der Server wie der Player heißt muss ich den Spieler vorher Fragen oder wie läuft das???

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 Offline
Expert
Germanunkol  Offline
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
Re: Eine Ganz blöde Frage ;-) [Re: Germanunkol] #81611
12/03/06 18:55
12/03/06 18:55
Joined: Dec 2006
Posts: 34
Germany,Baden-Württemberg, Kar...
B
Berlinermauer Offline
Newbie
Berlinermauer  Offline
Newbie
B

Joined: Dec 2006
Posts: 34
Germany,Baden-Württemberg, Kar...
thx Ich versuche es!!!


Nur wer viel weiß, weiß, dass er nichts weiß!
Page 3 of 3 1 2 3

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1