[HELP] /info command? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] /info command? (
/showthread.php?tid=116470)
[HELP] /info command? -
DeltaAirlines12 - 28.12.2009
How would I make a command so if you type /info <id> it would return with a message like this:
Player Name: Dustin
Player ID: 25
IP Address: 192.168.0.1
Money: $1256
Skin ID: 165
Health: 100
Armour: 100
Ping: 35
(And obviously all the supplied information would be correct.)
Main: I want this command to be able to be used by
ANYONE, NOT just admins.
I've read and searched but don't understand wiki and no one has released a FS like this before. Thanks.
Re: [HELP] /info command? -
CuervO - 28.12.2009
pawn Код:
if (strcmp(cmd, "/info", true) == 0) // Moddded By CuervO_NegrO
{
if(IsPlayerConnected(playerid))
{
new playersip[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /info [playerid/PartName]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
new Float:Health
new Float:Armour
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerIp(giveplayerid,playersip,sizeof(playersip));
GetPlayerHealth(giveplayerid, Health);
GetPlayerArmour(giveplayerid, Armour);
format(string, sizeof(string), "Player Name: %s || Player ID: %d || IP Address: %s", giveplayer, giveplayerid, playersip);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Money: %d || Health: %f || Armour: %f || Ping: %d", GetPlayerMoney(giveplayerid), Health, Armour, GetPlayerPing(giveplayerid));
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "No Such Player");
}
}
}
return 1;
}
EDIT: Tested and Works...
I advise not to show others' The Player IP.. But its Your Choice , There you go and have fun!