View Single Post
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