05.04.2013, 20:41
I am aiming to do a /stats, but when someone uses the command it sends them the first string, but then the Unknown command message underneath it without displaying the the other strings.
Also, I have placed 'return 1;' at the end of both if they're an admin or if they aren't.
Any help is greatly appreciated.
Code:
CMD:stats(playerid, params[]) { new Float:HP, Float:ARM; GetPlayerHealth(playerid, HP); GetPlayerArmour(playerid, ARM); if(p_data[playerid][AdminLevel] == 0) { new str[128], str1[128]; format(str, sizeof(str), "Name: %s | Money: %d | Bank Money: %d | Job: %s | VIP Level: %d | Hours: %d |",getName(playerid),p_info[playerid][Money],p_data[playerid][Bank],p_info[playerid][Jobs],p_data[playerid][VIP],p_data[playerid][Hours]); SendClientMessage(playerid, -1, str); format(str1, sizeof(str1), "Deaths: %d | Kills: %d | Kill Death Ratio: %d | Group: %d | Rank: %d | ",p_data[playerid][deaths],p_data[playerid][kills],p_data[playerid][kills]/p_data[playerid][deaths],p_data[playerid][Group],p_data[playerid][Rank]); SendClientMessage(playerid, -1, str1); } if(p_data[playerid][AdminLevel] >= 1) { new str[128], str1[128], str2[128]; format(str, sizeof(str), "Name: %s | Money: %d | Bank Money: %d | Job: %s | VIP Level: %d | Armour: %.0f | Hours: %d |",getName(playerid),p_info[playerid][Money],p_data[playerid][Bank],p_info[playerid][Jobs],p_data[playerid][VIP], ARM, p_data[playerid][Hours]); SendClientMessage(playerid, -1, str); format(str1, sizeof(str1), "Admin Level: %d | Admin Actions: %d | Interior Id: %d | Virtual World: %d | Health: %.0f |",p_data[playerid][AdminLevel],p_data[playerid][actions],GetPlayerInterior(playerid),GetPlayerVirtualWorld(playerid),HP); SendClientMessage(playerid, -1, str1); format(str2, sizeof(str2), "Deaths: %d | Kills: %d | Kill Death Ratio: %d | Group: %d | Rank: %d | Skin: %d |",p_data[playerid][deaths],p_data[playerid][kills],p_data[playerid][kills]/p_data[playerid][deaths],p_data[playerid][Group],p_data[playerid][Rank],GetPlayerSkin(playerid)); SendClientMessage(playerid, -1, str2); } return 1; }
Any help is greatly appreciated.