26.03.2016, 17:37
Hi,
would anyone know how should I make an /ocheck command in ZCMD? It will actually show player's statistics when he/she is offline. It'll work for an admin level 2+.
The /check command;
And the stock ShowStats
It's not hard, but I'd appreciate because I don't know how would I use stock ShowStats when a player is offline.
~Kevin
Thanks in advance.
P.S.: Saving system is Dini.
would anyone know how should I make an /ocheck command in ZCMD? It will actually show player's statistics when he/she is offline. It'll work for an admin level 2+.
The /check command;
Код:
IRP:check(playerid, var[]) { new user; if(!Logged(playerid)) return NoLogin(playerid); if(Player[playerid][pAdmin] >= 2 || Player[playerid][pStaffObserver]) { if(sscanf(var,"us[32]", user, var)) { SendClientMessage(playerid, COLOR_WHITE, "{00BFFF}Usage:{FFFFFF} /check [playerid] [checks]"); SendClientMessage(playerid, COLOR_GRAD2, "** [CHECKS]: stats"); return 1; } if(!strcmp(var, "stats", true)) { if(!Logged(user)) return NoLoginB(playerid); ShowStats(playerid, user); } } else { NoAuth(playerid); } return 1; }
Код:
stock ShowStats(playerid, user) { new string[256], gender[8], admin[15], famed[12], helper[12], vip[12], ogate1[8], ogate2[8], gate3[8], beta[12]; // Gender if(Player[user][pGender] == 1) format(gender, sizeof(gender), "Male"); else if(Player[user][pGender] == 2) format(gender, sizeof(gender), "Female"); // Helper if(Player[user][pHelper]) format(helper, sizeof(helper), "{00FF00}Yes"); else if(!Player[user][pHelper]) format(helper, sizeof(helper), "{00FF00}No"); // Famed if(Player[user][pFamed]) format(famed, sizeof(famed), "{FF9900}Yes"); else if(!Player[user][pFamed]) format(famed, sizeof(famed), "{FF9900}No"); // VIP if(Player[user][pVIP]) format(vip, sizeof(vip), "{C93CCE}Yes"); else if(!Player[user][pVIP]) format(vip, sizeof(vip), "{C93CCE}No"); // Beta Tester if(Player[user][pTester]) format(beta, sizeof(beta), "{FFFF00}Yes"); else if(!Player[user][pTester]) format(beta, sizeof(beta), "{FFFF00}No"); // Admin if(Player[user][pAdmin]) format(admin, sizeof(admin), "{FFFF00}Yes"); else if(!Player[user][pAdmin]) format(admin, sizeof(admin), "{FFFF00}No"); // Gates if(Player[user][pGate][0]) format(ogate1, sizeof(ogate1), "Yes"); else if(!Player[user][pGate][0]) format(ogate1, sizeof(ogate1), "None"); if(Player[user][pGate][1]) format(ogate2, sizeof(ogate2), "Yes"); else if(!Player[user][pGate][1]) format(ogate2, sizeof(ogate2), "None"); if(Player[user][pGate][2]) format(gate3, sizeof(gate3), "Yes"); else if(!Player[user][pGate][2]) format(gate3, sizeof(gate3), "None"); // Respect points and next level new exp = Player[user][pExp]; new nxtlevel = Player[user][pLevel]+1; new expamount = nxtlevel*4; new costlevel = nxtlevel*2000; //Showing Stats format(string, sizeof(string), "[Account] {BFC0C2}Name: [%s] Level: [%d] Gender: [%s] Age: [%d] Respects: [%d/%d -(%d)]", GetName(user), Player[user][pLevel], gender, Player[user][pAge], exp, expamount, costlevel); SendClientMessage(playerid, COLOR_STATS, string); format(string, sizeof(string), "[Details] {BFC0C2}Money: [$%d] Bank: [$%d] Job: [%s] Phone No. [%s]", Player[user][pMoney], Player[user][pBank], RPJN(user), Player[user][pPhone], Player[user][pWTC]); SendClientMessage(playerid, COLOR_STATS, string); format(string, sizeof(string), "[Records] {BFC0C2}Wanted: [%d] Crimes: [%d] Arrested: [%dx]", Player[user][pWanted], Player[user][pCrimes], Player[user][pArrested]); SendClientMessage(playerid, COLOR_STATS, string); format(string, sizeof(string), "[Affiliation] {BFC0C2}Faction: [%s] Rank: [%s] Division: [%s] || Family: [%s] Rank: [%s]", RPFN(user), RPFRN(user), RPFDN(user), RPFaN(user), RPFaRN(user)); SendClientMessage(playerid, COLOR_STATS, string); format(string, sizeof(string), "[Status] {BFC0C2}Admin: [%s{FFFFFF}] Helper: [%s{FFFFFF}] Famed: [%s{FFFFFF}] VIP: [%s{FFFFFF}] Beta Tester: [%s{FFFFFF}]", admin, helper, famed, vip, beta); SendClientMessage(playerid, COLOR_STATS, string); format(string, sizeof(string), "[Property] {BFC0C2}Gate 1: [%s] Gate 2: [%s] Gate 3: [%s] Garage: 1[%s - (ID:%s)] - 2[%s - (ID:%s)]", ogate1, ogate2, gate3, GT(Player[user][pGarage]), RPGK(user), GT(Player[user][pVGarage]), RPVIPGK(user)); SendClientMessage(playerid, COLOR_STATS, string); format(string, sizeof(string), "[Property] {BFC0C2}Vehicles: 1[%s (ID:%d)] - 2[%s (ID:%d)] - 3[%s (ID:%d)] - 4[%s (ID:%d)]", RVN(GetVehicleModel(Player[user][pVeh])), Player[user][pVeh], RVN(GetVehicleModel(Player[user][pVVeh])), Player[user][pVVeh], RVN(GetVehicleModel(Player[user][pVVVeh])), Player[user][pVVVeh], RVN(GetVehicleModel(Player[user][pVVVVeh])), Player[user][pVVVVeh]); SendClientMessage(playerid, COLOR_STATS, string); format(string, sizeof(string), "[Property] {BFC0C2}Business: 1[%s (ID:%s)] - 2[%s (ID:%s)] House: 1[%s (ID:%s)] - 2[%s (ID:%s)]", RBT(Player[user][pBiz]), RPBK(user), RBT(Player[user][pVBiz]), RPVIPBK(user), HT(Player[user][pHouse]), RPHK(user), HT(Player[user][pVHouse]), RPVIPHK(user)); SendClientMessage(playerid, COLOR_STATS, string); format(string, sizeof(string), "[Items] {BFC0C2}Weed:[%d] Seed: [%d] Cocaine:[%d] Cigars:[%d] Sprunk:[%d] Spraycan:[%d]", Player[user][pWeed], Player[user][pSeeds], Player[user][pCocaine], Player[user][pCigar], Player[user][pSprunk], Player[user][pSpray]); SendClientMessage(playerid, COLOR_STATS, string); format(string, sizeof(string), "[Items] {BFC0C2}Cookies: [%d] Low-Materials: [%d] Medium-Materials: [%d] High-Materials: [%d]", Player[user][pCookie], Player[user][pLMaterials], Player[user][pMMaterials], Player[user][pHMaterials]); SendClientMessage(playerid, COLOR_STATS, string); format(string, sizeof(string), "[Items] {BFC0C2}Gas Can:[%d litres] Ropes:[%d] Blindfolds:[%d]", Player[user][pGas], Player[user][pRope], Player[user][pBlindfold]); SendClientMessage(playerid, COLOR_STATS, string); return 1; }
~Kevin
Thanks in advance.
P.S.: Saving system is Dini.