473,395 Members | 1,568 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Simple command...

3
I am making a command for my Java program and I want to make a command like this -

else if(command.startsWith("banuser") && p.rights > 1)
{
String user = command.substring(5);
int id = Main.m.ge.getIdFromName(user);
Player plr = Main.m.ge.players[id];
plr.disconnected[0] =
plr.disconnected[1] = true;



Thats as far as I got, so far it's saying if my player rights are over 1 it will kick them off the server. I want it to now Write that players name to a file called "BANNEDHOSTS.dat" but I'm lost when I get there...
Aug 1 '08 #1
4 1396
r035198x
13,262 8TB
Read about how to write to a file here , try the code and post again here if you still get problems.
Aug 1 '08 #2
BezEr
3
Which one do I use the first one or the second one to start, also it takes all that to write "playername" To bannedusers.dat?

I'm not good at all at Java programming, I know simple things is all ;(.
Aug 1 '08 #3
r035198x
13,262 8TB
Which one do I use the first one or the second one to start...
There is only one method shown there for writing to a file.

..also it takes all that to write "playername" To bannedusers.dat?

I'm not good at all at Java programming, I know simple things is all ;(.
That's only 15 lines!
Aug 1 '08 #4
BezEr
3
There is only one method shown there for writing to a file.


That's only 15 lines!
Yeah but I used 4 lines to get the name and kick the name, I figured adding the name to a file would be easier o.o.
Aug 1 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

38
by: jrlen balane | last post by:
basically what the code does is transmit data to a hardware and then receive data that the hardware will transmit. import serial import string import time from struct import * ser =...
5
by: max(01)* | last post by:
hello. i wrote a very simple tkinter demo program that uses menus, buttons, labels, entries, frames and secondary toplevels. it is a python version of a java program made by a colleague. ...
1
by: elastic | last post by:
I'm trying to implement a simple timer to work on win32 (98,2k,xp), solaris and linux. where the last two are simple, the first seems to be problematic. the problem is that the kill command seems...
7
by: Ben Bean | last post by:
Yes, the online documentation is EXcellent! So I will be using the php.exe in command line mode VERY SOON! I will readily pick up on ALL of the wonderful ways to parse an input file and send output...
19
by: Kramer | last post by:
Hi all, And thank you all so very much for all your recommendations. This is a great group. I ran across a freeware uploader from Toma Web called, Simple FTP 2.0. Anyone have any knowledge...
3
by: | last post by:
I am trying to compile a simple c# class in Web Matrix called howdy.cs: // Program start class public class HowdyPartner { // Main begins program execution public static void Main() { //...
4
by: olafmol | last post by:
Hello, i am wondering if there is a simple way to insert a new record into an MS Access db and read out the newly created auto-ID field. Using ASP this was rather simple, but in ASP.NET (VB) it...
2
by: tonytony24 | last post by:
Hi All: I was wondering if there's a simple way to call a MS Access Module through either Command Prompt MS Script any other way... Thanks for the response.
6
by: Armel Asselin | last post by:
Hello, I'm searching for a simple command line tool to manipulate XML files. The idea would be commands such as that: xmanip-tool set /document/xpath/@name="value" remove //wrong-nodes add...
6
by: beantaxi | last post by:
Hello all, I'm looking for a very simple code analysis tool. I have a large codebase to analyze, and all I really need to do is to find all uses of all methods in a few interfaces. Many tools...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.