Hi,
I'm doing little plugin, but there is a somewhat larger problems with the code. This is my code:
Code:
#include <sourcemod>
#include <sdktools>
#define CS_TEAM_CT 3
#define CS_TEAM_T 2 /**< Terrorists. */
#define GAMEOVER_SOUND "zombieapocalypse.mp3"
public Plugin:myinfo =
{
name = "Zombie Apocalypse",
author = "Fastmancz",
description = "Zombie Apocalypse",
version = "1.0",
url = "http://www.twse.cz/"
};
//HP regeneration - https://forums.alliedmods.net/showthread.php?p=500636
public OnMapStart()
{
AddFileToDownloadsTable("sound/cmg/zombieapocalypse.mp3");
}
public OnPluginStart()
{
RegConsoleCmd("sm_zombie", zombie,"Zombie");
}
stock FakePrecacheSound( const String:szPath[] )
{
AddToStringTable( FindStringTable( "soundprecache" ), szPath );
}
public Action:zombie(client, args)
{
if (GetClientTeam(client) == CS_TEAM_CT)
{
if (IsPlayerAlive(client))
{
PrintToChatAll("\x04[TWSE APOCALYPSE]\x01\x0B\x01Na TWSE zautocil Zombie virus a dostal se na Jail!!!", client);
ServerCommand("sm_hsay TWSE ZOMBIE APOCALYPSE ZACALA A NEDÁ SE ZASTAVIT!!!");
decl String:buffer[256];
EmitSoundToAll("play *cmg/zombieapocalypse.mp3");
AddFileToDownloadsTable(buffer);
PrecacheSound(GAMEOVER_SOUND);
ServerCommand ("sm_blind @all 230");
GivePlayerItem(client, "weapon_negev");
}
if (GetClientTeam(client) == CS_TEAM_T)
{
SetEntProp( client, Prop_Send, "m_iHealth", 1000 );
SetEntProp( client, Prop_Send, "m_iMaxHealth", 1000 );
}
}
Thank you GsiX and MasterOfTheXP for help.
1a.) Music does not start.
PHP Code:
EmitSoundToAll("play *cmg/zombieapocalypse.mp3");
1b.) Music start only for me.
PHP Code:
ClientCommand(client, "play *cmg/zombieapocalypse.mp3");
2.) This command has put all (CT) gun "negev". It's Not. The weapon negev give only for me.
PHP Code:
GivePlayerItem(client, "weapon_negev");
3.) The terrorists have to get 1000 HP. Not work.
PHP Code:
if (GetClientTeam(client) == CS_TEAM_T)
{
SetEntProp( client, Prop_Send, "m_iHealth", 1000 );
SetEntProp( client, Prop_Send, "m_iMaxHealth", 1000 );
}
Therefore, I ask, how can I do to make weapons or HP got all (CT or T)?
My plugin works right for individuals (not for all, but where is problem?).
Thank you for all the answers.