if (name[playerid] == Remi)?
#1

Is it possible to make a script in On Player Connect, wich do something like this:
You join the server, and the server checks if i am Remi. If i'm Remi, i can login. If i'm not Remi, i wil be kicked from the the server.

Is that possible? And how?
Reply
#2

if(GetPlayerName[playerid] == Remi)
Reply
#3

pawn Код:
new string[16];
    GetPlayerName(playerid,string,MAX_PLAYER_NAME);
    if((strfind(string, "Remi", true) != -1))
    {
        SendClientMessage(playerid, color, "Welcome");
    } else {
        Kick(playerid);
    }
Reply
#4

Quote:
Originally Posted by FUNExtreme
if(GetPlayerName[playerid] == Remi)
A?

Quote:
Originally Posted by Pyrokid
pawn Код:
new string[16];
    GetPlayerName(playerid,string,MAX_PLAYER_NAME);
    if((strfind(string, "Remi", true) != -1))
    {
        SendClientMessage(playerid, color, "Welcome");
    } else {
        Kick(playerid);
    }
Than if someone enter the server with name Remi_Lastname the server will not kick him...
Reply
#5

So the -1 should be 4 right?

Still anyone can change their name to Remi and join. You should use your IP instead.
Reply
#6

Quote:
Originally Posted by FUNExtreme
if(GetPlayerName[playerid] == Remi)
Don't attempt to help people if you don't even know the correct answer.
Reply
#7

so what must i use?
Код:
	new string[16];
	GetPlayerName(playerid,string,MAX_PLAYER_NAME);
	if((strfind(string, "Remi", true) != 4))
	{
		SendClientMessage(playerid, color, "Welcome");
	} else {
		Kick(playerid);
	}
?
Reply
#8

Quote:
Originally Posted by Remi-X
so what must i use?
Код:
	new string[16];
	GetPlayerName(playerid,string,MAX_PLAYER_NAME);
	if((strfind(string, "Remi", true) != 4))
	{
		SendClientMessage(playerid, color, "Welcome");
	} else {
		Kick(playerid);
	}
?
Yeah I think that should work (someone confirm it for me).

However like I said before, if you're not in the server and it is up, a random person can just change their name to Remi and join. It'd be best if you checked the IP address.

OnPlayerConnect
pawn Код:
new ip[16];
    GetPlayerIp(playerid, ip, sizeof(ip));

    if (!strcmp(ip, "change this to your IP")) {
      SendClientMessage(playerid, 0xFFFFFFFF, "- Welcome to your server master :-).");
    } else {
        Kick(playerid);
    }
Get your IP here: http://www.whatismyip.com/
Reply
#9

Quote:
Originally Posted by Pyrokid
OnPlayerConnect
pawn Код:
new ip[16];
    GetPlayerIp(playerid, ip, sizeof(ip));

    if (!strcmp(ip, "change this to your IP")) {
      SendClientMessage(playerid, 0xFFFFFFFF, "- Welcome to your server master :-).");
    } else {
        Kick(playerid);
    }
Get your IP here: http://www.whatismyip.com/
Yes, i know about the IP Adress. But i'm making a meeting for the Dutch GTAForum.nl, and some peple there have a changing IP, not a static. So, for this time is a name more handy. But, im not stupid. If the name is valid, you must login after that. So, if someone have the same name, he even cant get in the server because he dont know the pass.

But thanks
Reply
#10

K then the name one I posted should work, although you should test it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)