Quote:
Originally Posted by Jakku
Your command shows the player stats who typed that command. Not the ID as that guy wanted. Giveplayerid maybe fix it
|
oops ye like i said done it quickly
pawn Код:
if (strcmp("/pinfo", cmdtext, true, 10) == 0)
{
new strs[85],IP[20],Float:Hth,Float:Arm;
GetPlayerIP(playerid,IP,sizeof(IP));
Float:Hth = GetPlayerHealth(playerid);
Float:Arm = GetPlayerArmour(playerid);
format(strs,sizeof(strs),"Money: %d Health: %f Armour: %f IP: %s",GetPlayerMoney(playerid),Float:Hth,Float:Arm,IP);
return 1;
}
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];
new Float:Hth,Float:Arm;
GetPlayerIp(giveplayerid, ip, sizeof ip);
GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
Float:Hth = GetPlayerHealth(giveplayerid);
Float:Arm = GetPlayerArmour(giveplayerid);
format(sstring, sizeof(sstring), "%s's IP: %s Money: %d Health: %f Armour: %f", giveplayername,ip,GetPlayerMoney(giveplayerid),Float:Hth,Float:Arm);
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;
}
these should work i guess