Results 1 to 8 of 8

Thread: show shotgun owners

  1. #1
    Private First Class
    Join Date
    Nov 2015
    Posts
    128
    Thanks
    37
    Thanked 14 Times in 14 Posts

    show shotgun owners

    hi , i have shotgun limit in my server. and i wanted to show in below of screen who have shotgun.

    i made script like this but i got this error.. i understood my error but i dont know how to fix

    PHP Code:
    pair 'Allies Shotgunner = ' and 'allies_shotgunner' has unmatching types 'localized string' and 'string': (file 'maps/owners/allies.gsc'line 15)
            
    level.ownersnameallies setText(&"Allies Shotgunner = " "allies_shotgunner"); 

    PHP Code:
    Owners()
    {    
        if(
    getcvar("sv_shotgun_owner_allies") == ""setcvar("sv_shotgun_owner_allies""none");
        if(
    getcvar("sv_shotgun_owner_axis") == ""setcvar("sv_shotgun_owner_axis""none");
        
    players getentarray("player""classname");
        for(
    0players.sizei++)
        {
            
    player players[i];

            if (
    player.pers["team"] == "allies")
            {
                
    current self getcurrentweapon();

                if (
    current == "shotgun_mp_allies")
                    
    name self.name;    
                    
    setcvar("sv_shotgun_owner_allies""self.name");
            }

            
            else if (
    player.pers["team"] == "axis")
            {
                
    current self getcurrentweapon();

                if (
    current == "shotgun_mp_axis")
                        
                    
    setcvar("sv_shotgun_owner_axis""self.name");
            }
        }


    PHP Code:
    ownersallies()
    {
         
    maps\mp\gametypes\_weapons::Owners();
        
    allies_shotgunner getcvar("sv_shotgun_owner_allies") ;

        
    level.ownersnameallies newHudElem();  
        
    level.ownersnameallies.250;
        
    level.ownersnameallies.479;
        
    level.ownersnameallies.alignX "left";
        
    level.ownersnameallies.alignY "bottom";
            
    level.ownersnameallies.horzAlign "left";
            
    level.ownersnameallies.vertAlign "top";
        
    level.ownersnameallies.alpha 1.2;
        
    level.ownersnameallies.fontScale 1.1;
            
    level.ownersnameallies setText(&"^5Allies Shotgunner = " "allies_shotgunner");     
             
                    
        

    PHP Code:
    ownersaxis()
    {
        
    maps\mp\gametypes\_weapons::Owners();
        
    axis_shotgunner getcvar("sv_shotgun_owner_axis") ;
        
        
    level.ownersnameaxis newHudElem();  
        
    level.ownersnameaxis.450;
        
    level.ownersnameaxis.479;
        
    level.ownersnameaxis.alignX "left";
        
    level.ownersnameaxis.alignY "bottom";
            
    level.ownersnameaxis.horzAlign "left";
            
    level.ownersnameaxis.vertAlign "top";
        
    level.ownersnameaxis.alpha 1.2;
        
    level.ownersnameaxis.fontScale 1.1;
            
    level.ownersnameaxis setText(&"^5Axis Shotgunner = " "axis_shotgunner" ); 

    Last edited by feanor; 12th June 2016 at 11:17.

  2. The Following User Says Thank You to feanor For This Useful Post:

    kubislav23 (13th June 2016)

  3. #2
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    2 huds, 1 with settext &"axis shotgunner" and the second with setplayernamestring(player). Align them properly.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  4. The Following User Says Thank You to IzNoGoD For This Useful Post:

    feanor (12th June 2016)

  5. #3
    Private First Class
    Join Date
    Nov 2015
    Posts
    128
    Thanks
    37
    Thanked 14 Times in 14 Posts
    i dunno how to use setplayernamestring(player), i made this but i got this

    PHP Code:
    type undefined is not an entity: (file 'maps/owners/allies.gsc'line 34)
            
    level.ownersnameallies1 setPlayerNameStringplayers[allies_shotgunner] ); 

    PHP Code:
    Owners()
    {    

        
    players getentarray("player""classname");
        for(
    0players.sizei++)
        {
            
    player players[i];

            if (
    player.pers["team"] == "allies")
            {
                
    current self getcurrentweapon();

                if (
    current == "shotgun_mp_allies")
                    
                     
    setcvar("sv_shotgun_owner_allies""i") ;
                    
            }

            
            else if (
    player.pers["team"] == "axis")
            {
                
    current self getcurrentweapon();

                if (
    current == "shotgun_mp_axis")
                        
                    
    setcvar("sv_shotgun_owner_axis""i") ;
            }
        }


    PHP Code:
    ownersallies()
    {
     
        
    level.ownersnameallies newHudElem();  
        
    level.ownersnameallies.250;
        
    level.ownersnameallies.479;
        
    level.ownersnameallies.alignX "left";
        
    level.ownersnameallies.alignY "bottom";
            
    level.ownersnameallies.horzAlign "left";
            
    level.ownersnameallies.vertAlign "top";
        
    level.ownersnameallies.alpha 1.2;
        
    level.ownersnameallies.fontScale 1.1;
            
    level.ownersnameallies setText(&"^5Allies Shotgunner = ");     
             
                    
        
    }

    ownersallies_1()
    {
         
    maps\mp\gametypes\_weapons::Owners();
        
    allies_shotgunner getcvarint("sv_shotgun_owner_allies") ; 
        
    players getentarray("player""classname");
            
        
    level.ownersnameallies1 newHudElem();  
        
    level.ownersnameallies1.275;
        
    level.ownersnameallies1.479;
        
    level.ownersnameallies1.alignX "left";
        
    level.ownersnameallies1.alignY "bottom";
            
    level.ownersnameallies1.horzAlign "left";
            
    level.ownersnameallies1.vertAlign "top";
        
    level.ownersnameallies1.alpha 1.2;
        
    level.ownersnameallies1.fontScale 1.1;
            
    level.ownersnameallies1 setPlayerNameStringplayers[allies_shotgunner] );
                    
        


  6. The Following User Says Thank You to feanor For This Useful Post:

    kubislav23 (13th June 2016)

  7. #4
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    PHP Code:

            
    if (player.pers["team"] == "allies")
            {
                
    current self getcurrentweapon(); 
    wat.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  8. #5
    Private First Class
    Join Date
    Nov 2015
    Posts
    128
    Thanks
    37
    Thanked 14 Times in 14 Posts
    what is wrong?

  9. The Following User Says Thank You to feanor For This Useful Post:

    kubislav23 (13th June 2016)

  10. #6
    Private Whiskas's Avatar
    Join Date
    Jan 2015
    Posts
    84
    Thanks
    69
    Thanked 20 Times in 17 Posts
    self != player

  11. #7
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    PHP Code:
        if(getcvar("sv_shotgun_owner_allies") == ""setcvar("sv_shotgun_owner_allies""none");
        if(
    getcvar("sv_shotgun_owner_axis") == ""setcvar("sv_shotgun_owner_axis""none"); 
    What's this even good for?


    PHP Code:
            player players[i]; 
    I know IW uses this in their stock scripting a lot, but WHY?

    PHP Code:

            
    if (player.pers["team"] == "allies")
            {
                
    current self getcurrentweapon(); 
    as per whiskas.

    PHP Code:
                    name self.name
    who is self?
    PHP Code:
                    setcvar("sv_shotgun_owner_allies""self.name"); 
    have you ever checked the sv_shotgun_owner_allies cvar value? It will be "self.name".


    PHP Code:
        level.ownersnameallies newHudElem();  
        
    level.ownersnameallies.250;
        
    level.ownersnameallies.479
        
    level.ownersnameaxis newHudElem();  
        
    level.ownersnameaxis.450;
        
    level.ownersnameaxis.479
    Ye, your 2 huds will overlap, and as they are global, both teams will see them overlap.

    PHP Code:

            level
    .ownersnameallies setText(&"^5Allies Shotgunner = " "allies_shotgunner"); 
    I dont think you'll learn this scripting language.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  12. #8
    Private First Class
    Join Date
    Nov 2015
    Posts
    128
    Thanks
    37
    Thanked 14 Times in 14 Posts
    ok bb , best man in the world

  13. The Following User Says Thank You to feanor For This Useful Post:

    kubislav23 (14th June 2016)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •