Ranks and Tiers -
ThaCrypte - 20.04.2013
Alright.
When i do /makeleader , the leader gets invited into the faction and he will get tier 2 (highest), on stats it says: Faction rank: [] Faction tier: [2]
when he does /setrank he can edit his rank name, for example Hi
After that this happens:
Faction rank: [Hi] Faction tier: [ ]
Both of the CMD's:
(settier and setrank)
Код:
CMD:settier(playerid, params[])
{
new playerb, tier, string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!PlayerInfo[playerid][pFacLeader]) return SendClientMessage(playerid, COLOR_GREY, "You are not a faction leader.");
if(sscanf(params, "ui", playerb, tier)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /settier [playerid] [tier]");
if(playerid == playerb) return SendClientMessage(playerid, COLOR_GREY, "You can't change your tier.");
if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
if(PlayerInfo[playerb][pFac] != PlayerInfo[playerid][pFac]) return SendClientMessage(playerid, COLOR_GREY, "Player is not in your faction.");
if(tier < 0 || tier > 2) return SendClientMessage(playerid, COLOR_GREY, "Tiers are between 0 and 2.");
if(PlayerInfo[playerb][pFacTier] == tier) return SendClientMessage(playerid, COLOR_GREY, "Player already has that tier.");
if(PlayerInfo[playerb][pFacTier] < tier)
{
PlayerInfo[playerb][pFacTier] = tier;
format(string, sizeof(string), "You have {33AA33}promoted {33CCFF}%s to tier:{33AA33}%s (%d){33CCFF}.", RPN(playerb), RPFACTIER(playerb), tier);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "%s has {33AA33}promoted {33CCFF}you to tier:{33AA33}%s (%d){33CCFF}.", RPN(playerid), RPFACTIER(playerb), tier);
SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
}
else if(PlayerInfo[playerb][pFacTier] > tier)
{
PlayerInfo[playerb][pFacTier] = tier;
format(string, sizeof(string), "You have {FF9900}demoted {33CCFF}%s to tier:{FF9900}%s (%d){33CCFF}.", RPN(playerb), RPFACTIER(playerb), tier);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "%s has {FF9900}demoted {33CCFF}you to tier:{FF9900}%s (%d){33CCFF}.", RPN(playerid), RPFACTIER(playerb), tier);
SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
}
return 1;
}
CMD:setrank(playerid, params[])
{
new name[32], playerb, string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!PlayerInfo[playerid][pFacLeader]) return SendClientMessage(playerid, COLOR_GREY, "You are not a faction leader.");
if(sscanf(params, "is[32]", playerb, name)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /adjustrankname [player] [name]");
{
format(PlayerInfo[playerb][pFRank], 32,"%s", params);
format(string, sizeof(string), "You have editted the rankname to %s", name);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
return 1;
}
Re: Ranks and Tiers -
denNorske - 20.04.2013
Your problem is that the tier number disappears when doing setrank ? (need to know if i got it correctly)
Re: Ranks and Tiers -
ThaCrypte - 20.04.2013
Yes, tier number dissapear
Re: Ranks and Tiers -
denNorske - 20.04.2013
Quote:
Originally Posted by ThaCrypte
Yes, tier number dissapear
|
Provide the code that applies this "name" to the player. Should be something "SetName" in your script, because there is nothing wrong about that in your current code.
Re: Ranks and Tiers -
zxc1 - 20.04.2013
Show us the /stats command.
Re: Ranks and Tiers -
ThaCrypte - 20.04.2013
Sorry for the late response, here you will have the Showstats:
Код:
stock ShowStats(playerid, playerb)
{
new string[256], gender[8], Float:H, Float:A;
// Gender
if(PlayerInfo[playerb][pGender] == 1) format(gender, sizeof(gender), "Male");
else if(PlayerInfo[playerb][pGender] == 2) format(gender, sizeof(gender), "Female");
// Health and Armor
GetPlayerHealth(playerb, H); GetPlayerArmour(playerb, A);
// Total Wealth
//new idx = PlayerInfo[playerb][pHouse];
//new idx2 = PlayerInfo[playerb][pBiz];
//new TotalWealth = PlayerInfo[playerb][pMoney]+PlayerInfo[playerb][pBank]+HouseInfo[idx][hMoney]+BizInfo[idx2][bMoney];
// Loyal
new loyal[4];
if(!PlayerInfo[playerb][pLoyal]) format(loyal, sizeof(loyal), "Yes");
if(PlayerInfo[playerb][pLoyal]) format(loyal, sizeof(loyal), "No");
// Oldskool
new oldskool[4];
if(PlayerInfo[playerid][pHours] >= 248) format(oldskool, sizeof(oldskool), "Yes");
else if(PlayerInfo[playerid][pHours] < 248) format(oldskool, sizeof(oldskool), "No");
//fac-fam rank
new rank[128];
if(PlayerInfo[playerb][pFac] >= 1) format(rank, sizeof(rank), "%s", RPFRN(playerb));
else format(rank, sizeof(rank), "None");
//fac tier
new tier[128];
if(PlayerInfo[playerb][pFac] >= 1) format(tier, sizeof(tier), "%s", RPFACTIER(playerb));
else format(tier, sizeof(tier), "None");
//fac-fam
new org[128];
if(PlayerInfo[playerb][pFac] >= 1) format(org, sizeof(org), "%s", RPFNEx(playerb));
else format(org, sizeof(org), "None");
//
new rank2[128];
if(PlayerInfo[playerb][pFam] >=1) format(rank2, sizeof(rank2), "%s", RPFaRN(playerb));
else format(rank2, sizeof(rank2), "None");
//fac-fam
new org2[128];
if(PlayerInfo[playerb][pFam] >=1) format(org2, sizeof(org2), "%s", RPFaN(playerb));
else format(org2, sizeof(org2), "None");
new exp = PlayerInfo[playerb][pExp];
new nxtlevel = PlayerInfo[playerb][pLevel]+1;
new expamount = nxtlevel*4;
new costlevel = nxtlevel*4000;//10k for testing purposes
/*//respect
new respectneed[4];
if(PlayerInfo[playerb][pLevel] == 1) format(respectneed, sizeof(respectneed), "4");
else if(PlayerInfo[playerb][pLevel] == 2) format(respectneed, sizeof(respectneed), "10");
else if(PlayerInfo[playerb][pLevel] == 3) format(respectneed, sizeof(respectneed), "18");
else if(PlayerInfo[playerb][pLevel] == 4) format(respectneed, sizeof(respectneed), "30");
else if(PlayerInfo[playerb][pLevel] == 5) format(respectneed, sizeof(respectneed), "42");
else if(PlayerInfo[playerb][pLevel] == 6) format(respectneed, sizeof(respectneed), "54");
else if(PlayerInfo[playerb][pLevel] == 7) format(respectneed, sizeof(respectneed), "70");
else if(PlayerInfo[playerb][pLevel] == 8) format(respectneed, sizeof(respectneed), "88");
else if(PlayerInfo[playerb][pLevel] == 9) format(respectneed, sizeof(respectneed), "108");
else if(PlayerInfo[playerb][pLevel] == 10) format(respectneed, sizeof(respectneed), "130");
else if(PlayerInfo[playerb][pLevel] == 11) format(respectneed, sizeof(respectneed), "154");
else if(PlayerInfo[playerb][pLevel] == 12) format(respectneed, sizeof(respectneed), "180");
else if(PlayerInfo[playerb][pLevel] == 13) format(respectneed, sizeof(respectneed), "208");
else if(PlayerInfo[playerb][pLevel] == 14) format(respectneed, sizeof(respectneed), "238");
else if(PlayerInfo[playerb][pLevel] == 15) format(respectneed, sizeof(respectneed), "270");
else if(PlayerInfo[playerb][pLevel] == 16) format(respectneed, sizeof(respectneed), "304");
else if(PlayerInfo[playerb][pLevel] == 17) format(respectneed, sizeof(respectneed), "340");
else if(PlayerInfo[playerb][pLevel] == 18) format(respectneed, sizeof(respectneed), "378");
else if(PlayerInfo[playerb][pLevel] == 19) format(respectneed, sizeof(respectneed), "418");
else if(PlayerInfo[playerb][pLevel] == 20) format(respectneed, sizeof(respectneed), "460");
else if(PlayerInfo[playerb][pLevel] == 21) format(respectneed, sizeof(respectneed), "504");
else if(PlayerInfo[playerb][pLevel] == 22) format(respectneed, sizeof(respectneed), "550");
else if(PlayerInfo[playerb][pLevel] == 23) format(respectneed, sizeof(respectneed), "598");
else if(PlayerInfo[playerb][pLevel] == 24) format(respectneed, sizeof(respectneed), "648");
else if(PlayerInfo[playerb][pLevel] == 25) format(respectneed, sizeof(respectneed), "700");
else if(PlayerInfo[playerb][pLevel] == 26) format(respectneed, sizeof(respectneed), "754");
else if(PlayerInfo[playerb][pLevel] == 27) format(respectneed, sizeof(respectneed), "810");
else if(PlayerInfo[playerb][pLevel] == 28) format(respectneed, sizeof(respectneed), "868");
else if(PlayerInfo[playerb][pLevel] == 29) format(respectneed, sizeof(respectneed), "928");*/
//new average = (PlayerInfo[playerb][pTMinutes] / PlayerInfo[playerb][pDay]);
// Stats
format(string, sizeof(string), " Statistics of %s", RPN(playerb));
SendClientMessage(playerid, COLOR_ORANGE, string);
format(string, sizeof(string), "Level: [%d] - Gender: [%s] - Age: [%d] - Money: [$%d] - Bank: [$%d] - Health: [%0.1f] - Armor: [%0.1f]", PlayerInfo[playerb][pLevel], gender, PlayerInfo[playerb][pAge], PlayerInfo[playerb][pMoney], PlayerInfo[playerb][pBank], H, A);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "Phone Number: [%d] - Playing Hours: [%d] Next Level: [%d/%d] - Next Level Cost: [$%d] - Respect Points: [%d]", PlayerInfo[playerb][pNumber], PlayerInfo[playerb][pHours], exp, expamount, costlevel, PlayerInfo[playerb][pExp]);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "Occupation: [%s] - Wanted Level: [%d] - Crimes Committed: [%d] - Arrested: [%dx] - Kill: [%d] - Death: [%d]", RPJN(playerb), PlayerInfo[playerb][pWanted], PlayerInfo[playerb][pCrimes], PlayerInfo[playerb][pArrested], PlayerInfo[playerb][pKill], PlayerInfo[playerb][pDeath]);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "Faction: [%s] - Faction Rank: [%s] Faction Tier: [%s]- Family: [%s] - Family Rank: [%s]", org, rank, tier, org2, rank2);
SendClientMessage(playerid, COLOR_RADIO, string);
format(string, sizeof(string), "Business: [%s] - House: [%s] & [%s] - Garage: [%s] - Vehicles: 1[%s (ID:%d) - 2[%s (ID:%d) - 3[%s (ID:%d)]", RBT(PlayerInfo[playerb][pBiz]), RPHK(playerb), RPVIPHL(playerb), RPGK(playerb), RVN(GetVehicleModel(PlayerInfo[playerb][pVeh])), PlayerInfo[playerb][pVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVeh])), PlayerInfo[playerb][pVVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVVeh])), PlayerInfo[playerb][pVVVeh]);
SendClientMessage(playerid, COLOR_RADIO, string);
SendClientMessage(playerid, COLOR_BLUE, " Type /inv to see you're inventory");
return 1;
}
And here is the RPFACTIER stock:
Код:
stock RPFACTIER(playerid)
{
new tier[32];
if(PlayerInfo[playerid][pFacTier] == 0 && PlayerInfo[playerid][pFac] == 0) format(tier, sizeof(tier), "None");
else if(PlayerInfo[playerid][pFac])
{
if(PlayerInfo[playerid][pFacTier] == 0 ) format(tier, sizeof(tier), "0");
else if(PlayerInfo[playerid][pFacTier] == 1 ) format(tier, sizeof(tier), "1");
else if(PlayerInfo[playerid][pFacTier] == 2 ) format(tier, sizeof(tier), "2");
}
return tier;
}
This is the stock for Ranks:
Код:
stock RPFRN(playerid)
{
new rankname[32];
if(PlayerInfo[playerid][pFac] == 0) format(rankname, sizeof(rankname), "Civilian");
else if(PlayerInfo[playerid][pFac])
{
format(rankname, sizeof(rankname), "%s", PlayerInfo[playerid][pFRank]);
}
return rankname;
}
Re: Ranks and Tiers -
ThaCrypte - 21.04.2013
I also forgot to tell, that when you do /setrank [playerid (example:0] Rank , it says: Faction rank: [0 Rank]
Or : /setrank [playerid (example:1] Rank , it says: Faction rank: [1 Rank]
Re: Ranks and Tiers -
ThaCrypte - 22.04.2013
still need help!
Re: Ranks and Tiers -
ThaCrypte - 23.04.2013
......