text
stringlengths 0
692
|
---|
return PLUGIN_HANDLED; |
} |
// TraceModel |
// This tutorial makes one line to where you are aiming. The color of the line depends on the model you hit. |
public tut_TraceModel(id) |
{ |
static Float:origin[3]; |
static Float:aim[3]; |
static Float:point[3]; |
static class[STR]; |
static text[LOG]; |
static ent; |
static const tr = 0; |
pev(id, pev_origin, origin); |
pev(id, pev_view_ofs, aim); |
xs_vec_add(origin, aim, origin); |
fm_get_aim_origin(id, aim); |
// Multiply vector to make it larger |
xs_vec_sub(aim, origin, aim); |
xs_vec_mul_scalar(aim, 2.0, aim); |
for(ent=g_maxClients+1; ent<g_maxEntities; ent++) |
{ |
if(!pev_valid(ent)) |
continue; |
pev(ent, pev_classname, class, charsmax(class)); |
if(equal(class, "weaponbox") || equal(class, "armoury_entity") || equal(class, "player") |
|| equal(class, "func_breakable") || equal(class, "func_door")) |
{ |
engfunc(EngFunc_TraceModel, origin, aim, HULL_POINT, ent, tr); |
if((ent > 0) && (get_tr2(tr, TR_pHit) == ent)) |
{ |
fn_log_cli(id, "TraceModel", DIVISOR); |
formatex(text, charsmax(text), "Found model by aim (ent:%i class:%s)", ent, class); |
fn_log_cli(id, "TraceModel", text); |
get_tr2(tr, TR_vecEndPos, point); |
fn_create_beam(origin, point, 60, 0, 255, 0); // Create green line from ID to hit point for 60 seconds |
} |
} |
} |
return PLUGIN_HANDLED; |
} |
Fakemeta function : |
Code: |
EngFunc_AlertMessage |
Description : |
Prints an alert message. |
Usage: |
Code: |
engfunc(EngFunc_AlertMessage, AlertType, const Message) |
AlertType can be: |
at_notice - |
at_console - same as at_notice, but forces a ConPrintf, not a message box, prints output to server console, but only if 'developer' is 1. |
at_aiconsole - same as at_console, but only shown if 'developer' is 2. |
at_warning - |
at_error - |
at_logged - prints output to server logs and console. |
Fakemeta function : |
Code: |
EngFunc_AnimationAutomove |
Description : |
Plays the selected animation on entity |
Usage : |
Code: |
entity_set_float(iEnt, EV_FL_framerate, fFrameRate); |
entity_set_int(iEnt, EV_INT_sequence, iSequence); |
engfunc(EngFunc_AnimationAutomove, iEnt, fTime); |
Parameters |
fFrameRate = Frame rate of desired animation. |
iSequence = Sequence to play. |
iEnt = Source entity. |
fTime = It seems to not affect the animation. Maybe for internal use. |
First you have to select the sequence and the desired frame rate. Then you can start the animation. |
It will run in an endless loop. |
It seems to work only on non-player entities |
__________________ |
Fakemeta function: |
PHP Code: |
EngFunc_CheckVisibility |
Description: |
This function is used to check if an entity is in your PVS. |
It can be used on all entities except worldspawn! |
Here I will show you how to use is, since this function has a paramater that must be obtained in a special way! |
Subsets and Splits