|
Senior Member
|
12-21-2015
, 13:22
Re: [CS:GO] Random bomb give ?
|
#2
|
Quote:
Originally Posted by valio_skull
I have this plugin that doesn't allow terrorists to plant the bomb until the last minute:
PHP Code:
#pragma semicolon 1 #include <sourcemod> #include <cstrike> #include <sdktools> #include <sdkhooks>
#define LAST_C4_TIME 60
float g_flNextC4PlantTime;
public void OnPluginStart() { HookEvent("round_start", OnRoundStart, EventHookMode_Post); }
public void OnRoundStart(Event event, const char[] name, bool dontBroadcast) { g_flNextC4PlantTime = GetGameTime() + float(GameRules_GetProp("m_iRoundTime") - LAST_C4_TIME); }
public Action OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon, &subtype, &cmdnum, &tickcount, &seed, mouse[2]) { if (IsPlayerAlive(client)) { if (GetEntPropEnt(client, Prop_Data, "m_hActiveWeapon") == GetPlayerWeaponSlot(client, CS_SLOT_C4) && GetGameTime() < g_flNextC4PlantTime) { PrintHintText(client, "<font color='00ff00'>You can't plant the bomb until the last minute of the round.</font>"); if (buttons & IN_ATTACK) { buttons &= ~IN_ATTACK; } if (buttons & IN_USE) { buttons &= ~IN_USE; } if (GetGameTime() == 60) { PrintHintTextToAll("<font color='#00ff00'><b>You can plant the bomb.</b></font>"); } } } }
But I need it to give the bomb to a random player in the last 60 seconds.
Thanks
EDIT: I need it to announce through PrintHintText who got the bomb
|
for loop for all client index and GetRandomInt and GiveBomb??
__________________
Perhaps my lack of faith was my undoing,
Last edited by bally; 12-21-2015 at 13:22.
|
|
|
|