20.11.2011, 13:06
If i type /stats the Auto: is None, but i own a car.
Saving Methid: MySQL
Auto=Car
Pic:
Saving Methid: MySQL
Auto=Car
Pic:
CMD:stats(playerid, params[]) {
return cmd_statistics(playerid, params);
}
CMD:statistics(playerid, params[]) {
return showStats(playerid,playerid);
}
stock showStats(playerid, targetid) {
new
param1[32],
date[3],
param2[32],
param4[32],
param3[32]; // I'll add one or two more of these later, they'll be used to show things like sex (if sex = whatever, param1 = "Male";). And we can use them over and over again.
SendClientMessage(playerid, COLOR_TEAL, "--------------------------------------------------------------------------------------------------------------------------------");
getdate(date[0], date[1], date[2]);
if(playerVariables[targetid][pJob] == 0) { param1 = "Unemployed"; }
else { strcpy(param1, jobVariables[playerVariables[targetid][pJob]][jJobName], sizeof(param1)); } // dest, source, length format(param1, sizeof(param1),"%s",jobVariables[playerVariables[targetid][pJob]][jJobName]); }
switch(playerVariables[targetid][pGender]) { //{ param2 = "Male"; } else { param2 = "Female"; }
case 1: param2 = "Mees";
case 2: param2 = "Naine";
default: param2 = "Teadmata";
}
if(playerVariables[targetid][pPhoneNumber] != -1) { format(param3,sizeof(param3),"%d",playerVariables[targetid][pPhoneNumber]); }
else { param3 = "Pole"; }
format(szMessage, sizeof(szMessage), "%s | Vanus: %d (Sьndinud %d) | Sugu: %s | Mдngutunde: %d | Telefoni number: %s | Tцц: %s", playerVariables[targetid][pNormalName], date[0]-playerVariables[targetid][pAge], playerVariables[targetid][pAge], param2, playerVariables[targetid][pPlayingHours], param3, param1, param4);
SendClientMessage(playerid, COLOR_WHITE, szMessage);
if(playerVariables[targetid][pGroup] < 1) {
param1 = "Pole";
param2 = "Pole";
}
else {
strcpy(param1, groupVariables[playerVariables[targetid][pGroup]][gGroupName], sizeof(param1));
switch(playerVariables[targetid][pGroupRank]) { // strcpy(dest, source, length);
case 1: strcpy(param2, groupVariables[playerVariables[targetid][pGroup]][gGroupRankName1], sizeof(param2));
case 2: strcpy(param2, groupVariables[playerVariables[targetid][pGroup]][gGroupRankName2], sizeof(param2));
case 3: strcpy(param2, groupVariables[playerVariables[targetid][pGroup]][gGroupRankName3], sizeof(param2));
case 4: strcpy(param2, groupVariables[playerVariables[targetid][pGroup]][gGroupRankName4], sizeof(param2));
case 5: strcpy(param2, groupVariables[playerVariables[targetid][pGroup]][gGroupRankName5], sizeof(param2));
case 6: strcpy(param2, groupVariables[playerVariables[targetid][pGroup]][gGroupRankName6], sizeof(param2));
}
}
if(playerVariables[targetid][pWalkieTalkie] == -1) param3 = "None";
else if(playerVariables[targetid][pWalkieTalkie] == 0) param3 = "Disabled";
else format(param3, sizeof(param3), "#%d khz", playerVariables[targetid][pWalkieTalkie]);
format(szMessage, sizeof(szMessage), "Grupp: %s | Rank: %s (%d) | Pank: $%d | Kдes: $%d | Materjalid: %d | Raadio: %s", param1, param2, playerVariables[targetid][pGroupRank], playerVariables[targetid][pBankMoney], playerVariables[targetid][pMoney], playerVariables[targetid][pMaterials], param3);
SendClientMessage(playerid, COLOR_WHITE, szMessage);
format(szMessage, sizeof(szMessage), "Rope: %d | Relvaskill: %d (%d relvi) | Jдlitamis oskused: %d (%d otsingut) | Arreteerimisi: %d | Kuritegusid: %d | Krediit: $%d", playerVariables[targetid][pRope], playerVariables[targetid][pJobSkill][0]/50, playerVariables[targetid][pJobSkill][0], playerVariables[targetid][pJobSkill][1]/50, playerVariables[targetid][pJobSkill][1], playerVariables[targetid][pArrests], playerVariables[targetid][pCrimes], playerVariables[targetid][pPhoneCredit] / 60);
SendClientMessage(playerid, COLOR_WHITE, szMessage);
if(playerVariables[playerid][pAdminLevel] >= 1) {
new
Float:HAFloats[2],
country[MAX_COUNTRY_NAME];
GetPlayerHealth(targetid,HAFloats[0]);
GetPlayerArmour(targetid,HAFloats[1]);
GetCountryName(playerVariables[targetid][pConnectionIP], country, sizeof(country));
if(playerVariables[targetid][vOwner] >= 400) { format(param4, sizeof(param4), "%s (ID %d)", VehicleNames[playerVariables[targetid][vOwner] - 400], playerVariables[targetid][pCarID]); }
else { param4 = "None"; }
if(playerVariables[targetid][pStatus] != 1) param1 = "Unauthenticated"; else param1 = "Authenticated";
format(szMessage, sizeof(szMessage), "Staatus: %s | Admin Level: %d | Interior: %d | VW: %d | Maja: %d | Firma: %d | Auto: %s", param1, playerVariables[targetid][pAdminLevel], playerVariables[targetid][pInterior], playerVariables[targetid][pVirtualWorld], getPlayerHouseID(targetid), getPlayerBusinessID(targetid), param4), playerVariables[targetid][vOwner];
SendClientMessage(playerid, COLOR_WHITE, szMessage);
switch(playerVariables[targetid][pPrisonID]) {
case 0: format(szMessage, sizeof(szMessage), "IP: %s | Maakond: %s | Admin Nimi: %s | Elud: %.1f | Armor: %.1f", playerVariables[targetid][pConnectionIP], country, playerVariables[targetid][pAdminName], HAFloats[0], HAFloats[1]);
case 1: format(szMessage, sizeof(szMessage), "IP: %s | Maakond: %s | Admin Nimi: %s | Elud: %.1f | Armor: %.1f | Ajail aeg: %d", playerVariables[targetid][pConnectionIP], country, playerVariables[targetid][pAdminName], HAFloats[0], HAFloats[1], playerVariables[targetid][pPrisonTime]);
case 2: format(szMessage, sizeof(szMessage), "IP: %s | Maakond: %s | Admin Nimi: %s | Elud: %.1f | Armor: %.1f | Ajail aeg: %d", playerVariables[targetid][pConnectionIP], country, playerVariables[targetid][pAdminName], HAFloats[0], HAFloats[1], playerVariables[targetid][pPrisonTime]);
case 3: format(szMessage, sizeof(szMessage), "IP: %s | Maakond: %s | Admin Nimi: %s | Elud: %.1f | Armor: %.1f | Vangla aeg: %d", playerVariables[targetid][pConnectionIP], country, playerVariables[targetid][pAdminName], HAFloats[0], HAFloats[1], playerVariables[targetid][pPrisonTime]);
}
SendClientMessage(playerid, COLOR_WHITE, szMessage);
}
SendClientMessage(playerid, COLOR_TEAL, "--------------------------------------------------------------------------------------------------------------------------------");
return 1;
}