21.07.2017, 18:15
Hello I was scripting, I added support manager in my previous script but that was cracked. I again tried it on my script in which it wasn't, but I forgot something about it. I had made smlvl by seeing olvl and elvl. I had made Support Manager system before by /setomang
Code here :
Tell me how to make Support Manager back
Code here :
PHP код:
CMD:setomang(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: /setomang [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 == olvl[giveplayerid])
{
if (giveplayerid != playerid)
{
if (moneys1 == 0)
{
format(string, 64, "%s is not set as a Org Manager.", giveplayer);
SendClientMessage2(playerid, COLOR_WHITE, string);
}
else
{
format(string, 64, "%s is already set as a Org Manager.", giveplayer);
SendClientMessage2(playerid, COLOR_WHITE, string);
}
}
else
{
if (moneys1 == 0) SendClientMessage2(playerid, COLOR_WHITE, "You are not set as a Org Manager.");
else SendClientMessage2(playerid, COLOR_WHITE, "You are already set as a Org Manager.");
}
return 1;
}
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
if (moneys1 != 0)
{
dini_IntSet(AddDirFile(dir_userfiles, giveplayer), "omanager", moneys1);
dini_IntSet(AddDirFile(dir_datafiles, FILE_SUPPORTMEMBERS), giveplayer, 1);
if (giveplayerid != playerid)
{
SendClientMessage2(giveplayerid, COLOR_YELLOW, "You have been set as a Org Manager.");
SendPlayerFormattedText(playerid, COLOR_YELLOW, "You have set %s as a Org Manager.", giveplayer, "");
}
else SendClientMessage2(playerid, COLOR_YELLOW, "You have set yourself as a Org Manager.");
}
else
{
dini_Unset(AddDirFile(dir_userfiles, giveplayer), "omanager");
dini_Unset(AddDirFile(dir_datafiles, FILE_SUPPORTMEMBERS), giveplayer);
if (giveplayerid != playerid)
{
SendClientMessage2(giveplayerid, COLOR_WHITE, "You have been removed as a Org Manager.");
SendPlayerFormattedText(playerid, COLOR_WHITE, "You have removed %s as a Org Manager.", giveplayer, "");
}
else SendClientMessage2(playerid, COLOR_WHITE, "You have removed yourself as a Org Manager.");
}
olvl[giveplayerid] = moneys1;
return 1;
}