Help: Playerinfo - 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: Help: Playerinfo (
/showthread.php?tid=427420)
Help: Playerinfo -
Areax - 01.04.2013
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
Re: Help: Playerinfo -
Isolated - 01.04.2013
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;
Re: Help: Playerinfo -
Areax - 01.04.2013
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?
Re: Help: Playerinfo -
Isolated - 01.04.2013
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?
Re: Help: Playerinfo -
Areax - 01.04.2013
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
Re: Help: Playerinfo -
Isolated - 01.04.2013
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.