AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Which command to turn on FF? (https://forums.alliedmods.net/showthread.php?t=13252)

fannymagnet 05-09-2005 15:03

Which command to turn on FF?
 
I'm after the command to turn Friendly Fire on and off. I want to write a script that turns it on for the last 10 seconds of the map (when it starts to count down) and then turn it off right at the end. Dunno which command to start with tho.

v3x 05-09-2005 15:07

From KRoT@L's original code (modified slightly):

Code:
#include <amxmodx> public check_timeleft() {     if(get_timeleft() == 11)     {         set_cvar_num("mp_friendlyfire",1)     }     if(get_timeleft() <= 1)     {         set_cvar_num("mp_friendlyfire",0)     } } public plugin_init() {     register_plugin("FF on map end", "0.1", "KRoTaL/v3x")     set_task(1.0, "check_timeleft", 12512, "", 0, "b") }
Try that.

Johnny got his gun 05-09-2005 16:16

Code:
set_task(10.0, "this_function_executed_when_ten_seconds_remain", 0, "", 0, "d")


All times are GMT -4. The time now is 16:46.

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