AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Do something after client joined team.. (https://forums.alliedmods.net/showthread.php?t=48471)

Br41n 12-12-2006 14:27

Do something after client joined team..
 
Hi,
i want to do something, when a player joined a team.. but it doesn't work.. it's my first plugin and I never coded with C++, but i read the documentation with the basics of pawn..

My Code:
PHP Code:

public client_putinserver id ) {
    
// on join say hello to all
    
    
client_cmd(id"say hi")
    
    return 
PLUGIN_HANDLED


It doesn't work... I'm sure, that i did something wrong, but i don't know, what... Do I have to use set_task or do I have to set the variable "id"?

Thanks
Br41n

The Specialist 12-12-2006 15:00

Re: Do something after client joined team..
 
try this
Code:
    #include <amxmodx> #include <amxmisc> #define PLUGIN "New Plugin" #define VERSION "1.0" #define AUTHOR "Author" public plugin_init() {  register_plugin(PLUGIN, VERSION, AUTHOR)    // Add your code here... } public client_putinserver(id) {  client_print(id,print_chat,"Hello I Just Joined"); }

VEN 12-12-2006 15:23

Re: Do something after client joined team..
 
You can catch the TextMsg #Game_join_ct and #Game_join_terrorist (2nd arg) using register_event

The Specialist 12-12-2006 15:26

Re: Do something after client joined team..
 
Ven is always full of usefull info :)

Br41n 12-12-2006 16:03

Re: Do something after client joined team..
 
Hey... thanks guys... i got it working:

Code:

public client_putinserver ( id ) {
        // on join display vote
       
        set_task(3.0,"showBindMenu",id)
        return PLUGIN_CONTINUE
}

Now i can use every function..

Thanks
Br41n


All times are GMT -4. The time now is 06:51.

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