AlliedModders

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

JohnBloper 07-22-2014 11:12

origin
 
How can I do that the player origin wont be exactly where he died. It will be a bit more left, or right.
Is that possible? and how
PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new FloatfPlayerOrigins
    
    
public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Killed"player""CBasePlayer_Killed"false);
}

public 
CBasePlayer_Killed victim 
{
    if(!
is_user_connected(victim))
        return;
    
    new 
CsTeamsTeam cs_get_user_team(victim)
    
    if ( 
Team == CS_TEAM_CT 
    {
    
        
pev(victimpev_originfPlayerOrigins);
        
//here you would exec the command
    
}



HamletEagle 07-22-2014 11:21

Re: origin
 
You could ask in the same theard where I gave you this code. To move it increase x,y or z axis just a bit.

Increase y axis tu put him a bit into the air. Modify x axis to move him left/right.

fPlayerOrigins[ 0 ] - x axis
fPlayerOrigins[ 1 ] - y axis
fPlayerOrigins[ 2 ] - z axis

JohnBloper 07-22-2014 11:25

Re: origin
 
Quote:

Originally Posted by HamletEagle (Post 2171872)
You could ask in the same theard where I gave you this code. To move it increase x,y or z axis just a bit.

Increase y axis tu put him a bit into the air. Modify x axis to move him left/right.

fPlayerOrigins[ 0 ] - x axis
fPlayerOrigins[ 1 ] - y axis
fPlayerOrigins[ 2 ] - z axis.

I really didnt understand how. Could you give me a example in the full code? Thanks if can.

Flick3rR 07-22-2014 13:15

Re: origin
 
(Gladely search, it's a clear math :O)
They are basically the three dimensions - height, lenght, width.


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

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