PHP Code:
SendStats(playerid,targetid) {
new msg[508];
query[0] = 0;
new name[250];
if(GetPVarInt(targetid, "DonateRank") < 1)
{
format(name,sizeof(name)," {FF0000}%s",GetPlayerNameEx(targetid,ENameType_CharName));
}
if(GetPVarInt(targetid, "DonateRank") > 0 && GetPVarInt(playerid, "DonateRank") < 4)
{
format(name,sizeof(name)," {FFFF00}%s",GetPlayerNameEx(targetid,ENameType_CharName));
}
if(GetPVarInt(targetid, "DonateRank") == 4)
{
format(name,sizeof(name)," {FF33FF}%s",GetPlayerNameEx(targetid,ENameType_CharName));
}
//SendClientMessage(playerid, COLOR_WHITE, msg);
new spousename[MAX_PLAYER_NAME+1];
GetPVarString(targetid, "SpouseName", spousename, sizeof(spousename));
format(msg,sizeof(msg),"{FFFFFF}Level:[%s] Sex:[%s] Cash:[$%s] Bank:[$%s] Spouse:[%s]\n",getNumberString(GetPVarInt(targetid,"Level")),GetSexName(GetPVarInt(targetid,"Sex")),getNumberString(GetPVarInt(targetid,"Money")),getNumberString(GetPVarInt(targetid,"Bank")),spousename);
//SendClientMessage(playerid, COLOR_WHITE, msg);
strcat(query, msg, sizeof(query));
if(GetPVarInt(targetid, "DonateRank") < 1)
{
format(msg,sizeof(msg),"{FFFFFF}DonateRank:[%s] Donate Points:[%s] Phone:[%d] LottoNr:[%d] Job:[%s]\n",GetDonateRank(GetPVarInt(targetid,"DonateRank")),getNumberString(GetPVarInt(targetid,"DonatePoints")),GetPVarInt(targetid,"PhoneNumber"),getPlayerLottoTicket(targetid),GetJobName(GetPVarInt(targetid,"Job")));
}
if(GetPVarInt(targetid, "DonateRank") > 0 && GetPVarInt(playerid, "DonateRank") < 4)
{
format(msg,sizeof(msg),"{FFFFFF}DonateRank:[{FFFF00}%s{FFFFFF}] Donate Points:[{FFFF00}%s{FFFFFF}] Phone:[%d] LottoNr:[%d] Job:[%s]\n",GetDonateRank(GetPVarInt(targetid,"DonateRank")),getNumberString(GetPVarInt(targetid,"DonatePoints")),GetPVarInt(targetid,"PhoneNumber"),getPlayerLottoTicket(targetid),GetJobName(GetPVarInt(targetid,"Job")));
}
if(GetPVarInt(targetid, "DonateRank") == 4)
{
format(msg,sizeof(msg),"{FFFFFF}DonateRank:[{FF33FF}%s{FFFFFF}] Donate Points:[{FF33FF}%s{FFFFFF}] Phone:[%d] LottoNr:[%d] Job:[%s]\n",GetDonateRank(GetPVarInt(targetid,"DonateRank")),getNumberString(GetPVarInt(targetid,"DonatePoints")),GetPVarInt(targetid,"PhoneNumber"),getPlayerLottoTicket(targetid),GetJobName(GetPVarInt(targetid,"Job")));
}
//SendClientMessage(playerid, COLOR_WHITE, msg);
strcat(query, msg, sizeof(query));
format(msg,sizeof(msg),"{FFFFFF}WantedLevel:[%d] TimesArrested:[%s] FightStyle:[%s]\n",GetPlayerWantedLevel(playerid),getNumberString(GetPVarInt(targetid,"TimesArrested")),GetFightStyle(GetPVarInt(targetid, "FightStyle")));
//SendClientMessage(playerid, COLOR_WHITE, msg);
strcat(query, msg, sizeof(query));
new nextlevel = (GetPVarInt(targetid,"Level")+1);
new expamount = nextlevel*levelexp;
format(msg,sizeof(msg),"Respect:[%s/%s] SpecialItem:[%s] Hunger:[%d]\n",getNumberString(GetPVarInt(targetid,"RespectPoints")),getNumberString(expamount),GetPlayerCarryingItemName(targetid),GetHungerLevel(targetid));
//SendClientMessage(playerid, COLOR_WHITE, msg);
strcat(query, msg, sizeof(query));
format(msg,sizeof(msg),"{FFFFFF}Cigars:[%s] LockPicks:[%s] FurnitureTokens:[%d] WTChan:[%d]\n",getNumberString(GetPVarInt(targetid, "Cigars")),getNumberString(GetPVarInt(targetid, "VehLockpicks")),GetPVarInt(targetid, "FurnitureTokens"),GetPVarInt(targetid, "WTChannel"));
//SendClientMessage(playerid, COLOR_WHITE, msg);
strcat(query, msg, sizeof(query));
format(msg,sizeof(msg),"{FFFFFF}Pot:[%s Gram] Coke:[%s Gram] Meth:[%s Gram]\n",getNumberString(GetPVarInt(targetid, "Pot")),getNumberString(GetPVarInt(targetid, "Coke")),getNumberString(GetPVarInt(targetid, "Meth")));
//SendClientMessage(playerid, COLOR_WHITE, msg);
strcat(query, msg, sizeof(query));
format(msg,sizeof(msg),"{FFFFFF}Type A:[%s Packs] Type B:[%s Packs] Type C:[%s Packs]\n",getNumberString(GetPVarInt(targetid, "MatsA")),getNumberString(GetPVarInt(targetid, "MatsB")),getNumberString(GetPVarInt(targetid, "MatsC")));
//SendClientMessage(playerid, COLOR_LIGHTRED, msg);
strcat(query, msg, sizeof(query));
new fid = GetPVarInt(targetid,"Family");
if(fid != 0) {
fid = FindFamilyBySQLID(fid);
} else fid = -1;
if(fid == -1 && GetPVarInt(targetid, "Faction") != 0) {
fid = GetPVarInt(targetid, "Faction");
format(msg,sizeof(msg),"{FFFFFF}Faction:[%s] Rank:[%s]\n",GetFactionName(fid),getFactionRankName(fid,GetPVarInt(targetid, "Rank")));
//SendClientMessage(playerid, COLOR_WHITE, msg);
strcat(query, msg, sizeof(query));
} else if(fid != -1) {
format(msg,sizeof(msg),"{FFFFFF}Family:[%s] Rank:[%s]\n",GetFamilyName(fid),getRankName(fid,GetPVarInt(targetid, "Rank")));
//SendClientMessage(playerid, COLOR_WHITE, msg);
strcat(query, msg, sizeof(query));
}
format(msg,sizeof(msg),"{FFFFFF}PlayingHours:[%s] NewbChat Rank:[%s] Cookies:[%s]\n",getNumberString(GetPVarInt(targetid,"ConnectTime")),GetNewbieName(targetid),getNumberString(GetPVarInt(targetid,"Cookies")));
//SendClientMessage(playerid, COLOR_WHITE, msg);
strcat(query, msg, sizeof(query));
new matpacks[3], drugpacks[3];
matpacks[0] = GetPVarInt(playerid, "MatAPacks");
matpacks[1] = GetPVarInt(playerid, "MatBPacks");
matpacks[2] = GetPVarInt(playerid, "MatCPacks");
drugpacks[0] = GetPVarInt(playerid, "PotSeeds");
drugpacks[1] = GetPVarInt(playerid, "CokePlants");
drugpacks[2] = GetPVarInt(playerid, "MethMaterials");
if(matpacks[0] != 0 || matpacks[1] != 0 || matpacks[2] != 0) {
format(msg,sizeof(msg),"{FFFFFF}MatAPacks:[%s] MatBPacks:[%s] MatCPacks:[%s]\n",getNumberString(matpacks[0]),getNumberString(matpacks[1]),getNumberString(matpacks[2]));
//SendClientMessage(playerid, COLOR_LIGHTRED, msg);
strcat(query, msg, sizeof(query));
}
if(drugpacks[0] != 0 || drugpacks[1] != 0 || drugpacks[2] != 0) {
format(msg,sizeof(msg),"{FFFFFF}PotSeeds:[%s] CokePlants:[%s] MethMaterials:[%s]\n",getNumberString(drugpacks[0]),getNumberString(drugpacks[1]),getNumberString(drugpacks[2]));
//SendClientMessage(playerid, COLOR_LIGHTRED, msg);
strcat(query, msg, sizeof(query));
}
new jailtime = GetPVarInt(targetid, "ReleaseTime");
if(jailtime == 0) {
jailtime = GetPVarInt(targetid, "AJailReleaseTime");
}
jailtime -= gettime();
if(jailtime > 0) {
format(msg, sizeof(msg), "{FFFFFF}Jail Time Left: %s sec\n", getNumberString(jailtime));
//SendClientMessage(playerid, isajail?COLOR_LIGHTRED:COLOR_WHITE, msg);
strcat(query, msg, sizeof(query));
}
if(EAdminFlags:GetPVarInt(playerid, "AdminFlags") != EAdminFlags_None) {
format(msg, sizeof(msg), "{FFFFFF}NumAJails:[%s] NumKicks:[%s] NumBans[%s] Wealth:[%s]\n",getNumberString(GetPVarInt(targetid, "NumAJAils")),getNumberString(GetPVarInt(targetid, "NumKicks")), getNumberString(GetPVarInt(targetid, "NumBans")),getNumberString(getTotalWealth(targetid)));
//SendClientMessage(playerid, COLOR_LIGHTRED, msg);
strcat(query, msg, sizeof(query));
}
ShowPlayerDialog(playerid, ERP_ViewStats, DIALOG_STYLE_MSGBOX, name,query,"Close", "");
//SendClientMessage(playerid, COLOR_WHITE,"_______________________________________");
}
Don't play smartass with me next time, I know what strcat is.