Problem
#1

how can i make a thingy that allows a name with FirstName_LastName format..cauze i made one and it makes server restart..
Reply
#2

Show us the code?
Reply
#3

HERE:

pawn Код:
if(AntiName == 1)
                    {
                        if(namestring == -1)
                        {
                            format(string, sizeof(string),"%s, a primit Kick de la Name_BOT!",name);
                            SendClientMessageToAll(COLOR_RED, string);
                            SendClientMessage(playerid, COLOR_YELLOW, "Ministru: Nu iti putem accepta numele.");
                            SendClientMessage(playerid, COLOR_YELLOW, "Hint: Numele tau trebuie sa fie in format Nume_Prenume.");
                            format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] Anticheat Has Kicked %s for Invalid Name",d,m,y,h,mi,s,name);
                            KickLog(string);
                            Kick(playerid);
                            return 1;
                        }
                    }
                    if(IsPlayerNPC(playerid))
                    {
                        SpawnPlayer(playerid);
                        return 1;
                    }

PHP код:
This -1 makes the restart if(namestring == -1) - if its 1 or 0 the server is good and doesent work.. 
Reply
#4

Here's one I made, by the way, it's tested and working.

pawn Код:
new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    if(strfind(pName, "_", true) == -1)
    {
        SendClientMessage(playerid,COLOR_WHITE, "Your name must be in this format: Firstname_Lastname Format. (Example: Bob_Jones)");
        Kick(playerid);
        return 1;
    }
Reply
#5

Quote:
Originally Posted by Edward156
Посмотреть сообщение
Here's one I made, by the way, it's tested and working.

pawn Код:
new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    if(strfind(pName, "_", true) == -1)
    {
        SendClientMessage(playerid,COLOR_WHITE, "Your name must be in this format: Firstname_Lastname Format. (Example: Bob_Jones)");
        Kick(playerid);
        return 1;
    }
i put it at onplayerconnect and the server keeps restarting with no message..
Reply
#6

Quote:
Originally Posted by Dan_Barocu
Посмотреть сообщение
i put it at onplayerconnect and the server keeps restarting with no message..
Then it's another code that's conflicting with that.
Reply
#7

i dont know how the could the code be?
Reply
#8

Show us the public OnGameModeinit
Reply
#9

it doesent work the server is starting but no message appears..
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)