Raised This Month: $156 Target: $400
 39% 

[L4D(2)] Pls help me crate plagin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DaN1kyM
Junior Member
Join Date: Apr 2012
Location: Russia =)
Old 04-06-2012 , 07:09   [L4D(2)] Pls help me crate plagin
Reply With Quote #1

Pls help me crate plagin for me i'm Rus and i bad spoke english and i bad scripter))

I needed how player's WIN company who Alive getting him Spectate team and immediately changed the company to the next

I think this plagin should look something like this:

thanks in advance ! =)

PHP Code:
#include <sourcemod>
#include <sdktools>

#define PLUGIN_VERSION "0.0"

public Plugin:myinfo 
{
    
name "",
    
author "",
    
description "",
    
version PLUGIN_VERSION,
    
url ""
}

public 
OnPlaginStart()
{
    
HookEvent("finale_win"Event_finale_win)
}

public 
Action:Event_finale_win(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
maxplayers GetMaxClients();
    for (new 
18<= maxplayersi++)
    {
        if (
IsPlayerAlive(i))
        {
          (
GetClientTeam(i) == 1)
           return;
        }
    }

DaN1kyM is offline
nikooo777
AlliedModders Donor
Join Date: Apr 2010
Location: Lugano, Switzerland
Old 04-06-2012 , 14:57   Re: [L4D(2)] Pls help me crate plagin
Reply With Quote #2

Hello, i don't really understand what you want the code to do, but there is surely a big error in the code.

it's called "Plugin" not "Plagin" so the main is not executed. it should be:
Quote:
public OnPluginStart()
{
also in the last part of the code you're checking for every players, starting from index 18 (which should be 1) if the player is alive, if that's true you read the team he is into and try to compare it, which i guess it's not what you want.

instead i think you want to use this:
Quote:
ChangeClientTeam(client, team);
the indexes for the teams are here:

Quote:
Team indexes:

1 = Spectate
2 = RED / Terrorists
3 = BLU / Counter-Terrorists
hence it would look like:
Quote:
if (IsPlayerAlive(i))
{
ChangeClientTeam(i, 1);
}
i hope that helps
__________________

Last edited by nikooo777; 04-06-2012 at 14:57.
nikooo777 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 04-06-2012 , 16:43   Re: [L4D(2)] Pls help me crate plagin
Reply With Quote #3

Team indexes:

0 = Unassigned, All Players (HL2DM)
1 = Spectator
2 = Combine (HL2DM mp_teamplay 1), Allies (DoD:S), Terrorists (CSS), RED (TF2), Survivors (L4D/L4D2)
3 = Rebels (HL2DM mp_teamplay 1), Axis (DoD:S), Counter-Terrorists (CSS), BLU (TF2), Infected (L4D/L4D2)
__________________
Am I back? Well, we'll see.
Powerlord is offline
DaN1kyM
Junior Member
Join Date: Apr 2012
Location: Russia =)
Old 04-06-2012 , 17:49   Re: [L4D(2)] Pls help me crate plagin
Reply With Quote #4

IT'S FUCKING WORKING YAHOOO !!! Big thank's guy's for index and explain me =)

How name event ? which is responsible for the action "is changing the company"

P.S Google translate shit...

Last edited by DaN1kyM; 04-06-2012 at 19:13.
DaN1kyM is offline
nikooo777
AlliedModders Donor
Join Date: Apr 2010
Location: Lugano, Switzerland
Old 04-06-2012 , 20:36   Re: [L4D(2)] Pls help me crate plagin
Reply With Quote #5

player_team according to:
http://wiki.alliedmods.net/Left_4_Dead_2_Events
__________________
nikooo777 is offline
DaN1kyM
Junior Member
Join Date: Apr 2012
Location: Russia =)
Old 04-07-2012 , 12:17   Re: [L4D(2)] Pls help me crate plagin
Reply With Quote #6

Thank's dude U realy help me =)
DaN1kyM 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 15:15.


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