Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: plusscore

  1. #1
    Private First Class
    Join Date
    Feb 2013
    Posts
    201
    Thanks
    4
    Thanked 10 Times in 7 Posts

    plusscore

    hello i have problem .
    scrpt : _plusscore

    error:
    http://speedy.sh/dWPB9/plus.jpg

    PHP Code:
    precache
            precacheString
    (&"IZNO_PLUS"); 
    on :
    PHP Code:
    Callback_StartGameType()
            
    thread maps\mp\gametypes\_plusscore::init(); 
    PHP Code:
    if(sMeansOfDeath == "MOD_MELEE")
                    {
                    
    attacker thread maps\mp\gametypes\_plusscore::plusscore();
                    
    attacker.plusscore+=2000;
                    
    attacker.scoretoshow=200
    PHP Code:
    init()
    {
        
    precachestring(&"");
        
    precachestring(&"+");
        
    game["precached_plusscore_strings"] = true;
    }

    plusscore(score)
    {
        if(!
    isdefined(game["precached_plusscore_strings"]))
        {
            
    iprintln("Plusscore strings not precached. Call init() on startgametype...");
            return;
        }
        if(!
    isplayer(self))
        {
            
    iprintln("Plusscore not called on a player. Go fix this before you try anything else!");
            return;
        }
        if(!
    isdefined(self.izno_plusscore)) //first run
        
    {
            
    self.izno_plusscore newclienthudelem(self);
            
    self.izno_plusscore.instance 0;
            
    self.izno_plusscore.score score;
            
    self.izno_plusscore.horzAlign "center";
            
    self.izno_plusscore.vertAlign "middle";
            
    self.izno_plusscore.alignX "center";
            
    self.izno_plusscore.alignY "middle";
            
    self.izno_plusscore.0//middle of screen
            
    self.izno_plusscore.= -40//just above middle of screen
            
    self.izno_plusscore.alpha 0.3;
            
    self.izno_plusscore.fontscale 0.5;
        }
        else 
    //not first-run
        
    {
            if(
    self.izno_plusscore.alpha 0.3 || self.izno_plusscore.score == 0)
                
    self.izno_plusscore.alpha 0.3;
            if(
    self.izno_plusscore.fontscale 0.5 || self.izno_plusscore.score == 0)
                
    self.izno_plusscore.fontscale 0.5;
            
    self.izno_plusscore.instance++;
            
    self.izno_plusscore.score += score;
        }
        if(
    self.izno_plusscore.score 0)
        {
            
    self.izno_plusscore.color = (235/255,10/255,10/255); //negative scores are red
            
    self.izno_plusscore.label = &"";
        }
        else
        {
            
    self.izno_plusscore.color = (1,230/255,125/255); //yellow-ish
            
    self.izno_plusscore.label = &"+";
        }
        
    self.izno_plusscore setvalue(self.izno_plusscore.score);    

        
    current_instance self.izno_plusscore.instance;
        
    make_bigger true;
        
    more_opaque true;
        
    steady_opaque_timer 0;
        
    alpha_done false;
        
    size_done false;
        while(
    isdefined(self) && current_instance == self.izno_plusscore.instance && !(alpha_done && size_done))
        {
            if(
    make_bigger && self.izno_plusscore.fontscale 2)
                
    self.izno_plusscore.fontscale += 0.35;
            else if(
    make_bigger)
                
    make_bigger false;
            else if(
    self.izno_plusscore.fontscale 2)
                
    self.izno_plusscore.fontscale -= 0.2;
            else
            {
                
    size_done true;
                
    self.izno_plusscore.fontscale 1.5;
            }

            if(
    more_opaque && self.izno_plusscore.alpha <= 0.9//dont overflow this
                
    self.izno_plusscore.alpha += 0.1;
            else if(
    more_opaque && steady_opaque_timer == 20)
                
    more_opaque false;
            else if(
    more_opaque)
                
    steady_opaque_timer++;
            else if(
    self.izno_plusscore.alpha >= 0.1//dont underflow this
                
    self.izno_plusscore.alpha -= 0.1;
            else
            {
                
    alpha_done true;
                
    self.izno_plusscore.alpha 0;
            }
            
    wait 0.05;
        }
        if(!
    isdefined(self))
            return;
        if(
    current_instance == self.izno_plusscore.instance)
        {
            
    wait 0.5;
            if(
    isdefined(self) && self.izno_plusscore.instance == current_instance)
                
    self.izno_plusscore.score 0;
        }

    Last edited by IzNoGoD; 22nd February 2013 at 22:20.

  2. #2
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Should normally work

    PHP Code:
    thread maps\mp\gametypes\_plusscore::init(); 
    Can you remove "thread"? I think it shall work with it also, but i dont see any other bug atm.



    Also, please use [php]-Tag for code. And upload images to forum, not some external site:

    Click image for larger version. 

Name:	plus.jpg 
Views:	82 
Size:	34.3 KB 
ID:	166
    timescale 0.01

  3. #3
    Private First Class
    Join Date
    Feb 2013
    Posts
    201
    Thanks
    4
    Thanked 10 Times in 7 Posts
    Quote Originally Posted by kung foo man View Post
    Should normally work

    PHP Code:
    thread maps\mp\gametypes\_plusscore::init(); 
    Can you remove "thread"? I think it shall work with it also, but i dont see any other bug atm.



    Also, please use [php]-Tag for code. And upload images to forum, not some external site:

    Click image for larger version. 

Name:	plus.jpg 
Views:	82 
Size:	34.3 KB 
ID:	166
    maps\mp\gametypes\_plusscore::init();
    ?

  4. #4
    Private First Class
    Join Date
    Feb 2013
    Posts
    201
    Thanks
    4
    Thanked 10 Times in 7 Posts
    ok it work ,
    but does not show the text +10/20, etc.
    Code:
    								if(sMeansOfDeath == "MOD_MELEE")
    				{
    				attacker thread maps\mp\gametypes\_plusscore::plusscore();
    				attacker.plusscore+=10;
    				attacker.scoretoshow=10;
    				}

  5. #5
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    call with a score in the ().

    Like plusscore(10);

    Also

    test with developer 1 instead of developer 0
    You would have found the bug by now if you did...
    Last edited by IzNoGoD; 22nd February 2013 at 22:22.

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

    kung foo man (23rd February 2013)

  7. #6
    Private First Class
    Join Date
    Feb 2013
    Posts
    201
    Thanks
    4
    Thanked 10 Times in 7 Posts
    ******* script compile error *******
    bad syntax: (file 'czolg/zom.gsc', line 700)
    attacker.plusscore(10);
    *
    ************************************
    who can help me ?

  8. #7
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Write:

    PHP Code:
    attacker thread maps\mp\gametypes\_plusscore::plusscore(10); 
    timescale 0.01

  9. The Following User Says Thank You to kung foo man For This Useful Post:

    Jeplaa (23rd February 2013)

  10. #8
    Private First Class
    Join Date
    Feb 2013
    Posts
    201
    Thanks
    4
    Thanked 10 Times in 7 Posts
    if(sMeansOfDeath == "MOD_HEAD_SHOT")
    {
    attacker.head++;
    attacker.lol++;
    attacker thread maps\mp\gametypes\_plusscore:lusscore(10);
    }
    doesnt work not show the text +10/20, etc.

  11. #9
    Private First Class
    Join Date
    Feb 2013
    Posts
    201
    Thanks
    4
    Thanked 10 Times in 7 Posts
    Close topic plz

  12. #10
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    You found the bug? Please post solution.

    Also we dont close threads, there is no sense in that.
    timescale 0.01

Posting Permissions

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