21.07.2017, 18:23
PHP код:
#define FILE_SMANAGERS "smanagers"
new smlvl[PLAYERS];
CMD:setsmang(playerid, params[])
{
new giveplayerid, moneys1, giveplayer[25], string[256], playername[25];
if (adlvl[playerid] < 6) return 0;
if (sscanf(params, "ud", giveplayerid, moneys1)) return SendClientMessage2(playerid, COLOR_WHITE, "Usage: /setsmang [playerid] [0 = Kick Org Manager, 1 = Set Org Manager]");
if (!IsPlayerConnected2(giveplayerid)) return SendClientMessage2(playerid, COLOR_RED, "Error: Inactive player id!");
if (moneys1 < 0 || moneys1 > 1) return SendClientMessage2(playerid, COLOR_RED, "Error: 0 = Kick Org Manager, 1 = Set Org Manager.");
if (Logged[giveplayerid] == 0) return SendClientMessage2(playerid, COLOR_WHITE, "Error: Player isn't logged in.");
GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
if (moneys1 == smlvl[giveplayerid])
{
if (giveplayerid != playerid)
{
if (moneys1 == 0)
{
format(string, 64, "%s is not set as a S Manager.", giveplayer);
SendClientMessage2(playerid, COLOR_WHITE, string);
}
else
{
format(string, 64, "%s is already set as a S Manager.", giveplayer);
SendClientMessage2(playerid, COLOR_WHITE, string);
}
}
else
{
if (moneys1 == 0) SendClientMessage2(playerid, COLOR_WHITE, "You are not set as a SManager.");
else SendClientMessage2(playerid, COLOR_WHITE, "You are already set as a SManager.");
}
return 1;
}
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
if (moneys1 != 0)
{
dini_IntSet(AddDirFile(dir_userfiles, giveplayer), "smanager", moneys1);
dini_IntSet(AddDirFile(dir_datafiles, FILE_SMANAGERS), giveplayer, 1);
if (giveplayerid != playerid)
{
SendClientMessage2(giveplayerid, COLOR_YELLOW, "You have been set as a SManager.");
SendPlayerFormattedText(playerid, COLOR_YELLOW, "You have set %s as a SManager.", giveplayer, "");
}
else SendClientMessage2(playerid, COLOR_YELLOW, "You have set yourself as a SManager.");
}
else
{
dini_Unset(AddDirFile(dir_userfiles, giveplayer), "smanager");
dini_Unset(AddDirFile(dir_datafiles, FILE_SMANAGERS), giveplayer);
if (giveplayerid != playerid)
{
SendClientMessage2(giveplayerid, COLOR_WHITE, "You have been removed as a SManager.");
SendPlayerFormattedText(playerid, COLOR_WHITE, "You have removed %s as a SManager.", giveplayer, "");
}
else SendClientMessage2(playerid, COLOR_WHITE, "You have removed yourself as a SManager.");
}
smlvl[giveplayerid] = moneys1;
return 1;
}
To Get Shown /smanagers Go Here
PHP код:
#define S_LEVEL_1 "Support Manager"
stock SMLVL(lvl)
{
new string[128];
switch(lvl)
{
case 1:
{
format(string, 128, "%s %s", LEVEL_1_COLOR, S_LEVEL_1);
}
}
return string;
}
CMD:smembers(playerid, params[])
{
new moneys1, string[128];
for (new i = 0; i < PLAYERS; i++)
{
if (IsPlayerConnected2(i))
{
if (smlvl[playerid] > 0)
{
moneys1++;
}
else if(smlvl[playerid] == 1)
{
if(smlvl[playerid] > 0)
{
moneys1++;
}
}
}
}
if (moneys1 != 0)
{
SendClientMessage(playerid, COLOR_ADMIN, "• • Online Support Managers• •");
new p=6;
while (p > 0)
{
for (new i = 0; i < PLAYERS; i++)
{
if (smlvl[i] == p)
{
format(string, 128, "{FFFFFF}%s", RPN(i), SMLVL(p),p);
SendClientMessage(playerid, COLOR_WHITE, string);
}
else if(smlvl[i] == p)
{
if(smlvl[playerid] == 1)
{
format(string, 128, "{FFFFFF}%s", RPN(i), SMLVL(p),p);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
}
p--;
}
}
else SendClientMessage(playerid, COLOR_RED, "There are currently no support managers online.");
return 1;
}
TRY THIS
If I Helped Repp++ Me
If I Helped Repp++ Me