Connecting Message
#1

Hi all
Im using ladmin system and i made two different join messages one for player and other for admin but i dont why its not working

code

new IP[128];
if(ServerInfo[ConnectMessages] == 1)
{

GetPlayerIp(playerid,IP,sizeof(IP));
format(string,128,"*** %s [ID:%d] has joined the server.[ Country: %s | IP: %s ] ", PlayerName,playerid, GetPlayerCountryName(playerid),IP);
SendClientMessageToAll(green, string);
}
else
{
if (dUserINT(PlayerName2(playerid)).("Level") >= 1){
switch(PlayerInfo[playerid][Level]) {
case 0: {
format(string,128,"*** [Basic Adm] %s [ID:%d] has joined the server.[ Country: %s | IP: %s ] ", pName(playerid),playerid,GetPlayerCountryName(play erid),IP);
SendClientMessageToAll(green, string);
}
}
}
}
Reply
#2

How's it not working? Is it showing nothing at all? (It's also dodgy to broadcast peoples IPs to the server as well)

use print or printf in the ifs to check what variables are returning, if anything.


Even just
Код:
print(IP);
print(GetPlayerCountryName(playerid);
You shouldn't need 128 for IP, it'll only ever be 15 max being 12 numbers, and 3 decimals.
Reply
#3

when player connect it shows player xyz has join
but when admin connect it is then also says player xyz has join
Reply
#4

That'll be more that the variable hasn't loaded up for the connected player. It's not as if you set the admin tag, before they've logged in.

Best bet is to show them connecting as a normal player, then once they log in then say "A random admin has appeared!" or something.
Reply
#5

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
How's it not working? Is it showing nothing at all? (It's also dodgy to broadcast peoples IPs to the server as well)

use print or printf in the ifs to check what variables are returning, if anything.


Even just
Код:
print(IP);
print(GetPlayerCountryName(playerid);
You shouldn't need 128 for IP, it'll only ever be 15 max being 12 numbers, and 3 decimals.
You need 16 chars as you need to include the NULL-terminator character on strings.
Reply
#6

Quote:
Originally Posted by AmigaBlizzard
Посмотреть сообщение
You need 16 chars as you need to include the NULL-terminator character on strings.
Yep, What he said...


Can't debate with the Amiga...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)