AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   problem with set_task (https://forums.alliedmods.net/showthread.php?t=224621)

maximus.toby 08-26-2013 11:58

problem with set_task
 
Hello Everyone
i am trying to make my Deathmatch day, but my set_task don't work!
he don't start my day but he give every 10 sec just the text"^4[^1Funday^4]^1 Deathmatch day will start in 10 seconds!")
it also don't start my day, can someone help me with this please,


PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#include <fun>
#include <colorchat>
#include <fakemeta>

#define PLUGIN "[Fa] Day: Dm"
#define VERSION "1.0"
#define AUTHOR "Sh0x"

forward jailbreak_day_start(dayid)
forward jailbreak_day_end()
native jailbreak_day_add(name[32], description[200], blockgunsweaponsurvivorblockdamage)

new 
intDayintMaxplayers

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Add: Day
    
intDay jailbreak_day_add("Deathmatch Day""Terrorists needs to kill each other, surviver wins"1011)
    
    
// Others
    
intMaxplayers get_maxplayers()
}
public 
jailbreak_day_start(dayid)
{
    
set_task(10.0"jailbreak_day_start")
    
ColorChat(0GREY"^4[^1Funday^4]^1 Deathmatch day will start in 10 seconds!")

    if(
dayid == intDay)
    {
        for(new 
1<= intMaxplayersi++)
        {
            if(
is_user_alive(i))
            {
                if(
cs_get_user_team(i) == CS_TEAM_T)
                {
                    
strip_user_weapons(i)

                    
give_item(i"weapon_m249")
                    
cs_set_user_bpammo(iCSW_M249400)
                
                        
                    
set_user_health(i400)
                }
            }
        }        
        
server_cmd("mp_friendlyfire 1")
    }
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1029\\ f0\\ fs16 \n\\ par }
*/ 


^SmileY 08-26-2013 12:28

Re: problem with set_task
 
set_task(10.0, "jailbreak_day_start")

What is dayid in jailbreak_day_start

??

set_task(10.0, "jailbreak_day_start",dayid)

maximus.toby 08-28-2013 15:38

Re: problem with set_task
 
stil not working, can someone els help me please! really wanne fix that ^^

aron9forever 08-28-2013 16:27

Re: problem with set_task
 
you got an infinite loop there mate
if you don't post the full plugin or at least the part that triggers jailbreak_day_start I can't help you

edit:: and if this is the whole plugin then it's horrible coding and can't easily be repaired


All times are GMT -4. The time now is 18:47.

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