Minor problem with stats commands.
#1

Hi,

After typing /stats on a un-registered player, It shows the XP and Location. (Fine)
But then, the next like says 'Unknown Command'. Not sure why, Can anyone spot the problem for the command ?

Код:
(Information) XP-> 0 .. Location -> Blueberry
Server: Unknown Command.
Код:
Stats(playerid, params[])
{
	new pid = ReturnPlayer(params);
	if (pid == INVALID_PLAYER_ID) pid = playerid;
	
	new string[MAX_STRING];
	new location[28];
	GetPlayer2DZone(pid, location, 28);
	if(GetPlayerInterior(pid) > 0){
		format(string, sizeof(location),"Interior");
	}
	new PlayerState[10];
	if(GetPlayerState(pid) == 1) { PlayerState = "On foot"; }
	if(GetPlayerState(pid) == 2) { PlayerState = "Driver"; }
	if(GetPlayerState(pid) == 3) { PlayerState = "Passenger"; }
	if(GetPlayerState(pid) == 7) { PlayerState = "Dead"; }
	if(GetPlayerState(pid) == 0 || GetPlayerState(pid) == 4 || GetPlayerState(pid) == 5 || GetPlayerState(pid) == 6 || GetPlayerState(pid) == 8) { PlayerState = "/"; }
	format(string, sizeof(string), "{068F06} %s's(id:%i) Player Statistics", g_playerdata[pid][NAME], pid);
	SendClientMessage(playerid, COLOUR_DEFAULT, string);

	format(string, sizeof(string), "{EBD113}(Information) {FFFFFF}XP -> %i .. Location -> %s",g_playerdata[pid][XP],location);
	SendPlayerInfo(playerid, string);
	new Float:kr;
	kr = (g_playerdata[pid][KILLS]/g_playerdata[pid][DEATHS]);
	format(string, sizeof(string), "{EBD113}(Kills/Deaths) {FFFFFF}Kills -> %i .. Drive-by kills - > %i .. Deaths -> %i .. Suicides -> %i .. Ratio -> %.2fm", g_playerdata[pid][KILLS], g_playerdata[pid][DBKILLS], g_playerdata[pid][DEATHS], g_playerdata[pid][SUICIDES],kr);
	SendPlayerInfo(playerid, string);
	new Float:health, Float:armour;
	GetPlayerHealth(pid,health);GetPlayerArmour(pid, armour);
	format(string, sizeof(string), "{EBD113}(Personal) {FFFFFF}Health -> %.f .. Armor -> %.f .. Bank(Approx.) -> $%i",health,armour,g_playerdata[pid][BANK]);
	SendPlayerInfo(playerid, string);

	format(string, sizeof(string), "{EBD113}(Account) {FFFFFF}Online -> %i days, %i hours and %i minutes .. Registered -> %s", max(g_playerdata[pid][TIMEONLINE] / 1440, 0), max((g_playerdata[pid][TIMEONLINE] / 60) % 24, 0), g_playerdata[pid][TIMEONLINE] % 60, INI_Exist(ReturnPlayerFilename(g_playerdata[playerid][NAME])) ? ("Yes") : ("No"));
	SendPlayerInfo(playerid, string);
	
	format(string, sizeof(string), "{EBD113}(Account) {FFFFFF}Paused -> %i days, %i hours and %i minutes .. Playerstate -> %s", max(g_playerdata[pid][PAUSETIME] / 1440, 0), max((g_playerdata[pid][PAUSETIME] / 60) % 24, 0), g_playerdata[pid][PAUSETIME] % 60, PlayerState);
	SendPlayerInfo(playerid, string);

	return 1;
}
Thanks
Reply
#2

Is that /stats command from a filterscript?
Reply
#3

