AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Repeat Shake Screen and crash server (https://forums.alliedmods.net/showthread.php?t=294493)

VINAGHOST 02-28-2017 07:55

Repeat Shake Screen and crash server
 
When I chat /heroin i got a error "Host_Error WriteDest_Parm not a client"
And this is my code:
PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN "HEROIN"
#define VERSION "1.0"
#define AUTHOR "VINAGHOST"


#define    HRI 156


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /heroin""buyheroin");
    
register_clcmd("say_team /heroin""buyheroin");    
}

public 
buyheroin(id)
{    
    if( !
is_user_alive(id))
    {
        
client_print(id,print_chat"You died ==!")
        return 
PLUGIN_CONTINUE;
    }
    if( 
cs_get_user_money(id) < 10000 )
    {
        
client_print(id,print_chat"You don't have enough money ==")
        return 
PLUGIN_CONTINUE;
    }
        
    
cs_set_user_money(idcs_get_user_money(id) - 10000)
    new 
di[1]
    
di[0] = id
    set_task
(10.0"shake"HRI iddi,1,_,1)
    
    return 
PLUGIN_HANDLED
    
}
public 
shake(di[])
{
    new 
id str_to_num(di)
    
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("ScreenShake"), {0,0,0}, id)  // Shake Screen
    
write_short(1<<14)
    
write_short(1<<14)
    
write_short(1<<14)
    
message_end()  
}
public 
client_connect(id)
{
    
remove_task(HRI id)
    return 
PLUGIN_HANDLED
}

public 
client_disconnect(id)
{
    
remove_task(HRI id)
    return 
PLUGIN_HANDLED
}

public 
death()
{
    new 
id read_data(2)    
    
remove_task(HRI id)


so how could I repeat shaking screen player ?

Sorry for my bad English ._.

yas17sin 02-28-2017 08:25

Re: Repeat Shake Screen and crash server
 
i think that's problem are for non-steamers only.

killerZM 02-28-2017 08:25

Re: Repeat Shake Screen and crash server
 
set_pev(id , pev_pushangle , number)

OciXCrom 02-28-2017 08:58

Re: Repeat Shake Screen and crash server
 
Wtf is that task?

PHP Code:

set_task(10.0"shake"id HRI, .flags "b")

public 
shake(id)
{
    
id -= HRI 


EFFx 02-28-2017 11:22

Re: Repeat Shake Screen and crash server
 
I did not see any problem with the task you said OciXCrom

OciXCrom 02-28-2017 13:11

Re: Repeat Shake Screen and crash server
 
Well, try it. I assure you that the server will crash.

PRoSToTeM@ 02-28-2017 14:37

Re: Repeat Shake Screen and crash server
 
new id = str_to_num(di)
->
new id = di[0]

VINAGHOST 03-02-2017 08:00

Re: Repeat Shake Screen and crash server
 
Quote:

Originally Posted by killerZM (Post 2499355)
set_pev(id , pev_pushangle , number)

i can't see pev_pushangle in fakemeta_const.inc. So could you check again for me ._.

Quote:

Originally Posted by PRoSToTeM@ (Post 2499497)
new id = str_to_num(di)
->
new id = di[0]

i have used it and not working "."

Quote:

Originally Posted by OciXCrom (Post 2499361)
Wtf is that task?
PHP Code:

set_task(10.0"shake"id HRI, .flags "b")

public 
shake(id)
{
    
id -= HRI 


i never used that code

OciXCrom 03-02-2017 08:34

Re: Repeat Shake Screen and crash server
 
Lol. I'm telling you how to do it, not how you did it.


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

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