24.08.2011, 06:25
pawn Code:
CMD:setleader(playerid, params[]) {
if(playerVariables[playerid][pAdminLevel] >= 3) {
new
groupID,
userID;
if(sscanf(params, "ud", userID, groupID)) {
return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/setleader [playerid] [groupid]");
}
else {
if(groupID < 1 || groupID > MAX_GROUPS) return SendClientMessage(playerid, COLOR_GREY, "Invalid group ID.");
playerVariables[userID][pGroup] = groupID;
playerVariables[userID][pGroupRank] = 6;
new
string[128];
GetPlayerName(userID, szPlayerName, MAX_PLAYER_NAME);
format(string, sizeof(string), "You have set %s to lead group %s.", szPlayerName, groupVariables[groupID][gGroupName]);
SendClientMessage(playerid, COLOR_WHITE, string);
GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
format(string, sizeof(string), "Administrator %s has set you to lead group %s.", szPlayerName, groupVariables[groupID][gGroupName]);
SendClientMessage(userID, COLOR_WHITE, string);
}
}
return 1;
}