#1

Hi everybody, i'm using an ladmin4v2 modified by me and i have stats cmd, but when i enter on server and i type '/stats' the server tells me 'SERVER: Unknown Command.' why?
The command:
Код:
#if defined USE_STATS
dcmd_stats(playerid,params[]) {
    new rankid = pRank[playerid];
    new plName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, plName, sizeof(plName));
   	new rank[20];
   	if(pRank[playerid] == 0) { rank = "Newbie"; }
    else if(pRank[playerid] == 1) { rank = "Baby Killa'"; }
    else if(pRank[playerid] == 2) { rank = "Soldier"; }
    else if(pRank[playerid] == 3) { rank = "Gangsta'"; }
    else if(pRank[playerid] == 4) { rank = "Underboss"; }
    else if(pRank[playerid] == 5) { rank = "Tha' Boss"; }
    new string[9999],sA[1024],sM[1024],sD[1024],sS[1024], sL[1024], sI[1024],file[256],P1Logged[4],P1Register[4],RegDate[256], pDeaths, player1, h, m, s;
	if(!strlen(params)) player1 = playerid;
    else player1 = strval(params);
    format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(PlayerName2(player1)));
    if(strlen(dini_Get(file,"RegisteredDate")) < 3) RegDate = "n/a"; else RegDate = dini_Get(file,"RegisteredDate");
    if(PlayerInfo[player1][LoggedIn] == 1) P1Logged = "Yes"; else P1Logged = "No";
    if(fexist(file)) P1Register = "Yes"; else P1Register = "No";
	if(IsPlayerConnected(player1)) {
   	    new year,month,day;	getdate(year, month, day);
		TotalGameTime(player1, h, m, s);
        if(PlayerInfo[player1][Deaths] == 0) pDeaths = 1; else pDeaths = PlayerInfo[player1][Deaths];
        format(sL, sizeof(sL), ""O"===========================================");
        format(sA, sizeof(sA), ""O"Player Money: "V"["R"$"L"%d"V"]\n"O"Player Score: "V"["L"%d"V"]\n"O"Player Skin: "V"["L"%d"V"]",GetPlayerMoney(player1),GetPlayerScore(player1),GetPlayerSkin(player1));
        format(sD, sizeof(sD), ""O"Warnings: "V"["L"%d"V"]\n"O"Register Date: "V"["L"%s"V"]\n"O"Register: "V"["L"%s"V"]\n"O"Login: "V"["L"%s"V"]\n"O"Coins("R"Monede"O"): "V"["L"%d"V"]",PlayerInfo[player1][Warnings],RegDate,P1Register,P1Logged,pInfo[playerid][Coins]);
		format(sI, sizeof(sI), ""O"Rank: "V"["L"%d"V"] "V"("R"%s"V")\n"O"Admin Level: "V"["L"%d"V"]\n"O"Vip Level: "V"["L"%d"V"]",rankid,rank,PlayerInfo[player1][Level],PlayerInfo[player1][Vip]);
        format(sM, sizeof(sM), ""O"Player Kills: "V"["L"%d"V"]\n"O"Player Deaths: "V"["L"%d"V"]\n"O"Player Ratio: "V"["L"%0.2f"V"]",PlayerInfo[player1][Kills],PlayerInfo[player1][Deaths],Float:PlayerInfo[player1][Kills]/Float:pDeaths);
		format(sS, sizeof(sS), ""O"Player Time: "O"hrs"V"["L"%d"V"] "O"mins"V"["L"%d"V"] "O"secs"V"["L"%d"V"]",h,m,s);
		format(string, sizeof(string),"%s\n\t"G"Date:"L"%d"G"*"L"%d"G"*"L"%d  "V"["G"%s"V"]"R"'s Stats\n%s\n%s\n%s\n%s\n%s\n%s\n%s",sL,year,month,day,PlayerName2(player1),sL,sM,sA,sS,sI,sD,sL);
        return ShowPlayerDialog(playerid, 9999, 0, "Player Stats", string, "Ok", "");
    } else return SendClientMessage(playerid, red, "Player Not Connected!");
}
#endif
#endif
LoginPlayer(playerid)
{
	if(ServerInfo[GiveMoney] == 1) {ResetPlayerMoney(playerid); GivePlayerMoney(playerid, dUserINT(PlayerName2(playerid)).("money") ); }
	dUserSetINT(PlayerName2(playerid)).("loggedin",1);
	PlayerInfo[playerid][Deaths] = (dUserINT(PlayerName2(playerid)).("deaths"));
	PlayerInfo[playerid][Kills] = (dUserINT(PlayerName2(playerid)).("kills"));
 	PlayerInfo[playerid][Level] = (dUserINT(PlayerName2(playerid)).("level"));
 	PlayerInfo[playerid][Vip] = (dUserINT(PlayerName2(playerid)).("vip"));
   	PlayerInfo[playerid][hours] = dUserINT(PlayerName2(playerid)).("hours");
   	PlayerInfo[playerid][mins] = dUserINT(PlayerName2(playerid)).("minutes");
   	PlayerInfo[playerid][secs] = dUserINT(PlayerName2(playerid)).("seconds");
	PlayerInfo[playerid][Registered] = 1;
 	PlayerInfo[playerid][LoggedIn] = 1;
}
Reply
#2

Do you have this on OnPlayerCommandText?
pawn Код:
dcmd(stats,5,cmdtext);
Reply
#3

it's Dcmd and he have
pawn Код:
dcmd_stats(playerid,params[])
PS: Never used dcmd
Reply
#4

Quote:
Originally Posted by Cjgogo
Посмотреть сообщение
Do you have this on OnPlayerCommandText?
pawn Код:
dcmd(stats,5,cmdtext);
With it, without it, it's the same thing..
Reply
#5

Nvm,the tutorial specifies you have to add that,but nvm...
Reply
#6

Somebody knows?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)