Support Manager
#2

PHP код:
#define FILE_SMANAGERS "smanagers"
new smlvl[PLAYERS];
CMD:setsmang(playeridparams[]) 

    new 
giveplayeridmoneys1giveplayer[25], string[256], playername[25]; 
    if (
adlvl[playerid] < 6) return 0
    if (
sscanf(params"ud"giveplayeridmoneys1)) return SendClientMessage2(playeridCOLOR_WHITE"Usage: /setsmang [playerid] [0 = Kick Org Manager, 1 = Set Org Manager]"); 
    if (!
IsPlayerConnected2(giveplayerid)) return SendClientMessage2(playeridCOLOR_RED"Error: Inactive player id!"); 
    if (
moneys1 || moneys1 1) return SendClientMessage2(playeridCOLOR_RED"Error: 0 = Kick Org Manager, 1 = Set Org Manager."); 
    if (
Logged[giveplayerid] == 0) return SendClientMessage2(playeridCOLOR_WHITE"Error: Player isn't logged in."); 
    
GetPlayerName(giveplayeridgiveplayerMAX_PLAYER_NAME); 
    if (
moneys1 == smlvl[giveplayerid]) 
    { 
        if (
giveplayerid != playerid
        { 
            if (
moneys1 == 0
            { 
                
format(string64"%s is not set as a S Manager."giveplayer); 
                
SendClientMessage2(playeridCOLOR_WHITEstring); 
            } 
            else 
            { 
                
format(string64"%s is already set as a S Manager."giveplayer); 
                
SendClientMessage2(playeridCOLOR_WHITEstring); 
            } 
        } 
        else 
        { 
            if (
moneys1 == 0SendClientMessage2(playeridCOLOR_WHITE"You are not set as a SManager."); 
            else 
SendClientMessage2(playeridCOLOR_WHITE"You are already set as a SManager."); 
        } 
        return 
1
    } 
    
GetPlayerName(playeridplayernameMAX_PLAYER_NAME); 
    if (
moneys1 != 0
    { 
        
dini_IntSet(AddDirFile(dir_userfilesgiveplayer), "smanager"moneys1); 
        
dini_IntSet(AddDirFile(dir_datafilesFILE_SMANAGERS), giveplayer1); 
        if (
giveplayerid != playerid
        { 
            
SendClientMessage2(giveplayeridCOLOR_YELLOW"You have been set as a SManager."); 
            
SendPlayerFormattedText(playeridCOLOR_YELLOW"You have set %s as a SManager."giveplayer""); 
        } 
        else 
SendClientMessage2(playeridCOLOR_YELLOW"You have set yourself as a SManager."); 
    } 
    else 
    { 
        
dini_Unset(AddDirFile(dir_userfilesgiveplayer), "smanager"); 
        
dini_Unset(AddDirFile(dir_datafilesFILE_SMANAGERS), giveplayer); 
        if (
giveplayerid != playerid
        { 
            
SendClientMessage2(giveplayeridCOLOR_WHITE"You have been removed as a SManager."); 
            
SendPlayerFormattedText(playeridCOLOR_WHITE"You have removed %s as a SManager."giveplayer""); 
        } 
        else 
SendClientMessage2(playeridCOLOR_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(string128"%s %s"LEVEL_1_COLORS_LEVEL_1);
        }
    }
    return 
string;
}
CMD:smembers(playeridparams[])
{
 new 
moneys1string[128];
 for (new 
0PLAYERSi++)
 {
      if (
IsPlayerConnected2(i))
      {
               if (
smlvl[playerid] > 0)
               {
                
moneys1++;
               }
               else if(
smlvl[playerid] == 1)
               {
                   if(
smlvl[playerid] > 0)
                   {
                       
moneys1++;
                   }
               }
      }
 }
 if (
moneys1 != 0)
 {
      
SendClientMessage(playeridCOLOR_ADMIN"• • Online Support Managers• •");
      new 
p=6;
      while (
0)
      {
          for (new 
0PLAYERSi++)
          {
               if (
smlvl[i] == p)
            {
                  
format(string128"{FFFFFF}%s"RPN(i), SMLVL(p),p);
                  
SendClientMessage(playeridCOLOR_WHITEstring);
            }
            else if(
smlvl[i] == p)
            {
                if(
smlvl[playerid] == 1)
                {
                  
format(string128"{FFFFFF}%s"RPN(i), SMLVL(p),p);
                  
SendClientMessage(playeridCOLOR_WHITEstring);
                }
            }
             }
          
p--;
      }
 }
 else 
SendClientMessage(playeridCOLOR_RED"There are currently no support managers online.");
 return 
1;

TRY THIS
If I Helped Repp++ Me
Reply


Messages In This Thread
Support Manager - by RomaNScripteR - 21.07.2017, 18:15
Re: Support Manager - by SilverScripter - 21.07.2017, 18:23
Re: Support Manager - by RomaNScripteR - 21.07.2017, 18:32
Re: Support Manager - by SilverScripter - 21.07.2017, 18:36
Re: Support Manager - by Sew_Sumi - 21.07.2017, 20:02
Re: Support Manager - by silverms - 21.07.2017, 20:34

Forum Jump:


Users browsing this thread: 1 Guest(s)