[HELP] NickNames "con", "aux", etc... Craches my server :(
#1

Hello, friends...

I have a server 0.3e running on Windows and if any player(fucked player) connect with name "con", "aux", etc, crashes the server, crashes all online players and not is possible other player connect!

I've used several types of script, but do not work!
An example:

pawn Код:
public OnPlayerConnect(playerid)
{

    new plname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, plname, sizeof(plname));
    if(strcmp(plname,"con",true)==0)
    {
      Ban(playerid);
      if(IsPlayerConnected(playerid)) OnPlayerConnect(playerid);// I used it because even though the player quit the server it still shows up as connected! But it worked!
      return 1;
    }

}
If the player entered the name "Peter_Con" he is banished, but when you enter only "con" is not banned and the server crashes, as I said above!
I thought that no longer existed in SA: MP 0.3e!
I sent an email to staff samp, did not answer me!


I've tried everything, help me please! I beg!
Reply
#2

Try and create a file on Windows and name is one of those names - you'll see Windows doesn't allow it.

Here's a quote from Wikipedia:

In addition, in Windows and DOS utilities, some words might also be reserved and can not be used as filenames.[9] For example, DOS Device file:
CON, PRN, AUX, CLOCK$, NUL
COM0, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9
LPT0, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9.

So yeah - don't create any files with those names.
Reply
#3

Exactly, but how do you ban the player that goes with these names?
I tryed, but not work and ever crashes the server!
Reply
#4

Because you're probably creating a file for them. Do you create any files including the player's name in OnPlayerConnect? Check for fwrite().
Reply
#5

OMGGGGG I LOVEEEEEE YOUUUU MAN (I am not a Gay hahha)!!!!!!!!!!!!!!!!!!!!!!!!

I use a FS of Houses and create file in OnPlayerConnect();

Problem Solved! Thank very much! + Rep for you!


Reply
#6

Ohhh Nooooo
The server ban, but the player keep showing as connected... and now?



IGNORE IT.... Solved also... in OnplayerDisconnect() creates file also!

Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)