Raised This Month: $ Target: $400
 0% 

What wrong with this set task ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 12-11-2009 , 10:53   Re: What wrong with this set task ?
Reply With Quote #1

While reading your posts I came to conclusion that the plugin code is only a fragment and you can merge it yourself (if you can't then learn to post whole plugin and not only pieces), but it seems I was wrong.

You also posted fragment with cvar registration, so why can't you fix it yourself? This error is really easy to fix. If you are trying to learn scription and you have no motivation to learn how to debug errors on this level then I recommend you to stop scriptiong.

PHP Code:
#include <amxmodx>

new cvar_respawndelay
new cooldown_time[33]

public 
plugin_init( )
{
    
register_plugin("test""1.0""author")
    
register_event"DeathMsg""Event_DeathMsg""a" )
    
cvar_respawndelay register_cvar"berserker_respawndelay""15.0" 
}
 
public 
Event_DeathMsg( )
{
    new 
id read_data)
    
cooldown_timeid ] = get_pcvar_numcvar_respawndelay 
    
set_task1.0"ShowHUD"id__"a"cooldown_timeid ] )
}
 
public 
ShowHUDid )
{
    
cooldown_timeid ] = cooldown_timeid ] - 1;
    
set_hudmessage2552552550.750.9201.01.10.00.0, -)
    
show_hudmessageid"LaLaLa %d LaLaLa."cooldown_timeid ] ) 

__________________
Impossible is Nothing
Sylwester is offline
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 12-11-2009 , 19:59   Re: What wrong with this set task ?
Reply With Quote #2

@Sylwester
Is this
Code:
cooldown_time[ id ] = get_pcvar_num( cvar_respawndelay )
the same as
Code:
cooldown_time[ id ] = floatround( g_berserk_cooldown )
Excalibur.007 is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 12-11-2009 , 20:04   Re: What wrong with this set task ?
Reply With Quote #3

and what is g_berserk_cooldown?
__________________
Impossible is Nothing
Sylwester is offline
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 12-11-2009 , 20:17   Re: What wrong with this set task ?
Reply With Quote #4

Code:
new Float:g_berserk_cooldown = [time]
Excalibur.007 is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 12-12-2009 , 06:23   Re: What wrong with this set task ?
Reply With Quote #5

Of course you can use variable instead of cvar, but you will not be able to change it from game unless you add some code to make it possible. In this post I used defined value to store cooldown time.
__________________
Impossible is Nothing
Sylwester is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:30.


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