OnPlayerConnect
#1

yo,

I was wondering if its possible and if you could guide me into making it so that OnPlayerConnect shows everyone connecting but for example selected admins

So John has entered the server and he is a normal player , so sendclientmessage john has entered the server bla bla...

But when James a admin enters the server , this message is not shown.

If someone could give me an example to work with it would be appreicated.
Reply
#2

hmmm..im not sure if thats possible because most admins log in 'after' they are connected.
You could make it on onplayerspawn though.

EDIT; Maybe you can script that the server recognise a name and then the server would put Admin in front of the name or something
Reply
#3

I mean so the admin is not shown entering the server at all , so no one knows they have joined
Reply
#4

Lol .. its the same simple connect/disconnect message - shows who coonected/dis
Reply
#5

This is impossible with the regular RCON admin system and the reason has been told by Boelie
Quote:
Originally Posted by boelie
most admins log in 'after' they are connected.
But it is possible if you save if they are an admin in a file (Like a .ini file) And then checks if they are admin

Like you could make it easy and just make a file for your admins then it is just this code

pawn Код:
public OnPlayerConnect(playerid)
{
  new name[MAX_PLAYER_NAME],file[23],string[];
  GetPlayerName(playerid,name,sizeof(name));
  format(file,sizeof(file),"%s.ini",name);
  if(!fexist(file))
  {
    format(string,sizeof(string),"Player %s has joined the server",name);
    SendClientMessageToAll(0xFFFFFF,string);
    return 1;
    }
  else return 1;
}

This way works if you are using RCON admin system. If you want someone to be an admin you give him the code and make a .ini file in hes username. You don't have to add anything in the file, just the name matters here.

Then it will show a message if the username file do not exist and if it does it shows nothing.


But if you use a downloaded adminscript or made your own you will have to use another way
Reply
#6

why impossible?
what about this:
pawn Код:
if(IsPlayerAdmin(playerid)) return 0;
??
Reply
#7

As mentioned before IsPlayerAdmin checks if you are an Rcon admin and you actually have to already connect before you can login to rcon.
Reply
#8

oh. really. sorry.
or you can specify your ip.. and check if it's yours or not.
Reply
#9

Yeah but not many people have static IP's these days. Deserts idea was probably the best, just create a file in your scriptfiles called username.txt or .ini or what ever. When the use connects check if there is a file which matches the users name.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)