/playerinfo
#9

Quote:
Originally Posted by ┤ŞąiBЄЯҒПŋ├
pawn Код:
if (strcmp("/pinfo", cmdtext, true, 10) == 0)
    {
        new strs[256],IP[20];
        GetPlayerIP(playerid,IP,sizeof(IP));
        format(strs,sizeof(strs),"Money: %d Health: %f Armour: %f IP: %s",GetPlayerMoney(playerid),GetPlayerHealth(playerid),GetPlayerArmour(playerid),IP);
         return 1;
    }
without strtok
and with strtok:

pawn Код:
if(strcmp(cmd, "/pinfo", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) //If nothing is typed in behind /pinfo
        {
            SendClientMessage(playerid, YOURCOLOR, "USAGE: /pInfo [playerid]");
            SendClientMessage(playerid, YOURCOLOR, "FUNCTION: View player's stats.");
            return 1;
        }
        new giveplayerid = ReturnUser(tmp);
        if(IsPlayerConnected(giveplayerid))//If the player is connected
        {
            new sstring[90];
            new ip[20];
            GetPlayerIp(giveplayerid, ip, sizeof ip);
            GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
            format(sstring, sizeof(sstring), "%s's IP: %s Money: %d Health: %f Armour: %f", giveplayername,ip,GetPlayerMoney(playerid),GetPlayerHealth(playerid),GetPlayerArmour(playerid));
            SendClientMessage(playerid,YOURCOLOR, sstring);
        }
        else //If he ain't connected
        {
            format(string, sizeof(string), "%d is not an active player.", giveplayerid);
            SendClientMessage(playerid, YOURCOLOR, string);
        }
        return 1;
    }
Your command shows the player stats who typed that command. Not the ID as that guy wanted. Giveplayerid maybe fix it
Reply


Messages In This Thread
/playerinfo - by [ATC]eRaZoR - 17.10.2009, 10:14
Re: /playerinfo - by MenaceX^ - 17.10.2009, 10:17
Re: /playerinfo - by [ATC]eRaZoR - 17.10.2009, 10:29
Re: /playerinfo - by Hiitch - 17.10.2009, 10:59
Re: /playerinfo - by saiberfun - 17.10.2009, 11:16
Re: /playerinfo - by Correlli - 17.10.2009, 12:54
Re: /playerinfo - by dice7 - 17.10.2009, 12:54
Re: /playerinfo - by saiberfun - 17.10.2009, 13:00
Re: /playerinfo - by Jakku - 17.10.2009, 13:01
Re: /playerinfo - by saiberfun - 17.10.2009, 13:10

Forum Jump:


Users browsing this thread: 2 Guest(s)