Raised This Month: $ Target: $400
 0% 

[SOLVED] pcvars + set_task + floats = confused :S


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 09-04-2008 , 08:10   [SOLVED] pcvars + set_task + floats = confused :S
Reply With Quote #1

PHP Code:
new vip_advertisetime;

public 
plugin_init()
{
    
vip_advertisetime register_cvar("amx_advertisetime""10.0");
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1);
}

public 
fwHamPlayerSpawnPost(id)
{
    static 
Float:AdvertiseTime;
    
AdvertiseTime get_pcvar_float(vip_advertisetime);
    
    
advertise_vip(id)
    
set_task(get_pcvar_float(AdvertiseTime), "advertise_vip"id// <--- This is the line that gets the error
}

public 
client_disconnect(id)
{
    
remove_task(id)
}

public 
advertise(id)
{
    
client_print(idprint_chat"Hi"

This gives me a warning:
Quote:
C:\Users\Stu\Desktop\other\Stu's plugins\VIP.sma(71) : warning 213: tag mismatch
Ive never used floats before, and aparently i cant anyway xD
__________________

Last edited by minimiller; 09-04-2008 at 10:04.
minimiller is offline
Send a message via MSN to minimiller
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-04-2008 , 08:49   Re: pcvars + set_task + floats = confused :S
Reply With Quote #2

Code:
AdvertiseTime = get_pcvar_float(vip_advertisetime);
Quote:
get_pcvar_float(AdvertiseTime)
Really you don't see nothing wrong ? You retrieve the right value and you still use get_pcvar_float() again with this value...


Code:
"advertise_vip"
Code:
public advertise(id)
Not the same function...
__________________
Arkshine is offline
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 09-04-2008 , 09:54   Re: pcvars + set_task + floats = confused :S
Reply With Quote #3

FIXED
I looped through players ids rather than using id
__________________

Last edited by minimiller; 09-04-2008 at 10:03.
minimiller is offline
Send a message via MSN to minimiller
Reply


Thread Tools
Display Modes

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 03:07.


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