Help: Playerinfo
#1

Hello!

I need your help...

How can I make a command /playerinfo [player ID] like this...

Playerinfo: Name: Myname (ID:7), IP: ip of a player, Location: his location

Thanks for your help and time
Reply
#2

pawn Код:
new String[128], Playername[MAX_PLAYER_NAME], IP[16];
GetPlayerName(playerid, Playername, MAX_PLAYER_NAME);
GetPlayerIp(playerid, IP, MAX_PLAYER_NAME);
format(String, sizeof(String), "PlayerInfo: Name: %s(%d), IP: %s", Playername, IP);
SendClientMessage(playerid, -1, String);
return 1;
Reply
#3

Quote:
Originally Posted by MikeLovesToHelp
Посмотреть сообщение
pawn Код:
new String[128], Playername[MAX_PLAYER_NAME], IP[16];
GetPlayerName(playerid, Playername, MAX_PLAYER_NAME);
GetPlayerIp(playerid, IP, MAX_PLAYER_NAME);
format(String, sizeof(String), "PlayerInfo: Name: %s(%d), IP: %s", Playername, IP);
SendClientMessage(playerid, -1, String);
return 1;
Thanks for this REP+, what about location?
Reply
#4

I recommend you look into the Zones include. Otherwise the location would just show as a bunch of numbers, I can add the location in if you'd like?
Reply
#5

Quote:
Originally Posted by MikeLovesToHelp
Посмотреть сообщение
I recommend you look into the Zones include. Otherwise the location would just show as a bunch of numbers, I can add the location in if you'd like?
Sure
Reply
#6

pawn Код:
new String[128], Playername[MAX_PLAYER_NAME], IP[16], Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerName(playerid, Playername, MAX_PLAYER_NAME);
    GetPlayerIp(playerid, IP, MAX_PLAYER_NAME);
    GetPlayer
    format(String, sizeof(String), "PlayerInfo: Name: %s(%d), IP: %s, Location: X: %d Y:%d Z:%d", Playername, IP, X, Y, Z);
    SendClientMessage(playerid, -1, String);
    return 1
As I said, it'll only show the X Y and Z as float numbers.

EDIT: If you use ZCMD I will happily type this command up fully including the SSCANF && Zones and everything.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)