AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Latenightcup Screenshot System (https://forums.alliedmods.net/showthread.php?t=40241)

xeonn 06-25-2006 08:32

Latenightcup Screenshot System
 
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <core>


Code:

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <core>


public plugin_init(){
    register_plugin("LNCCSS","1.0","xeoN")
    register_clcmd("amx_screenshot","screenshot",ADMIN_SLAY,"<authid, nick or #userid>")
    register_cvar("amx_screentime","3.0")
        set_task(2.0,"resetview",id)
        set_task( get_cvar_float("amx_screentime"), "screenshot", id)
    }

public resetview(id){
    attach_view(id,id);
    }
public screenshot(id,level,cid){
    if(cmd_access(id,level,cid,2)){
            new arg[32], player
            read_argv(1,arg,31)
            player=cmd_target(id,arg,6)
                if(player){
                        attach_view(id,player)
                        client_cmd(id,"snapshot")
              }
        }
    }
public client_connect(id){
    client_print(id, print_console, "Latenightcup Screenshot System is loaded.")
    return 1
}

If i type: /amx_screentime 180 ; it will make a screenshot of EVERY player in the game on every 3 minutes
If i type /amx_screenshot X ; it will make a screenshot of the player X

But the script wont load, need help :cry:

xeonn 06-25-2006 10:24

Re: Latenightcup Screenshot System
 
anyone ?

rain 06-25-2006 11:43

Re: Latenightcup Screenshot System
 
Take a look here: http://forums.alliedmods.net/showthread.php?t=29637
And do a search for 'attach_view()' usage.

Apart from it, plugin_init() is buggy with the 'id' variable usage.

xeonn 06-25-2006 12:15

Re: Latenightcup Screenshot System
 
Quote:

Originally Posted by rain
Take a look here: http://forums.alliedmods.net/showthread.php?t=29637
And do a search for 'attach_view()' usage.

Apart from it, plugin_init() is buggy with the 'id' variable usage.

Thnx for your reply, but im just new to the AMXMODX coding, can you explain it a little further?

rain 06-25-2006 12:25

Re: Latenightcup Screenshot System
 
The first thing: You can't use attach_view() on players. You have to create an entity which will follow the player, just remember about the unrendered model. Then attach_view() to it.

The id thing:
set_task(2.0,"resetview",id)
set_task( get_cvar_float("amx_screentime"), "screenshot", id)

This doesn't make sense. There is no id variable known at this time.

xeonn 06-25-2006 15:33

Re: Latenightcup Screenshot System
 
It wont work, i just want command to set the timer that makes a screenshot of everyplayer in the game.


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

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