Entering Server
#1

Can somone help me make somthing by IP. If there IP Is detected on connect it will say in chat

SendClientMessage(playerid, COLOR_RED,"Attention: Server Owner Has Joined The Server");

Detects VIA IP On player connect If Owner?
Reply
#2

https://sampwiki.blast.hk/wiki/GetPlayerIp

look at the example
Reply
#3

I got some errors

Код:
//--------------------------------------Server Entry----------------------------
public OnPlayerConnect(playerid )
{
	new plrIP[16];
	GetPlayerIp(playerid, plrIP, sizeof(plrIP));

	if (!strcmp(plrIP, "127.0.0.1")) {
	  SendClientMessage(playerid, COLOR_RED,"Attention: Server Owner Has Joined The Server")
	}
	return 1;
}
//-------------------------------------------------------------------------------
Errors:

Код:
C:\Users\Nathan\Desktop\Script.pwn(2) : warning 235: public function lacks forward declaration (symbol "OnPlayerConnect")
C:\Users\Nathan\Desktop\Script.pwn(5) : error 017: undefined symbol "GetPlayerIp"
C:\Users\Nathan\Desktop\Script.pwn(5) : warning 202: number of arguments does not match definition
C:\Users\Nathan\Desktop\Script.pwn(7) : error 017: undefined symbol "strcmp"
C:\Users\Nathan\Desktop\Script.pwn(8) : error 017: undefined symbol "SendClientMessage"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Help please
Reply
#4

Код:
#include <a_samp>

did you put this in beginning of script?
Reply
#5

Код:
public OnPlayerConnect(playerid )
change to, 1 error should solve
Код:
public OnPlayerConnect(playerid)
Reply
#6

Quote:
Originally Posted by Paranoja
Код:
public OnPlayerConnect(playerid )
change to, 1 error should solve
Код:
public OnPlayerConnect(playerid)
lol, not, he didn't include a_samp
Reply
#7

Fixed.

Thanks for the help really appreciate it
Reply
#8

Lol, wouldnt it be easier like this?
if(GetPlayerName(playerid) == your name)
SendClientMessageToAll(0xFFFF00AA, "The server owner has joined to the server.");
else
new n[MAX_PLAYER_NAME], string[48];
GetPlayerName(playerid, n, sizeof(name));
format(string, sizeof(string), "%s has joined the server.", n );
SendClientMessageToAll(0xFFFF00AA, string);
Reply
#9

Quote:
Originally Posted by Gimax
Quote:
Originally Posted by Paranoja
Код:
public OnPlayerConnect(playerid )
change to, 1 error should solve
Код:
public OnPlayerConnect(playerid)
lol, not, he didn't include a_samp
I didin't mentioned that it would fix all the errors, i said that one of the errors could occur because of the invalid heading...
Reply
#10

Quote:
Originally Posted by Paranoja
Quote:
Originally Posted by Gimax
Quote:
Originally Posted by Paranoja
Код:
public OnPlayerConnect(playerid )
change to, 1 error should solve
Код:
public OnPlayerConnect(playerid)
lol, not, he didn't include a_samp
I didin't mentioned that it would fix all the errors, i said that one of the errors could occur because of the invalid heading...
No, spacing is not source of errors.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)