Originally Posted by Kush
Your 'scratch server':
PHP код:
if(strcmp(cmd, "/makeleader", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /makeleader [playerid/PartOfName] [Number(1-20)]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if(level >= SCRIPT_OPENFACTIONS || level < 0) { SendClientMessage(playerid, COLOR_GREY, " Dont go below number 0, or above!"); return 1; }
if (PlayerInfo[playerid][pAdmin] >= 4)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
GiveNameSpace(sendername);
GiveNameSpace(giveplayer);
PlayerInfo[para1][pMember] = level;
format(string, sizeof(string), " You have been promoted to Leader to your requested Faction by Admin %s", sendername);
SendClientMessage(para1, COLOR_WHITE, string);
format(string, sizeof(string), " You have given %s control to run Faction Number %d.", giveplayer,level);
SendClientMessage(playerid, COLOR_WHITE, string);
if(level == 0) { PlayerInfo[para1][pRank] = 0; gTeam[para1] = 3; PlayerInfo[para1][pTeam] = 0; return 1; }
else if(level == 1) { PlayerInfo[para1][pModel] = 288; } //Police Force
else if(level == 2) { PlayerInfo[para1][pModel] = 286; } //FBI/ATF
else if(level == 3) { PlayerInfo[para1][pModel] = 26; } // Goverment
else if(level == 4) { PlayerInfo[para1][pModel] = 228; } //Fire/Ambulance
else if(level >= 7) { PlayerInfo[para1][pModel] = FamilyInfo[level][FamilySkin6]; } // Open Faction
PlayerInfo[playerid][pFactionIden]=FamilyInfo[PlayerInfo[playerid][pMember]][FamilyIden]; //just to make sure its synced
if(level == 0)
{
gTeam[para1] = 3;
PlayerInfo[para1][pTeam] = 3;
}
else if(level == 1 || level == 2 || level == 3)
{
gTeam[para1] = 2;
PlayerInfo[para1][pTeam] = 2;
}
else if(level == 4)
{
gTeam[para1] = 1;
PlayerInfo[para1][pTeam] = 1;
}
else
{
gTeam[para1] = 15;
PlayerInfo[para1][pTeam] = 15;
}
SetPlayerSkinEx(para1, PlayerInfo[para1][pModel]);
if(level == 0)
{
PlayerInfo[para1][pRank] = 0;
}
else if(level == 1)
{
PlayerInfo[para1][pRank] = 16;
}
else if(level == 3)
{
PlayerInfo[para1][pRank] = 16;
}
else if(level >= 7)
{
PlayerInfo[para1][pRank] = 6;
SendClientMessage(para1,COLOR_WHITE,"[INFO]: Type /factionhelp to learn how to build your faction.");
}
else
{
PlayerInfo[para1][pRank] = 6;
}
}
}//not connected
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
}
}
return 1;
}
Raven's Roleplay:
PHP код:
if(strcmp(cmd, "/makeleader", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /makeleader [playerid/PartOfName] [Number(1-10)]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if(level > 16 || level < 0) { SendClientMessage(playerid, COLOR_GREY, "* Dont go below number 0, or above number 16!"); return 1; }
if (PlayerInfo[playerid][pAdmin] >= 6)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
if(PlayerInfo[para1][pMember] > 0 || PlayerInfo[para1][pFMember] < 255)
{
SendClientMessage(playerid, COLOR_GREY, "** That player is in a Faction / Family !");
return 1;
}
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
PlayerInfo[para1][pLeader] = level;
format(string, sizeof(string), "* You have been promoted to Leader Of the Faction %d by Admin %s",level, sendername);
SendClientMessage(para1, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "* You have given %s control to run Faction Number %d.", giveplayer,level);
SendClientMessage(playerid, COLOR_ORANGE, string);
format(string, sizeof(string), "[ADMIN]: %s Has Given Control of the Faction %d to %s.",sendername,level,giveplayer);
ABroadCast(COLOR_LIGHTRED,string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Gave The Control of the faction %d to [%s]",d,m,y,h,mi,s,sendername,level,giveplayer);
LoginLog(string);
AdminLog(string);
if(level == 0) { PlayerInfo[para1][pChar] = 0; PlayerInfo[para1][pRank] = 0; gTeam[para1] = 3; PlayerInfo[para1][pTeam] = 0; return 1; }
else if(level == 1) { PlayerInfo[para1][pChar] = 288; } //Police Force
else if(level == 2) { PlayerInfo[para1][pChar] = 286; } //FBI/ATF
else if(level == 3) { PlayerInfo[para1][pChar] = 287; } //National Guard
else if(level == 4) { PlayerInfo[para1][pChar] = 274; } //Ambulance
else if(level == 5) { PlayerInfo[para1][pChar] = 175; } //Surenos
else if(level == 6) { PlayerInfo[para1][pChar] = 187; } //La Famiglia Sinatra
else if(level == 7) { PlayerInfo[para1][pChar] = 147; } //Mayor
else if(level == 8) { PlayerInfo[para1][pChar] = 20; } //Hitmans
else if(level == 9) { PlayerInfo[para1][pChar] = 227; } //News Reporters
else if(level == 10) { PlayerInfo[para1][pChar] = 61; } //Taxi Cab Company
else if(level == 11) { PlayerInfo[para1][pChar] = 171; } //Driving/Flying School
else if(level == 12) { PlayerInfo[para1][pChar] = 279; } //Firemen
else if(level == 13) { PlayerInfo[para1][pChar] = 248; } //bikers
else if(level == 14) { PlayerInfo[para1][pChar] = 228; } //Yamaguchi
else if(level == 15) { PlayerInfo[para1][pChar] = 113; } //Chornaya Bratva
else if(level == 16) { PlayerInfo[para1][pChar] = 228; } //La Vice
if(level == 0)
{
gTeam[para1] = 3;
PlayerInfo[para1][pTeam] = 3;
PlayerInfo[para1][pRank] = 0;
}
else if(level == 1)
{
gTeam[para1] = 2;
PlayerInfo[para1][pTeam] = 2;
PlayerInfo[para1][pRank] = 8;
}
else if(level == 2)
{
gTeam[para1] = 2;
PlayerInfo[para1][pTeam] = 2;
PlayerInfo[para1][pRank] = 8;
}
else if(level == 3)
{
gTeam[para1] = 2;
PlayerInfo[para1][pTeam] = 2;
PlayerInfo[para1][pRank] = 8;
}
else if(level == 4)
{
gTeam[para1] = 1;
PlayerInfo[para1][pTeam] = 1;
PlayerInfo[para1][pRank] = 8;
}
else if(level == 5)
{
gTeam[para1] = 15;
PlayerInfo[para1][pTeam] = 15;
PlayerInfo[para1][pRank] = 6;
}
else if(level == 6)
{
gTeam[para1] = 15;
PlayerInfo[para1][pTeam] = 15;
PlayerInfo[para1][pRank] = 8;
}
else if(level == 7)
{
gTeam[para1] = 15;
PlayerInfo[para1][pTeam] = 15;
PlayerInfo[para1][pRank] = 6;
}
else if(level == 8)
{
gTeam[para1] = 15;
PlayerInfo[para1][pTeam] = 15;
PlayerInfo[para1][pRank] = 6;
}
else if(level == 9)
{
gTeam[para1] = 15;
PlayerInfo[para1][pTeam] = 15;
PlayerInfo[para1][pRank] = 6;
}
else if(level == 10)
{
gTeam[para1] = 15;
PlayerInfo[para1][pTeam] = 15;
PlayerInfo[para1][pRank] = 6;
}
else if(level == 11)
{
gTeam[para1] = 15;
PlayerInfo[para1][pTeam] = 15;
PlayerInfo[para1][pRank] = 6;
}
else if(level == 12)
{
gTeam[para1] = 15;
PlayerInfo[para1][pTeam] = 15;
PlayerInfo[para1][pRank] = 8;
}
else if(level == 13)
{
gTeam[para1] = 15;
PlayerInfo[para1][pTeam] = 15;
PlayerInfo[para1][pRank] = 6;
}
else if(level == 14)
{
gTeam[para1] = 15;
PlayerInfo[para1][pTeam] = 15;
PlayerInfo[para1][pRank] = 6;
}
else if(level == 15)
{
gTeam[para1] = 15;
PlayerInfo[para1][pTeam] = 15;
PlayerInfo[para1][pRank] = 7;
}
else if(level == 16)
{
gTeam[para1] = 15;
PlayerInfo[para1][pTeam] = 15;
PlayerInfo[para1][pRank] = 9;
}
else
{
gTeam[para1] = 3;
PlayerInfo[para1][pTeam] = 3;
PlayerInfo[para1][pRank] = 0;
}
SetPlayerSkin(para1, PlayerInfo[para1][pChar]);
SetPlayerToTeamColor(para1);
}
}//not connected
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
}
}
return 1;
}
EDIT: The only thing in which you've done to your code, was edited the level's to your liking.
|