Raised This Month: $214 Target: $400
 53% 

[CSS] Laser Aim


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Plugin ID:
1454
Plugin Version:
1.3
Plugin Category:
Fun Stuff
Plugin Game:
Counter-Strike: Source
Plugin Dependencies:
    Servers with this Plugin:
    15 
    Plugin Description:
    Creates A Beam For every times when a Snipers Rifle in arms
    Old 02-06-2010 , 12:32   [CSS] Laser Aim
    Reply With Quote #1

    Name:
    Laser Aim
    Description:
    Creates A Beam For every times when a Snipers Rifle in arms
    Changelogs:
    Spoiler

    CVars:
    PHP Code:
        // Get plugins version
        
    sm_laser_aim
        
    // Enable/disable plugin
        
    sm_laser_aim_on 1
        
    // Beam/dot color
        
    sm_laser_aim_red 200
        sm_laser_aim_green 0
        sm_laser_aim_blue 0
        sm_laser_aim_alpha 150
        
    // Beam size
        
    sm_laser_aim_width 2
        
    // Dot size
        
    sm_laser_aim_dot_width 2 
    Attached Thumbnails
    Click image for larger version

Name:	de_train0000.jpg
Views:	14422
Size:	83.9 KB
ID:	59173  
    Attached Files
    File Type: sp Get Plugin or Get Source (laser_aim.sp - 9739 views - 4.8 KB)
    __________________

    Last edited by Leonardo; 09-03-2012 at 15:04.
    Leonardo is offline
    usla
    Senior Member
    Join Date: Jul 2009
    Old 02-06-2010 , 16:15   Re: Laser Aim
    Reply With Quote #2

    very nice man
    usla is offline
    bouncer
    Veteran Member
    Join Date: Apr 2009
    Old 02-06-2010 , 21:02   Re: [CSS] Laser Aim
    Reply With Quote #3

    Sweet... is this possible for Insurgency maybe? Would love it!
    __________________


    bouncer is offline
    bouncer
    Veteran Member
    Join Date: Apr 2009
    Old 02-07-2010 , 00:39   Re: [CSS] Laser Aim
    Reply With Quote #4

    Hey I tried modifying your plugin to show lasers for only Marines team at the moment for INS, but with no luck, it compiled and all but it just didn't show any lasers, would you know why?

    Here is the source http://pastebin.com/m76bc3364
    __________________


    bouncer is offline
    Leonardo
    Veteran Member
    Join Date: Feb 2010
    Location: 90's
    Old 02-07-2010 , 04:29   Re: [CSS] Laser Aim
    Reply With Quote #5

    maybe weapon names is incorrect?
    in CSS this is weapon_*
    and check, do you need <player team>?
    __________________

    Last edited by Leonardo; 02-13-2010 at 21:07.
    Leonardo is offline
    bouncer
    Veteran Member
    Join Date: Apr 2009
    Old 02-07-2010 , 12:42   Re: [CSS] Laser Aim
    Reply With Quote #6

    I don't believe that it is weapon_ in Insurgency. But the team numbers do switch depending on the map. It goes like this...

    Code:
    public OnMapStart()
    {
        decl String:mapname[64];
        GetCurrentMap(mapname, sizeof(mapname));
        if (strcmp(mapname, "ins_karam") == 0 || strcmp(mapname, "ins_baghdad") == 0)
        {
            INSURGENTS = 1;
            MARINES = 2;
        }
        else
        {
            MARINES = 1;
            INSURGENTS = 2;
        }
    }
    Could you try to develop lasers for INS? So that when players walk around they have a laser sticking out and they can turn on and off the laser through a laser menu such as !lasers and the color of it on that menu?
    __________________


    bouncer is offline
    Leonardo
    Veteran Member
    Join Date: Feb 2010
    Location: 90's
    Old 02-08-2010 , 02:17   Re: [CSS] Laser Aim
    Reply With Quote #7

    Unfortunately, I dont know what is it "Insurgency" ^_^
    but try to use function OnMapSpawn. for checking on every rounds before event round_start.
    and.... maybe not "strcmp", but this: StrContains(string_a ,string_b)>=-1
    and for "menu" should use ConCommands, for example, "+toggleLaser"/"-toggleLaser".
    personal setting must be in arrays... for example: new PlayerSettings[<clientID>][<settingID>][<lengthOfSettingsValue>]


    and can anyone say, whats wrong here?
    Code:
    	g_CvarWeapons = CreateConVar("sm_laser_aim_weapons", "weapon_awp|weapon_scout", "List of weapons", FCVAR_NOTIFY);
    Code:
    	new bool:b_playerNeededWeapon;
    	b_playerNeededWeapon = false;
    	new String:s_neededWeaponList[128];
    	GetConVarString(g_CvarWeapons, s_neededWeaponList, sizeof(s_neededWeaponList));
    	new a_playerWeaponTemp[12][32];
    	str_piece(s_neededWeaponList, a_playerWeaponTemp, sizeof(a_playerWeaponTemp), sizeof(a_playerWeaponTemp[]) - 1, '|');
    	for(new i = 0; i < sizeof(a_playerWeaponTemp); i++)
    	{
    		if (StrEqual(a_playerWeaponTemp[i], s_playerWeapon))
    		{
    			b_playerNeededWeapon = true;
    		}
    	}
    Code:
    stock str_piece(input[], output[][], outputsize, piecelen, token = '|')
    {
     new i = -1, pieces, len = -1 ;
     
     while ( input[++i] != 0 )
     {
      if ( input[i] != token )
      {
       if ( ++len < piecelen )
        output[pieces][len] = input[i] ;
      }
      else
      {
       output[pieces++][++len] = 0 ;
       len = -1 ;
       
       if ( pieces == outputsize )
        return pieces ;
      }
     }
     return pieces + 1;
    }
    __________________

    Last edited by Leonardo; 02-08-2010 at 02:22.
    Leonardo is offline
    Black Haze
    BANNED
    Join Date: Sep 2008
    Location: Hamsterdam
    Old 02-08-2010 , 07:24   Re: [CSS] Laser Aim
    Reply With Quote #8

    Quote:
    Originally Posted by bouncer View Post
    Hey I tried modifying your plugin to show lasers for only Marines team at the moment for INS, but with no luck, it compiled and all but it just didn't show any lasers, would you know why?

    Here is the source http://pastebin.com/m76bc3364
    I can't test this cause I can't stand that lagging piece of sh*t game ;), but get rid of the if statement with all the weapons in it, so everyone has a laser. See if that works in Insurgency first.

    If after you compile that code everyone suddenly has lasers, then you did something wrong with the if statement.

    If noone still has lasers, then this code just won't work for ins and you'll have to rewrite parts.
    Black Haze is offline
    Black Haze
    BANNED
    Join Date: Sep 2008
    Location: Hamsterdam
    Old 02-08-2010 , 07:32   Re: [CSS] Laser Aim
    Reply With Quote #9

    Quote:
    Originally Posted by Leonardo View Post
    Unfortunately, I dont know what is it "Insurgency" ^_^
    but try to use function OnMapSpawn. for checking on every rounds before event round_start.
    and.... maybe not "strcmp", but this: StrContains(string_a ,string_b)>=-1
    and for "menu" should use ConCommands, for example, "+toggleLaser"/"-toggleLaser".
    personal setting must be in arrays... for example: new PlayerSettings[<clientID>][<settingID>][<lengthOfSettingsValue>]


    and can anyone say, whats wrong here?
    Code:
    	g_CvarWeapons = CreateConVar("sm_laser_aim_weapons", "weapon_awp|weapon_scout", "List of weapons", FCVAR_NOTIFY);
    Code:
    	new bool:b_playerNeededWeapon;
    	b_playerNeededWeapon = false;
    	new String:s_neededWeaponList[128];
    	GetConVarString(g_CvarWeapons, s_neededWeaponList, sizeof(s_neededWeaponList));
    	new a_playerWeaponTemp[12][32];
    	str_piece(s_neededWeaponList, a_playerWeaponTemp, sizeof(a_playerWeaponTemp), sizeof(a_playerWeaponTemp[]) - 1, '|');
    	for(new i = 0; i < sizeof(a_playerWeaponTemp); i++)
    	{
    		if (StrEqual(a_playerWeaponTemp[i], s_playerWeapon))
    		{
    			b_playerNeededWeapon = true;
    		}
    	}
    Code:
    stock str_piece(input[], output[][], outputsize, piecelen, token = '|')
    {
     new i = -1, pieces, len = -1 ;
     
     while ( input[++i] != 0 )
     {
      if ( input[i] != token )
      {
       if ( ++len < piecelen )
        output[pieces][len] = input[i] ;
      }
      else
      {
       output[pieces++][++len] = 0 ;
       len = -1 ;
       
       if ( pieces == outputsize )
        return pieces ;
      }
     }
     return pieces + 1;
    }
    I'm not seeing exactly what you are trying to do, but if you're trying to check the equiped weapon against the allowed weapons, I suggest you just make as many cvars as there are weapons, like "sm_laseraim_weapon_awp 1", it'll make things easier on your end user, and on you, since you could just check this by using a switch statement.

    If this was not where you where going for, ignore me :p
    Black Haze is offline
    Leonardo
    Veteran Member
    Join Date: Feb 2010
    Location: 90's
    Old 02-08-2010 , 14:44   Re: [CSS] Laser Aim
    Reply With Quote #10

    in some ES script I found this:
    Code:
    es_xsetinfo gunlist "awp"
    es es_xsetinfo playergun event_var(es_userweapon)
    es_xstring playergun replace "weapon_" ""
    if (server_var(playergun) in server_var(gunlist)) do
    {
    es_tell event_var(userid) This weapon founded in list!
    }
    how this idea can be wrote on SM ?
    __________________
    Leonardo is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 12:10.


    Powered by vBulletin®
    Copyright ©2000 - 2021, vBulletin Solutions, Inc.
    Theme made by Freecode