Код:
YCMD:stats(playerid, params[], help) {
if(help) {
SendClientMessage(playerid, X11_WHITE, "Sends a player their game stats");
return 1;
}
SendStats(playerid,playerid);
return 1;
}
YCMD:smoke(playerid, params[], help) {
new string[128];
if(help) {
SendClientMessage(playerid, X11_WHITE, "Smokes a cigars");
return 1;
}
new numcigs = GetPVarInt(playerid, "Cigars");
if(numcigs == 0) {
SendClientMessage(playerid, X11_TOMATO_2, "You don't have enough smokes!");
return 0;
}
if(IsPlayerBlocked(playerid)) { //anim bug abuse "fix"
SendClientMessage(playerid, X11_TOMATO_2, "You cannot do this right now!");
return 1;
}
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY);
SendClientMessage(playerid, COLOR_LIGHTGREEN,"* Smoke used!");
format(string, sizeof(string), "* %s gets out a smoke and lights it.", GetPlayerNameEx(playerid,ENameType_RPName));
ProxMessage(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPVarInt(playerid, "Cigars", --numcigs);
return 1;
}
isBankInNegative(playerid) {
new bankamount = GetPVarInt(playerid,"Bank");
if(bankamount < 0) {
return 1;
}
return 0;
}
doBankSettlement(playerid) {
if(isBankInNegative(playerid) == 1) {
if(GetPVarInt(playerid,"Money") > 0) {
new string[128];
new bank, money, topay;
money = GetPVarInt(playerid,"Money");
bank = GetPVarInt(playerid, "Bank");
if(money >= bank) {
topay = bank;
} else {
topay = bank/2;
}
format(string, sizeof(string), " Bank Debt Payment + Fees: ($%s)", getNumberString(topay));
SendClientMessage(playerid, COLOR_GREEN, string);
GiveMoneyEx(playerid, topay);
SetPVarInt(playerid, "Bank", bank-topay);
}
}
return 1;
}
SendStats(playerid,targetid) {
new msg[128];
format(msg,sizeof(msg),"*___________ %s __________*",GetPlayerNameEx(targetid,ENameType_CharName));
SendClientMessage(playerid, COLOR_GREENISHGOLD, msg);
new spousename[MAX_PLAYER_NAME+1];
GetPVarString(targetid, "SpouseName", spousename, sizeof(spousename));
format(msg,sizeof(msg),"Level:[%s] Sex:[%s] Cash:[$%s] Bank:[$%s] Spouse:[%s]",getNumberString(GetPVarInt(targetid,"Level")),GetSexName(GetPVarInt(targetid,"Sex")),getNumberString(GetPVarInt(targetid,"Money")),getNumberString(GetPVarInt(targetid,"Bank")),spousename);
SendClientMessage(playerid, X11_ORANGE, msg);
format(msg,sizeof(msg),"DonateRank:[%s] Donate Points:[%s] Phone:[%d] LottoNr:[%d] Job:[%s] WTChan:[%d] FurnitureTokens:[%d]",GetDonateRank(GetPVarInt(targetid,"DonateRank")),getNumberString(GetPVarInt(targetid,"DonatePoints")),GetPVarInt(targetid,"PhoneNumber"),getPlayerLottoTicket(targetid),GetJobName(GetPVarInt(targetid,"Job")),GetPVarInt(targetid, "WTChannel"),GetPVarInt(targetid, "FurnitureTokens"));
SendClientMessage(playerid, X11_TOMATO_2, msg);
format(msg,sizeof(msg),"WantedLevel:[%d] TimesArrested:[%s] FightStyle:[%s]",GetPlayerWantedLevel(playerid),getNumberString(GetPVarInt(targetid,"TimesArrested")),GetFightStyle(GetPVarInt(targetid, "FightStyle")));
SendClientMessage(playerid, X11_YELLOW, msg);
new nextlevel = (GetPVarInt(targetid,"Level")+1);
new nextlevelcost = nextlevel*levelcost;
new expamount = nextlevel*levelexp;
format(msg,sizeof(msg),"NextLevel:[$%s] Respect:[%s/%s] SpecialItem:[%s] Hunger:[%d]",getNumberString(nextlevelcost),getNumberString(GetPVarInt(targetid,"RespectPoints")),getNumberString(expamount),GetPlayerCarryingItemName(targetid),GetHungerLevel(targetid));
SendClientMessage(playerid, COLOR_LIGHTGREEN, msg);
format(msg,sizeof(msg),"Cigars:[%s] LockPicks:[%s]",getNumberString(GetPVarInt(targetid, "Cigars")),getNumberString(GetPVarInt(targetid, "VehLockpicks")));
SendClientMessage(playerid, COLOR_LIGHTBLUE, msg);
format(msg,sizeof(msg),"Pot:[%s Gram] Coke:[%s Gram] Meth:[%s Gram]",getNumberString(GetPVarInt(targetid, "Pot")),getNumberString(GetPVarInt(targetid, "Coke")),getNumberString(GetPVarInt(targetid, "Meth")));
SendClientMessage(playerid, COLOR_LIGHTGREEN, msg);
format(msg,sizeof(msg),"Type A:[%s Packs] Type B:[%s Packs] Type C:[%s Packs]",getNumberString(GetPVarInt(targetid, "MatsA")),getNumberString(GetPVarInt(targetid, "MatsB")),getNumberString(GetPVarInt(targetid, "MatsC")));
SendClientMessage(playerid, COLOR_LIGHTRED, msg);
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),"Faction:[%s] Rank:[%s]",GetFactionName(fid),getFactionRankName(fid,GetPVarInt(targetid, "Rank")));
SendClientMessage(playerid, COLOR_LIGHTGREEN, msg);
} else if(fid != -1) {
format(msg,sizeof(msg),"Family:[%s] Rank:[%s]",GetFamilyName(fid),getRankName(fid,GetPVarInt(targetid, "Rank")));
SendClientMessage(playerid, COLOR_LIGHTGREEN, msg);
}
format(msg,sizeof(msg),"PlayingHours:[%s] NewbChat Rank:[%s] Cookies:[%s]",getNumberString(GetPVarInt(targetid,"ConnectTime")),GetNewbieName(targetid),getNumberString(GetPVarInt(targetid,"Cookies")));
SendClientMessage(playerid, COLOR_LIGHTGREEN, msg);
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),"MatAPacks:[%s] MatBPacks:[%s] MatCPacks:[%s]",getNumberString(matpacks[0]),getNumberString(matpacks[1]),getNumberString(matpacks[2]));
SendClientMessage(playerid, COLOR_LIGHTRED, msg);
}
if(drugpacks[0] != 0 || drugpacks[1] != 0 || drugpacks[2] != 0) {
format(msg,sizeof(msg),"PotSeeds:[%s] CokePlants:[%s] MethMaterials:[%s]",getNumberString(drugpacks[0]),getNumberString(drugpacks[1]),getNumberString(drugpacks[2]));
SendClientMessage(playerid, COLOR_LIGHTRED, msg);
}
new jailtime = GetPVarInt(targetid, "ReleaseTime");
new isajail;
if(jailtime == 0) {
jailtime = GetPVarInt(targetid, "AJailReleaseTime");
isajail = 1;
}
jailtime -= gettime();
if(jailtime > 0) {
format(msg, sizeof(msg), "Jail Time Left: %s sec", getNumberString(jailtime));
SendClientMessage(playerid, isajail?COLOR_LIGHTRED:COLOR_LIGHTGREEN, msg);
}
if(EAdminFlags:GetPVarInt(playerid, "AdminFlags") != EAdminFlags_None) {
format(msg, sizeof(msg), "NumAJails:[%s] NumKicks:[%s] NumBans[%s] Wealth:[%s]",getNumberString(GetPVarInt(targetid, "NumAJAils")),getNumberString(GetPVarInt(targetid, "NumKicks")), getNumberString(GetPVarInt(targetid, "NumBans")),getNumberString(getTotalWealth(targetid)));
SendClientMessage(playerid, COLOR_LIGHTRED, msg);
}
SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
}
_____________________________
Hi, I'm TrentyK, this is my /stats CMD, could you give me the code, but with dialog? please help me, i will +rep you.