AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [L4D(2)] Pls help me crate plagin (https://forums.alliedmods.net/showthread.php?t=182085)

DaN1kyM 04-06-2012 07:09

[L4D(2)] Pls help me crate plagin
 
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;
        }
    }



nikooo777 04-06-2012 14:57

Re: [L4D(2)] Pls help me crate plagin
 
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

Powerlord 04-06-2012 16:43

Re: [L4D(2)] Pls help me crate plagin
 
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)

DaN1kyM 04-06-2012 17:49

Re: [L4D(2)] Pls help me crate plagin
 
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...

nikooo777 04-06-2012 20:36

Re: [L4D(2)] Pls help me crate plagin
 
player_team according to:
http://wiki.alliedmods.net/Left_4_Dead_2_Events

DaN1kyM 04-07-2012 12:17

Re: [L4D(2)] Pls help me crate plagin
 
Thank's dude U realy help me =)


All times are GMT -4. The time now is 09:17.

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