AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Example Plugin (https://forums.alliedmods.net/showthread.php?t=172154)

kramesa 11-16-2011 10:20

Example Plugin
 
Hi, because this plugin not compiling? And this example is correct?

PHP Code:

#include <amxmodx>
#include <amxmisc>

public plugin_init()

    
register_plugin("Example Plugin""0.1""")
}

public 
client_disconnect(id)
{
   new 
name[32], steamid[32]
   
   
get_user_name(idname31)
   
get_user_authid(idsteamid31)
   
   
set_task(30.1"Example"namesteam)
}

public 
Example(name[], steamid[])
{
  
server_print("SteamID: ^"%s^""steamid)
  
server_print("Name: ^"%s^""name)



Snaker beatter 11-16-2011 10:32

Re: Example Plugin
 
I found the error, look find the red colored leter here

Code:

        register_plugin("Example PLugin", "0.1", "")

kramesa 11-16-2011 10:33

Re: Example Plugin
 
Quote:

Originally Posted by Snaker beatter (Post 1597442)
I found the error, look find the red colored leter here

Code:

        register_plugin("Example PLugin", "0.1", "")

Lol?

Snaker beatter 11-16-2011 10:40

Re: Example Plugin
 
"" using this parameter will cause error to compile

drekes 11-16-2011 10:48

Re: Example Plugin
 
The problem is this:
PHP Code:

set_task(30.1"Example"namesteam

If you would have read the compiling error and searched or checked the funcwiki, you would have learned that those params don't match the ones expected by set_task.

kramesa 11-16-2011 11:04

Re: Example Plugin
 
Quote:

Originally Posted by drekes (Post 1597456)
The problem is this:
PHP Code:

set_task(30.1"Example"namesteam

If you would have read the compiling error and searched or checked the funcwiki, you would have learned that those params don't match the ones expected by set_task.

But, how i get the steam id and the name, of the client_disconnect?

drekes 11-16-2011 11:25

Re: Example Plugin
 
The steamid & name should work.
Like i said before, search about setting tasks. There's a tutorial for it.
Also the funcwiki explains how you should do it. Stop being lazy.

kramesa 11-16-2011 11:27

Re: Example Plugin
 
Quote:

Originally Posted by drekes (Post 1597487)
The steamid & name should work.
Like i said before, search about setting tasks. There's a tutorial for it.
Also the funcwiki explains how you should do it. Stop being lazy.

Hahaha, ok, thanks


All times are GMT -4. The time now is 08:28.

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