AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved spin my screen ? (https://forums.alliedmods.net/showthread.php?t=298981)

abdobiskra 06-28-2017 12:19

spin my screen ?
 
Hi
I'm looking for a function I've seen someone use them but I'm not sure if they are "ScreenShake" or no, But it does not work to shake the screen just spin my screen when some one attack me
You get it ? :) I hope that !

Natsheh 06-28-2017 13:23

Re: spin my screen ?
 
Yh moving player camera

PRoSToTeM@ 06-28-2017 17:12

Re: spin my screen ?
 
punchangle?

eyal282 06-29-2017 09:05

Re: spin my screen ?
 
PHP Code:


#include <amxmodx>
#include <hamsandwich>
#include <engine>

public plugin_init()
{
RegisterHam(Ham_TakeDamage"HamBurger_TakeDamage");
}

public 
HamBurger_TakeDamage(victim)
{
    new 
Float:ConfusedAngle[3];
    
    for(new 
i;3;i++ )
        
ConfusedAngle[i] = random_float(0.02000.0);
        
    
entity_set_vector(victimEV_VEC_punchangleConfusedAngle );


I suspect 2000 will be so powerful that in a knife fight the first player to stab the other will kill him so change it to be a random number from x.0 to y.0

Take note that Ham_TakeDamage has 5 parameters but I only need 1 at the moment. If you wish to get the attacker and damage, do this:

PHP Code:

public HamBurger_TakeDamage(victiminflictorattackerFloat:damage


Natsheh 06-29-2017 09:36

Re: spin my screen ?
 
random_float(-90.0, 90.0)

abdobiskra 06-29-2017 15:17

Re: spin my screen ?
 
thx guys

abdobiskra 06-30-2017 05:42

Re: spin my screen ?
 
Sorry but why do not you work with the dead player?
this what i try ? is there wrong
PHP Code:

#include <amxmodx>
#include <hamsandwich>
#include <engine>
#include <fakemeta>


public plugin_init(){
    
    
register_plugin("HL Death Style","0.0","abdobiskra")
    
    
RegisterHam(Ham_Killed,"player","fw_PlayerKilled"1)
    
RegisterHam(Ham_Spawn,"player","fw_PlayerSpawn"1)
    
    
register_forward(FM_AddToFullPack"fwFmAddToFullPack"1);
}

public 
fw_PlayerKilled(id)
{
    if(
is_user_alive(id))
        return
    
set_pev(idpev_punchangle, { 0.0,0.0,180.0 })
    
set_view(idCAMERA_3RDPERSON)
    
}

public 
fw_PlayerSpawn(id)
{
    
    if(!
is_user_alive(id))
        return
    
    
set_view(idCAMERA_NONE)
    
set_pev(idpev_punchangle, { 0.0,0.00.0 })
    
//entity_set_vector(id, EV_VEC_punchangle, Float: { 0.0, 0.0, 0.0});
}
public 
fwFmAddToFullPack(es_handleeenthostflagsplayerpSet)
{
    if (!
player || host != ent )
        return;
        
    
set_es(es_handleES_RenderModekRenderNormal



btw my ida to make similar like this :
https://www.youtube.com/watch?v=HIbsYrZvXbg

abdobiskra 07-02-2017 10:40

Re: spin my screen ?
 
bump

eyal282 07-02-2017 17:45

Re: spin my screen ?
 
When registering Ham_Killed, replace 1 with 0, might work though might fail.


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

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