Command Help
#1

I make a stats command but it's not working as I wanted.
The color seems good at the NPCs but not to normal Players. Also the NPC's Armour was 1120403456 for the one NPC. Moreover, the time.
Here is the code
pawn Код:
CMD:stats(playerid, params[])
{
    new targetid;
    if(sscanf(params,"i", targetid)) return SendClientMessage(playerid, COLOR_RED,"[ERROR]: Usage: /stats [playerid]");
    if(IsPlayerConnected(targetid) == 0) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: Player is not connected!");
    new Pname[24], sMessage[128];
    GetPlayerName(targetid, Pname, sizeof(Pname));
    format(sMessage, sizeof(sMessage), "***%s's (ID: %d) Stats***", Pname, targetid);
    SendClientMessage(playerid, COLOR_ORANGE, sMessage);
    new Float:health, Float:armor;
    GetPlayerHealth(targetid, health);
    GetPlayerArmour(targetid, armor);
    format(sMessage, sizeof(sMessage), "Health: (%d) Armour: (%d)", floatround(health),armor);
    SendClientMessage(playerid, COLOR_GREEN, sMessage);
    new hour, minutes;
    GetPlayerTime(targetid, hour, minutes);
    format(sMessage, sizeof(sMessage), "Money: (%d) Score: (%d) Color: (%d) Time: (%d:%d) Skin: (%d)", GetPlayerMoney(targetid), GetPlayerScore(targetid), GetPlayerColor(targetid), hour, minutes, GetPlayerSkin(targetid));
    SendClientMessage(playerid, COLOR_GREEN, sMessage);
    return 1;
}
Here a picture from the stats (Taxi_Driver(NPC) & harry_Potter(NPC) and me)
Reply
#2

Well of course the NPC Armour will be messed up as GTA cant read its armor as its a NPC. Secondly You only use 2 colors in your script so what else could it be?
Reply
#3

Quote:
Originally Posted by DaRkAnGeL[NBK]
Посмотреть сообщение
Well of course the NPC Armour will be messed up as GTA cant read its armor as its a NPC. Secondly You only use 2 colors in your script so what else could it be?
Okay, I will remove the Armour.
Also, about the colors I make it to getPlayerColor, not Message's color.

Edit:
I changed the color in-game and the Color: (%d) works now. But only if someone change the color
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)