if(strcmp(cmdtext, "/stats", true) == 0)
{
new StatMSG[128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
new Float:pHealth;
new Float:pArmour;
format(StatMSG,sizeof(StatMSG),"[Stats] Name: %s, Health: %d, Armor: %d, Money: %d", pName, GetPlayerHealth(playerid, pHealth), GetPlayerArmour(playerid, pArmour), GetPlayerMoney(playerid));
if (Job[playerid] == 0) {
SendClientMessage(playerid, COLOR_FLBLUE, StatMSG);
SendClientMessage(playerid, COLOR_FLBLUE, "[Stats] Job: Cop");
}else if (Job[playerid] == 1) {
SendClientMessage(playerid, COLOR_FLBLUE, StatMSG);
SendClientMessage(playerid, COLOR_FLBLUE, "[Stats] Job: Criminal");
}else if (Job[playerid] == 255) {
SendClientMessage(playerid, COLOR_FLBLUE, StatMSG);
SendClientMessage(playerid, COLOR_FLBLUE, "[Stats] Job: None");
}
return 1;
}
if(strcmp(cmdtext, "/stats", true) == 0)
{
new StatMSG[128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
new Float:pHealth;
new Float:pArmour;
GetPlayerHealth(playerid, pHealth);
GetPlayerArmour(playerid, pArmour);
format(StatMSG,sizeof(StatMSG),"[Stats] Name: %s, Health: %f, Armor: %f, Money: %d", pName, pHealth, pArmour, GetPlayerMoney(playerid));
if (Job[playerid] == 0) {
SendClientMessage(playerid, COLOR_FLBLUE, StatMSG);
SendClientMessage(playerid, COLOR_FLBLUE, "[Stats] Job: Cop");
}else if (Job[playerid] == 1) {
SendClientMessage(playerid, COLOR_FLBLUE, StatMSG);
SendClientMessage(playerid, COLOR_FLBLUE, "[Stats] Job: Criminal");
}else if (Job[playerid] == 255) {
SendClientMessage(playerid, COLOR_FLBLUE, StatMSG);
SendClientMessage(playerid, COLOR_FLBLUE, "[Stats] Job: None");
}
return 1;
}
if(strcmp(cmdtext, "/stats", true,6) == 0) { new StatMSG[128]; new pName[MAX_PLAYER_NAME]; GetPlayerName(playerid, pName, sizeof(pName)); new Float:pHealth; new Float:pArmour; GetPlayerHealth(playerid, pHealth); GetPlayerArmour(playerid, pArmour); format(StatMSG,sizeof(StatMSG),"[Stats] Name: %s, Health: %f, Armor: %f, Money: %d", pName, pHealth, pArmour, GetPlayerMoney(playerid)); if (Job[playerid] == 0) { SendClientMessage(playerid, COLOR_FLBLUE, StatMSG); SendClientMessage(playerid, COLOR_FLBLUE, "[Stats] Job: Cop"); } else if (Job[playerid] == 1) { SendClientMessage(playerid, COLOR_FLBLUE, StatMSG); SendClientMessage(playerid, COLOR_FLBLUE, "[Stats] Job: Criminal"); } else if (Job[playerid] == 255) { SendClientMessage(playerid, COLOR_FLBLUE, StatMSG); SendClientMessage(playerid, COLOR_FLBLUE, "[Stats] Job: None"); } return 1; }
Originally Posted by Thrarod
Changed anything?
|
if(strcmp(cmdtext, "/stats", true) == 0)
{
new StatMSG[128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
new Float:pHealth;
new Float:pArmour;
GetPlayerHealth(playerid, pHealth);
GetPlayerArmour(playerid, pArmour);
format(StatMSG,sizeof(StatMSG),"[Stats] Name: %s, Health: %f, Armor: %f, Money: %d", pName, pHealth, pArmour, GetPlayerMoney(playerid));
if (Job[playerid] == 0) {
SendClientMessage(playerid, COLOR_FLBLUE, StatMSG);
SendClientMessage(playerid, COLOR_FLBLUE, "[Stats] Job: Cop");
}else if (Job[playerid] == 1) {
SendClientMessage(playerid, COLOR_FLBLUE, StatMSG);
SendClientMessage(playerid, COLOR_FLBLUE, "[Stats] Job: Criminal");
}else if (Job[playerid] == 255) {
SendClientMessage(playerid, COLOR_FLBLUE, StatMSG);
SendClientMessage(playerid, COLOR_FLBLUE, "[Stats] Job: None");
}
return 1;
}
Originally Posted by Dark_Kostas
Quote:
DJDhan your code wont work. GetPlayerArmour and GetPlayerHealth doesnt return anything if you use it like that. |
Originally Posted by TheInnocentOne
Uhm none of that code will work. You need to get the health and armour into the floats BEFORE formatting the string. GetPlayerArmour and GetPlayerHealth do not return anything..
Replace your command with this code: |