[HELP] /info command?
#1

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.
Reply
#2

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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)