Quote:
Originally Posted by ElieJabbour
Adm CMD :
pawn Код:
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; }
I'll make you the Faction codes later, lol, too lazy.
|
You've done nothing but strip this out of a Godfather edit.
Quote:
Originally Posted by Darnell
Don't start scripting roleplay.
Script deathmatch, TDM, freeroam etc.
I don't think anyone will do that much of a request, for free.
|
PHP код:
new faction[MAX_PLAYERS];
YCMD:makeleader(playerid, params[], help)
{
#pragma unused help
if(IsPlayerAdmin(playerid))
{
new id, fnumber;
if(sscanf(params, "ui", id, fnumber)) return SendClientMessage(playerid, -1, "USAGE: /makeleader [playerid] [faction]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Player is not connected!");
faction[id] = fnumber;
new string[128];
format(string, sizeof(string), "You have been made leader of faction number %d.", fnumber);
SendClientMessage(id, -1, string);
}
else
{
SendClientMessage(playerid, -1, "You are not authorized to use that command!");
}
return 1;
}
An example done in YCMD. Untested.