AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   passing id through set_task (https://forums.alliedmods.net/showthread.php?t=94482)

stigma 06-11-2009 19:21

passing id through set_task
 
Code:

#include <amxmodx>
#include <amxmisc>
#include <fun>

new energy[33];

public plugin_init() {
        register_plugin(PLUGIN, VERSION, AUTHOR)
       
        return PLUGIN_CONTINUE
}
public client_putinserver(id) {

        //Welcome message
        new cName[33]
        get_user_name(id,cName,32)
        client_print(0,print_chat,"Velkommen %s",cName)
       
        set_task(6.0,"showPool",0,_,_,"b")
        set_task(3.0,"addEnergy",0,_,_,"b")
       
        return PLUGIN_CONTINUE
}

public addEnergy(id) {
        energy[id] += 1
       
        new cName[33]
        get_user_name(id,cName,32)
       
        client_print(0,print_chat,"UN:%s",cName)
}

When the server prints text, i does not show the actual name, it shows "Counter-Strike" as if it's getting the servername instead of the player name.

I've roughly searched the forum whitout any result... i would be more than glad for any help. :)

Bugsy 06-11-2009 19:25

Re: passing id through set_task
 
set_task(6.0,"showPool",id,_,_,"b")
set_task(3.0,"addEnergy",id,_,_,"b")

Are you intending on looping this constantly or do you want it called just once?

stigma 06-11-2009 19:28

Re: passing id through set_task
 
looping :)

ooh i just thought that a 0 would pass the id :/

Thanks for the prompt answer


All times are GMT -4. The time now is 13:57.

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