Hello !
I request a modification of a plugin if it's possible.
I have a plugin, which request at the bomber where to plant the bomb :
Code:
#include <sourcemod>
#include <sdktools>
#include <cstrike>
public Plugin:myinfo =
{
name = "Bomb Site",
author = "AoT [!] Farzad",
description = "Displays a menu to the bomber to choose the bomb's destination.",
version = "1.0.0.0",
url = "http://www.aotclan.net/"
}
public OnPluginStart()
{
// Hook the spawn event
HookEvent("player_spawn", Event_Spawn);
}
public Event_Spawn(Handle:event,const String:name[],bool:dontBroadcast)
{
// Get the client id from the event
new client = GetClientOfUserId(GetEventInt(event, "userid"));
// Check if client is ingame and a terrorist
if (IsClientInGame(client) && GetClientTeam(client) == CS_TEAM_T)
{
CreateTimer(1.0, Timer_ShowMenu, GetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE);
}
}
public Action:Timer_ShowMenu(Handle:timer, any:userid)
{
new client = GetClientOfUserId(userid);
// Check if client is ingame and a terrorist
if (client && IsClientInGame(client) && IsPlayerAlive(client) && GetClientTeam(client) == CS_TEAM_T)
{
// Check to see if the player has the bomb
new ent = -1;
if ((ent = GetPlayerWeaponSlot(client, CS_SLOT_C4)) != -1)
{
if (!IsValidEntity(ent)) {
return Plugin_Stop;
}
new String:className[32];
GetEdictClassname(ent, className, sizeof(className));
// Secondary check, its not needed but better safe than sorry
if (StrEqual(className, "weapon_c4"))
{
// Open the menu
Menu_open(client);
}
}
}
return Plugin_Stop;
}
public Menu_open(client)
{
// Create the menu and send it
new Handle:BombMenu = CreateMenu(Menu_Selection);
SetMenuTitle(BombMenu, "Ou planter la Bombe ?");
AddMenuItem(BombMenu, "A", "Bombe Site A");
AddMenuItem(BombMenu, "B", "Bombe Site B");
DisplayMenu(BombMenu, client, 20);
}
public Menu_Selection(Handle:menu, MenuAction:action, param1, param2)
{
if (action == MenuAction_End)
{
CloseHandle(menu);
}
if (action == MenuAction_Select)
{
new String:info[32];
GetMenuItem(menu, param2, info, sizeof(info));
// Send the message to all the terrorists
for (new i = 1; i <= MaxClients; i ++)
{
if (IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == CS_TEAM_T)
{
PrintToChat(i, "\x05[Bombe Site]\x01: La Bombe doit etre plante sur le Bombe Site \x03[%s]\x01, suivez la Bombe et protegez la.", info);
}
}
}
}
I want, if it's possible, when the bomber choice a bomb site, the other bomb site was disabled. The bomber have 10s to choice (advert the timer in center message) And if he don't choice a bomb site, the plugin choice a random bomb site (timer: 10s)
I want to use this only on De_dust2 map.
example :
If i choice the bomb site A at round start, the bomb site B was been disabled.
And if i don't choice a bomb site, the plugin choice a random bomb site (timer: 10s)
Thx to you & sorry for my bad english.