Raised This Month: $ Target: $400
 0% 

[REQ] sm_delayed like on ES


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
spancer35
Senior Member
Join Date: Dec 2014
Location: City 17
Old 01-23-2016 , 18:28   [REQ] sm_delayed like on ES
Reply With Quote #1

Hi guys i found this plugin (https://forums.alliedmods.net/showthread.php?t=134288) but this plugin work with min. but i need second. method any one can edit this plugin or make a better plugin than this.


and sorry for my bad english
spancer35 is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 01-23-2016 , 19:19  
Reply With Quote #2

PHP Code:
#include <sourcemod>
#include <sdktools>
#define PLUGIN_VERSION "1.2.0_sec"


public Plugin:myinfo 
{
    
name "Command Time-Traveler",
    
author "DarthNinja",
    
description "Run commands in future... NOW!",
    
version PLUGIN_VERSION,
    
url "DarthNinja.com"
}

public 
OnPluginStart()
{
        
RegAdminCmd("sm_future"CmdFutureADMFLAG_ROOT);
        
CreateConVar("sm_futureexe_version"PLUGIN_VERSION"Plugin Version"FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
}

public 
Action:CmdFuture(clientargs)
{
    if (
args != 2)
    {
        
ReplyToCommand(client"[SM] Usage: sm_future <Time in seconds> \"Command +Args\"");
        return 
Plugin_Handled;    
    }
    
decl String:Fcmd[255];
    
decl String:time_S[25];
    
GetCmdArg(1time_Ssizeof(time_S));
    
GetCmdArg(2Fcmdsizeof(Fcmd));
    
ShowActivity2(client"[SM] ","Executing \"%s\" in %s seconds"Fcmdtime_S);
    new 
Float:time_float;
    
time_float StringToFloat(time_S);
    
    
decl String:name[255]
    
decl String:steamid[255]
    if (
client != 0)
    {
        
GetClientName(clientnamesizeof(name));
        
GetClientAuthString(clientsteamidsizeof(steamid));
    }
    else if (
client == 0)
    {
        
strcopy(namesizeof(name), "CONSOLE");
        
strcopy(steamidsizeof(steamid), "CONSOLE");
    }
    
LogAction(client, -1"%L used Future-Execute to execute command %s in %s seconds."clientFcmdtime_S); //log
    //Fix quotes
    
ReplaceString(Fcmdsizeof(Fcmd), "'","\"")
    
    new 
Handle:pack
    CreateDataTimer
(time_floatTimer_FUExecpack)
    
WritePackString(packname); //Client's name
    
WritePackString(packsteamid); //Client's steamid
    
WritePackString(pack,Fcmd); //command + args
    
WritePackString(pack,time_S); //time as string
    
return Plugin_Handled;
}


public 
Action:Timer_FUExec(Handle:timerHandle:pack)
{
    
decl String:cmd[255]
    
decl String:time[25]
    
decl String:name[255]
    
decl String:steamid[255]
    
    
ResetPack(pack)
    
ReadPackString(packnamesizeof(name))
    
ReadPackString(packsteamidsizeof(steamid))
    
ReadPackString(packcmdsizeof(cmd))
    
ReadPackString(packtimesizeof(time))
    
    
LogAction(-1,-1,"\"%s\"(%s) used Future-Execute to execute command %s: Called %s seconds ago."namesteamidcmdtime); //log
    
ServerCommand("%s"cmd)
    
    return 
Plugin_Stop;

__________________
Grey83 is offline
spancer35
Senior Member
Join Date: Dec 2014
Location: City 17
Old 01-24-2016 , 08:13   Re: [REQ] sm_delayed like on ES
Reply With Quote #3

Quote:
Originally Posted by Grey83 View Post
PHP Code:
#include <sourcemod>
#include <sdktools>
#define PLUGIN_VERSION "1.2.0_sec"


public Plugin:myinfo 
{
    
name "Command Time-Traveler",
    
author "DarthNinja",
    
description "Run commands in future... NOW!",
    
version PLUGIN_VERSION,
    
url "DarthNinja.com"
}
Much thanks m8I'll try it
public OnPluginStart()
{
        RegAdminCmd("sm_future", CmdFuture, ADMFLAG_ROOT);
        CreateConVar("sm_futureexe_version", PLUGIN_VERSION, "Plugin Version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
}

public Action:CmdFuture(client, args)
{
    if (args != 2)
    {
        ReplyToCommand(client, "[SM] Usage: sm_future <Time in seconds> \"Command +Args\"");
        return Plugin_Handled;    
    }
    decl String:Fcmd[255];
    decl String:time_S[25];
    GetCmdArg(1, time_S, sizeof(time_S));
    GetCmdArg(2, Fcmd, sizeof(Fcmd));
    ShowActivity2(client, "[SM] ","Executing \"%s\" in %s seconds", Fcmd, time_S);
    new Float:time_float;
    time_float = StringToFloat(time_S);
    
    decl String:name[255]
    decl String:steamid[255]
    if (client != 0)
    {
        GetClientName(client, name, sizeof(name));
        GetClientAuthString(client, steamid, sizeof(steamid));
    }
    else if (client == 0)
    {
        strcopy(name, sizeof(name), "CONSOLE");
        strcopy(steamid, sizeof(steamid), "CONSOLE");
    }
    LogAction(client, -1, "%L used Future-Execute to execute command %s in %s seconds.", client, Fcmd, time_S); //log
    //Fix quotes
    ReplaceString(Fcmd, sizeof(Fcmd), "'","
\"")
    
    new 
Handle:pack
    CreateDataTimer
(time_floatTimer_FUExecpack)
    
WritePackString(packname); //Client's name
    
WritePackString(packsteamid); //Client's steamid
    
WritePackString(pack,Fcmd); //command + args
    
WritePackString(pack,time_S); //time as string
    
return Plugin_Handled;
}


public 
Action:Timer_FUExec(Handle:timerHandle:pack)
{
    
decl String:cmd[255]
    
decl String:time[25]
    
decl String:name[255]
    
decl String:steamid[255]
    
    
ResetPack(pack)
    
ReadPackString(packnamesizeof(name))
    
ReadPackString(packsteamidsizeof(steamid))
    
ReadPackString(packcmdsizeof(cmd))
    
ReadPackString(packtimesizeof(time))
    
    
LogAction(-1,-1,"\"%s\"(%s) used Future-Execute to execute command %s: Called %s seconds ago."namesteamidcmdtime); //log
    
ServerCommand("%s"cmd)
    
    return 
Plugin_Stop;

spancer35 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:48.


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