AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help me plugin (https://forums.alliedmods.net/showthread.php?t=276118)

alex4301 12-15-2015 12:39

Help me plugin
 
Quote:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN ""
#define VERSION "1.0"
#define AUTHOR ""

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

set_task(3000, "slapon3000", id, "", 0, "a", 50)
}
public slapon3000(id)
{

New name[32]
Get_user_name(id,name,31)
server_cmd(amx_slap %d",nume)

}
what is wrong... ?

Depresie 12-15-2015 13:07

Re: Help me plugin
 
This is wrong ( market with the red )
You want to call a task on a person, in a function that is not called on a person, but when the plugin is loaded
What are you trying to do exactly?

Code:

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)

set_task(3000, "slapon3000", id, "", 0, "a", 50)   
}


alex4301 12-15-2015 13:21

Re: Help me plugin
 
You can fix this plugin? please

Depresie 12-15-2015 13:26

Re: Help me plugin
 
if you tell me what it is supposed to do...

alex4301 12-15-2015 13:39

Re: Help me plugin
 
must give everyone the player to execute the command every 3,000 seconds.

Depresie 12-15-2015 14:01

Re: Help me plugin
 
so you want to execute a command on all players at the same time every 3000 seconds?

OciXCrom 12-15-2015 14:30

Re: Help me plugin
 
Why use server_cmd with slap? Use user_slap with id. Your plugin will not always work like that.

PHP Code:

#include <amxmodx>
#include <amxmisc>

#define TASK_SLAP 545543
#define TIME_SLAP 3000.0

public plugin_init()
    
register_plugin("Auto Slap on X Seconds""1.0""OciXCrom")

public 
client_putinserver(id)
{
    new 
TASK TASK_SLAP id
    
if(task_exists(TASK)) remove_task(TASK)
    
set_task(TIME_SLAP"slapEveryone"TASK__"b")
}

public 
slapEveryone(TASK)
{
    new 
id TASK TASK_SLAP
    user_slap
(id0)




All times are GMT -4. The time now is 18:16.

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