22.11.2009, 09:04
And Yes i searched the forum and found some thead but the cmd very buggy.
when i promote someone it says promoted to rank 77...i want to fix that but duno how
and to add Restriction that you cant raknup yourself and a higher rank..
(rank 6 Boss,5 Underboss,they can do this)
Thank you,hope you can help me
thx
Код:
//----------------------------------[RANKUP]------------------------------------------------
if(strcmp(cmd, "/rankup", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /rankup [id]");
return 1;
}
new para1;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(PlayerInfo[playerid][pLeader] >= 1)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pRank] += 1;
format(string, sizeof(string), " You have been promoted to a higher Rank by Leader %s", sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " You have given %s Rank %d.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "[Error] You are not allowed to use that command.");
}
}
return 1;
}
and to add Restriction that you cant raknup yourself and a higher rank..
(rank 6 Boss,5 Underboss,they can do this)
Thank you,hope you can help me

thx

