Raised This Month: $ Target: $400
 0% 

[L4D & L4D2] Laser Sights


Post New Thread Reply   
 
Thread Tools Display Modes
Author
V10
Senior Member
Join Date: Jan 2010
Location: Russia
Plugin ID:
1021
Plugin Version:
1.0.8
Plugin Category:
Fun Stuff
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    No Random Upgrades or Admin Menu litter ... just Laser sights
    Old 01-26-2010 , 15:38   Re: [L4D & L4D2] Laser Sights
    Reply With Quote #1

    I fix bug (l4d2 plugin) where the command !laser does not always work the first time, moreover now pick up weapons and if you had a laser, he gives you back.
    Attached Files
    File Type: sp Get Plugin or Get Source (l4d2_lasersight.sp - 474 views - 2.3 KB)

    Last edited by V10; 01-27-2010 at 20:37. Reason: Replaced "smg_" to "smg"
    V10 is offline
    AtomicStryker
    Veteran Member
    Join Date: Apr 2009
    Location: Teutonia!!
    Old 01-26-2010 , 19:29   Re: [L4D & L4D2] Laser Sights
    Reply With Quote #2

    Oh dear D:

    PHP Code:
    public Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
    {
        for (new 
    1<= MAXPLAYERSi++){
            
    bHasLaser[i]=false;
        }

    Ugly coding, both in formatting and syntax (use MaxClients and indentation)


    PHP Code:
    public Action:Event_ItemPickUp(Handle:event, const String:name[], bool:dontBroadcast)
    {
        new 
    client GetClientOfUserId(GetEventInt(event"userid"));
        new 
    weaponname[MAX_NAME_LENGTH];
        
    GetEventString(event,"item",weaponname,sizeof(weaponname));
        if (
    StrContains(weaponname,"shotgun")>=|| StrContains(weaponname,"rifle") ||
            
    StrContains(weaponname,"smg_") || StrContains(weaponname,"grenade_launcher")){
            if (
    bHasLaser[client]) CheatCommand(client"upgrade_add""LASER_SIGHT");
        }

    Again very ugly code, also it wont work on anything but shotguns because you use "> -1" conditions like bools ...


    If you must abominate code like this, atleast remove my name from it
    AtomicStryker is offline
    V10
    Senior Member
    Join Date: Jan 2010
    Location: Russia
    Old 01-27-2010 , 09:41   Re: [L4D & L4D2] Laser Sights
    Reply With Quote #3

    Quote:
    Originally Posted by AtomicStryker View Post
    Oh dear D:
    Ugly coding, both in formatting and syntax (use MaxClients and indentation)
    2 ways to solve problem, they are both correct in this context, whether MaxClients or MAXPLAYERS, because no any reason to not set all array cells(time optimization, code optimization etc in OnRoundStart).
    PHP Code:
    new bool:bHasLaser[MAXPLAYERS+1]; 
    I did not change the author name because I did not write this plugin, I only corrected the bugs, that author had the to correct , who apparently did not check enough plugin before many people downloaded it.

    update:
    I have been correct the code so that you will be calmer, but he did not change almost nothing.
    Replaced "smg_" to "smg"

    PS
    In addition you can always correct the bugs of its own plugin. Then I would have deleted my post, so now it can remove by moderators if you deem it necessary =)

    Last edited by V10; 01-27-2010 at 20:37. Reason: correct text =)
    V10 is offline
    marvel
    BANNED
    Join Date: Dec 2009
    Old 04-28-2010 , 12:59   Re: [L4D & L4D2] Laser Sights
    Reply With Quote #4

    Thanks V10 I was looking for this one, appriciate it
    marvel is offline
    marvel
    BANNED
    Join Date: Dec 2009
    Old 04-30-2010 , 07:51   Re: [L4D & L4D2] Laser Sights
    Reply With Quote #5

    V10, ur lasersight is exploitable. One guy used it to spawn like 10.000 weapons and the server crashed
    marvel is offline
    solchi97
    New Member
    Join Date: May 2010
    Old 05-01-2010 , 22:36   Re: [L4D & L4D2] Laser Sights
    Reply With Quote #6

    Hello ther i dont know where to put the plugins can u tell me the place to put plugins 4 l4d2???
    solchi97 is offline
    DarrenToh
    Member
    Join Date: Mar 2010
    Old 05-02-2010 , 00:19   Re: [L4D & L4D2] Laser Sights
    Reply With Quote #7

    Can someone add a cvar, that always enables the laser? I want the laser ALL the time.
    DarrenToh is offline
    Visual77
    Veteran Member
    Join Date: Jan 2009
    Old 05-02-2010 , 09:53   Re: [L4D & L4D2] Laser Sights
    Reply With Quote #8

    Atomicstryker, could you add a delay to prevent !laser spam. Maybe a timer so everytime you type !laser, you can't do !laser again untill 5 seconds have passed. Why I want this is becuase there is an exploit going on when people bind sm_laser to a button, and they keep spawning 1000 guns till the server crashes.

    If you haven't tried it, it works like this. You add !laser to your weapon, you pick up a new weapon, you add !laser again and so fourth.
    By binding sm_laser you can do it without having to write anything. If your unlucky you get these ppl that just want to ruin the game.

    Last edited by Visual77; 05-02-2010 at 09:56.
    Visual77 is offline
    AtomicStryker
    Veteran Member
    Join Date: Apr 2009
    Location: Teutonia!!
    Old 05-02-2010 , 10:22   Re: [L4D & L4D2] Laser Sights
    Reply With Quote #9

    1.0.2 - added command cooldown and convar
    AtomicStryker is offline
    Visual77
    Veteran Member
    Join Date: Jan 2009
    Old 05-02-2010 , 10:34   Re: [L4D & L4D2] Laser Sights
    Reply With Quote #10

    It was really needed. Thank you!
    Visual77 is offline
    Reply



    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 18:59.


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