pawn Код:
CMD:stats(playerid, params[])
{
    new pid = ReturnPlayer(params);
    if (pid == INVALID_PLAYER_ID) pid = playerid;
   
    new string[MAX_STRING];
    new location[28];
    GetPlayer2DZone(pid, location, 28);
    if(GetPlayerInterior(pid) > 0){
        format(string, sizeof(location),"Interior");
    }
    new PlayerState[10];
    if(GetPlayerState(pid) == 1) { PlayerState = "On foot"; }
    if(GetPlayerState(pid) == 2) { PlayerState = "Driver"; }
    if(GetPlayerState(pid) == 3) { PlayerState = "Passenger"; }
    if(GetPlayerState(pid) == 7) { PlayerState = "Dead"; }
    if(GetPlayerState(pid) == 0 || GetPlayerState(pid) == 4 || GetPlayerState(pid) == 5 || GetPlayerState(pid) == 6 || GetPlayerState(pid) == 8) { PlayerState = "/"; }
    format(string, sizeof(string), "{068F06} %s's(id:%i) Player Statistics", g_playerdata[pid][NAME], pid);
    SendClientMessage(playerid, COLOUR_DEFAULT, string);

    format(string, sizeof(string), "{EBD113}(Information) {FFFFFF}XP -> %i .. Location -> %s",g_playerdata[pid][XP],location);
    SendPlayerInfo(playerid, string);
    new Float:kr;
    kr = (g_playerdata[pid][KILLS]/g_playerdata[pid][DEATHS]);
    format(string, sizeof(string), "{EBD113}(Kills/Deaths) {FFFFFF}Kills -> %i .. Drive-by kills - > %i .. Deaths -> %i .. Suicides -> %i .. Ratio -> %.2fm", g_playerdata[pid][KILLS], g_playerdata[pid][DBKILLS], g_playerdata[pid][DEATHS], g_playerdata[pid][SUICIDES],kr);
    SendPlayerInfo(playerid, string);
    new Float:health, Float:armour;
    GetPlayerHealth(pid,health);GetPlayerArmour(pid, armour);
    format(string, sizeof(string), "{EBD113}(Personal) {FFFFFF}Health -> %.f .. Armor -> %.f .. Bank(Approx.) -> $%i",health,armour,g_playerdata[pid][BANK]);
    SendPlayerInfo(playerid, string);

    format(string, sizeof(string), "{EBD113}(Account) {FFFFFF}Online -> %i days, %i hours and %i minutes .. Registered -> %s", max(g_playerdata[pid][TIMEONLINE] / 1440, 0), max((g_playerdata[pid][TIMEONLINE] / 60) % 24, 0), g_playerdata[pid][TIMEONLINE] % 60, INI_Exist(ReturnPlayerFilename(g_playerdata[playerid][NAME])) ? ("Yes") : ("No"));
    SendPlayerInfo(playerid, string);
   
    format(string, sizeof(string), "{EBD113}(Account) {FFFFFF}Paused -> %i days, %i hours and %i minutes .. Playerstate -> %s", max(g_playerdata[pid][PAUSETIME] / 1440, 0), max((g_playerdata[pid][PAUSETIME] / 60) % 24, 0), g_playerdata[pid][PAUSETIME] % 60, PlayerState);
    SendPlayerInfo(playerid, string);

    return 1;
}
Reply
#4

The commands inside a include I created.

Код:
cmd(Stats, 5, cmdtext);
Reply
#5

wtf? Nope
it should be like this
pawn Код:
CMD:stats(playerid,params[])
//or
Command:stats(playerid,params[])
Reply
#6

Well my settings have been modified. Other then that, Even with the CMD: It still doesn't seem to work.
Reply
#7

Quote:
Originally Posted by Rudy_
Посмотреть сообщение
wtf? Nope
it should be like this
pawn Код:
CMD:stats(playerid,params[])
//or
Command:stats(playerid,params[])
nah
pawn Код:
cmd(stats, playerid,params[]), command(stats, blabla, COMMAND:stats, CMD:stats
same shit...
Reply
#8

He had " ; " in the last too -.-
[Remove]This forum requires that you wait 120 seconds between posts. Please try again in 50 seconds.
[/FFS]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)