AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED] pcvars + set_task + floats = confused :S (https://forums.alliedmods.net/showthread.php?t=77049)

minimiller 09-04-2008 08:10

[SOLVED] pcvars + set_task + floats = confused :S
 
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

Arkshine 09-04-2008 08:49

Re: pcvars + set_task + floats = confused :S
 
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...

minimiller 09-04-2008 09:54

Re: pcvars + set_task + floats = confused :S
 
FIXED
I looped through players ids rather than using id


All times are GMT -4. The time now is 03:07.

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