SA-MP Forums Archive
Connecting Message - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Connecting Message (/showthread.php?tid=605009)



Connecting Message - Miller007 - 13.04.2016

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);
}
}
}
}


Re: Connecting Message - Sew_Sumi - 13.04.2016

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.


Re: Connecting Message - Miller007 - 13.04.2016

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


Re: Connecting Message - Sew_Sumi - 13.04.2016

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.


Re: Connecting Message - AmigaBlizzard - 13.04.2016

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.


Re: Connecting Message - Sew_Sumi - 13.04.2016

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...