Support Manager
#1

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 :
PHP код:
CMD:setomang(playeridparams[])
{
    new 
giveplayeridmoneys1giveplayer[25], string[256], playername[25];
    if (
adlvl[playerid] < 6) return 0;
    if (
sscanf(params"ud"giveplayeridmoneys1)) return SendClientMessage2(playeridCOLOR_WHITE"Usage: /setomang [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 == olvl[giveplayerid])
    {
        if (
giveplayerid != playerid)
        {
            if (
moneys1 == 0)
            {
                
format(string64"%s is not set as a Org Manager."giveplayer);
                
SendClientMessage2(playeridCOLOR_WHITEstring);
            }
            else
            {
                
format(string64"%s is already set as a Org Manager."giveplayer);
                
SendClientMessage2(playeridCOLOR_WHITEstring);
            }
        }
        else
        {
            if (
moneys1 == 0SendClientMessage2(playeridCOLOR_WHITE"You are not set as a Org Manager.");
            else 
SendClientMessage2(playeridCOLOR_WHITE"You are already set as a Org Manager.");
        }
        return 
1;
    }
    
GetPlayerName(playeridplayernameMAX_PLAYER_NAME);
    if (
moneys1 != 0)
    {
        
dini_IntSet(AddDirFile(dir_userfilesgiveplayer), "omanager"moneys1);
        
dini_IntSet(AddDirFile(dir_datafilesFILE_SUPPORTMEMBERS), giveplayer1);
        if (
giveplayerid != playerid)
        {
            
SendClientMessage2(giveplayeridCOLOR_YELLOW"You have been set as a Org Manager.");
            
SendPlayerFormattedText(playeridCOLOR_YELLOW"You have set %s as a Org Manager."giveplayer"");
        }
        else 
SendClientMessage2(playeridCOLOR_YELLOW"You have set yourself as a Org Manager.");
    }
    else
    {
        
dini_Unset(AddDirFile(dir_userfilesgiveplayer), "omanager");
        
dini_Unset(AddDirFile(dir_datafilesFILE_SUPPORTMEMBERS), giveplayer);
        if (
giveplayerid != playerid)
        {
            
SendClientMessage2(giveplayeridCOLOR_WHITE"You have been removed as a Org Manager.");
            
SendPlayerFormattedText(playeridCOLOR_WHITE"You have removed %s as a Org Manager."giveplayer"");
        }
        else 
SendClientMessage2(playeridCOLOR_WHITE"You have removed yourself as a Org Manager.");
    }
    
olvl[giveplayerid] = moneys1;
    return 
1;

Tell me how to make Support Manager back
Reply
#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
#3



Thank you very much SilverScripter
And yes rep++
Reply
#4

Need Any More Help PM Me
Reply
#5

This "PM Me", defeats the purpose of the forums themselves...

Along with pasting up code to simply fix peoples code. You don't explain what's broken, what you fixed, or how to script at all.
Reply
#6

lol u stealer I made that script anyways setomang doesn't need 20 lines of coding nub
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)