Код:
CMD:ostats(playerid,params[])
{
if(PlayerInfo[playerid][aLevel] >= 3) {
new nameaa[32];
if(isnull(params, "s", nameaa)) return SendClientMessage(playerid, red, "USAGE: /ostats [playername]");
new playerFile[100];
format(playerFile,256,"/ladmin/users/%s.ini",udb_encode(nameaa));
if(fexist(playerFile))
{
new string[500];
new house[50];
new houseID = dini_Int(playerFile, "Houseid");
new houseCost = dini_Int(house, "Cost");
new houseCostStr[10];
new houseIDStr[6];
switch(houseID)
{
case -255:
{
houseIDStr = "N/A";
houseCostStr = "N/A";
}
case 255:
{
format(houseIDStr, 6 ,"%d", houseID);
format(houseCostStr, 10, "%d", houseCost);
}
}
new bizID = dini_Int(playerFile, "bowned");
new bizCost = dini_Int(house, "Cost");
new bizCostStr[10];
new bizIDStr[6];
switch(bizID)
{
case 0, -255:
{
bizIDStr = "N/A";
bizCostStr = "N/A";
}
case 255:
{
format(bizIDStr, 6,"%d", bizID);
format(bizCostStr, 10, "%d", bizCost);
}
}
format(house,50,"SATDM/Houses/house%d",dini_Int(playerFile, "Houseid"));
format(string,sizeof(string),"|- Account Details -|\n\n {FFFFFF}Name: %s\nLast IP: %s\nRegistration Date: %s\nLast Time Online: %s\n\n|- User Statistics -|\n\nKills: %d ||Deaths: %d\nAdmin Level: %d ||Weed: %d\nCash: %d || Bank: %d\n\n|- House & Business -|\n\nHouse ID: %d || Cost: %d\nBusiness ID: %d || Cost %d\n\n|- Vehicles -|\n\nSlot 1: %s\nSlot 2: %s\nSlot 3: %s\nSlot 4: %s\nSlot 5: %s\nSlot 6: %s\nSlot 7: %s\nSlot 8: %s",
nameaa,dini_Get(playerFile, "ip"),dini_Get(playerFile, "RegisteredDate"), dini_Get(playerFile, "LastOn"),dini_Int(playerFile, "kills"), dini_Int(playerFile, "deaths"), dini_Int(playerFile, "level"),dini_Int(playerFile,"weed"), dini_Int(playerFile, "money"), dini_Int(playerFile, "Bank"),houseIDStr,houseCostStr, bizIDStr, bizCostStr),
dini_Int(playerFile, "vowned"),dini_Int(playerFile, "vowned2"),dini_Int(playerFile, "vowned3"),dini_Int(playerFile, "vowned4"),dini_Int(playerFile, "vowned5"),dini_Int(playerFile, "vowned6"),dini_Int(playerFile, "vowned7"),dini_Int(playerFile, "vowned8");
ShowPlayerDialog(playerid,197,DIALOG_STYLE_MSGBOX, "{FFFF00}Offline Stats", string, "Ok", "");
} else return SendClientMessage(playerid, red, "That player doesn't exist!");
} else return SendClientMessage(playerid, red, "ERROR: You are not a high enough level to use this command");
return 1;
}
when i do /ostats name it says that player doesnt exist.. even the player is registered