Raised This Month: $7 Target: $400
 1% 

Showing results 1 to 25 of 500
Search took 0.02 seconds.
Search: Posts Made By: Emp`
Forum: Code Snippets/Tutorials 07-19-2017, 18:41
Replies: 40
Views: 34,075
Posted By Emp`
Re: [INC] Beam Entities

This might be a helpful alternative:
stock get_distance_to_line(Float:pos_start[3], Float:pos_end[3], Float:pos_object[3])
{ //credits to KoST
new Float:vec_start_end[3],...
Forum: Code Snippets/Tutorials 03-15-2017, 12:28
Replies: 7
Views: 2,005
Posted By Emp`
Re: Some simple solutions

Seems to be lacking some key knowledge on tags, arrays, and globals.

I'm going to close this thread as it will probably lead to more confusion/arguing. For understanding the issues, see other...
Forum: Scripting Help 02-22-2017, 12:09
Replies: 15
Views: 2,177
Posted By Emp`
Re: Trigger function with % chance

stock bool Chance( iNum, iMult=100 )
return ( iNum * iMult >= random_num( 1, 100 * iMult ) );

if ( Chance( 5 ) )
{
//...
}
Forum: Code Snippets/Tutorials 02-21-2017, 23:12
Replies: 41
Views: 10,886
Posted By Emp`
Re: [INC/STOCK] menu_set_timeout

Yes (https://github.com/Geesu/wc3mods/blob/master/war3ft/war3ft/constants.inl), the taskids are TASK_* + player. Note -1 is unnecessary.

Tracking taskids is important if you need change_task...
Forum: Scripting Help 02-20-2017, 11:14
Replies: 28
Views: 4,429
Posted By Emp`
Re: menu for x secondes

Missed that part. :crab:

Here is a small clean up on your code:

#if defined _menutime_included
#endinput
#endif

#define _menutime_included
Forum: Scripting Help 02-18-2017, 12:34
Replies: 28
Views: 4,429
Posted By Emp`
Re: menu for x secondes

native show_menu(index, keys, const menu[], time = -1, const title[] = "");
native menu_display(id, menu, page=0, time=-1);
time = :crab:
Forum: Scripting 12-20-2016, 19:38
Replies: 15
Views: 4,506
Posted By Emp`
Re: [CS:GO] Player Trails TE_SetupBeamFollow

IIRC the trail stops when the player is not moving; you can do a check to see if the player stopped and needs a new trail applied.

See [CS:GO] Player Trails (v1.1.0, 2016-11-04)...
Forum: Scripting 10-12-2016, 22:56
Replies: 5
Views: 2,228
Posted By Emp`
Re: Pick random value from enum

enum Day
{
Sunday,
Monday,
Tuesday,
Wednesday,
Thursday,
Friday,
Saturday
}
Forum: Code Snippets/Tutorials 09-14-2016, 23:29
Replies: 28
Views: 11,443
Posted By Emp`
Forum: Scripting 09-13-2016, 21:20
Replies: 18
Views: 3,491
Posted By Emp`
Re: Rotating an Array?

stock bool RotateArray( any[] iArray, int iSize, int iRotations = 1, bool bReverse = false )
{
if ( iSize <= 0 )
return false;

int iRotationCount, iRotatedValue, iElement;
int iLast =...
Forum: Scripting 09-03-2016, 14:14
Replies: 921
Views: 308,598
Posted By Emp`
Re: New API and Syntax

property int Int { public get() { return view_as < int > ( this ); }
}

or

property int Index { public get() { return view_as < int > ( this ); }
}
Forum: Code Snippets/Tutorials 08-30-2016, 19:52
Replies: 100
Views: 73,618
Posted By Emp`
Re: [TUT] Bits, Bit-fields, and Bit-wise Operators

Alternative to KliPPy's:
stock BitShiftCount( x )
{
new i;
while ( x && !( x & 1 ) )
{
x >>= 1;
i++;
}
return i;
Forum: Scripting 08-23-2016, 21:04
Replies: 921
Views: 308,598
Posted By Emp`
Re: New API and Syntax

Why not both?
enum BothTest { Both_Zero }
methodmap BothTest
{
//...
}
Forum: Scripting 08-23-2016, 18:36
Replies: 921
Views: 308,598
Posted By Emp`
Re: New API and Syntax

?



enum BaseBoss
{
Boss_Zero
}

BaseBoss preselected; /* The next player chosen as boss */
Forum: Snippets and Tutorials 07-31-2016, 15:13
Replies: 4
Views: 3,532
Posted By Emp`
Re: [INC] Data String Parameter

Check out DString (https://forums.alliedmods.net/showthread.php?p=2441123#post2441123), it should accomplish what you are doing with a few other bugs features.
Forum: Snippets and Tutorials 07-31-2016, 15:06
Replies: 21
Views: 9,776
Posted By Emp`
Re: [INC] DString - Dynamic Strings

Update per:


/**************************************************************************
* *
* ...
Forum: Extensions 03-15-2016, 12:58
Replies: 87
Views: 58,410
Posted By Emp`
Re: SourceTV Manager

Looks good, absolutely useful :bacon:

:crab:
Forum: Plugins 01-22-2016, 23:11
Replies: 15
Views: 20,288
Posted By Emp`
Re: [CS:GO] Unlimited Reserve Ammo

public OnConfigsExecuted()
{
ConVar sv_infinite_ammo = FindConVar( "sv_infinite_ammo" );
int iFlags = sv_infinite_ammo.Flags;
sv_infinite_ammo.Flags &= ~FCVAR_CHEAT;
sv_infinite_ammo.SetInt(...
Forum: Snippets and Tutorials 07-09-2015, 20:26
Replies: 21
Views: 9,776
Posted By Emp`
Re: [INC] DString - Dynamic Strings

You are describing more of a compile error, but it is producing a run time error. No compile error makes me think that it is seeing the functions fine, even with the methodmap before the DString...
Forum: Snippets and Tutorials 07-08-2015, 20:46
Replies: 21
Views: 9,776
Posted By Emp`
Re: [INC] DString - Dynamic Strings

Does this happen when using the DString_Create function directly? It might be a bug with the interpretation of the public DString. Can you also try creating with: view_as < DString > new...
Forum: Snippets and Tutorials 07-07-2015, 15:01
Replies: 21
Views: 9,776
Posted By Emp`
Re: [INC] DString - Dynamic Strings

Does this reproduce the same error?

/**************************************************************************
* *
* ...
Forum: Scripting 07-07-2015, 14:55
Replies: 7
Views: 3,535
Posted By Emp`
Re: [CS:GO] Wall walking

It looks like the trace rays might be hitting the player instead of the nearby wall; you can use TR_TraceRayFilter to avoid them.
Forum: Snippets and Tutorials 06-25-2015, 14:47
Replies: 21
Views: 9,776
Posted By Emp`
Re: [INC] DString - Dynamic Strings

Try this one out, I fixed the property line and added the missing 'new' in DString_Create. Creating the methodmap first allows the stock functions to use the methodmap; if you look at the stock...
Forum: Snippets and Tutorials 06-24-2015, 15:31
Replies: 21
Views: 9,776
Posted By Emp`
Re: [INC] DString - Dynamic Strings

The attached version now packs a length cell, removing the length cap from before.

DSTRING_BUFFERLEN is now only used with VFormat. (ie. Format and AddEx functions)

Per WildCard65, length is a...
Forum: Snippets and Tutorials 06-23-2015, 20:38
Replies: 21
Views: 9,776
Posted By Emp`
Re: [INC] DString - Dynamic Strings

Below is an alternate version I created with a methodmap.

Example done with methodmaps:

DString handle = DString_Create();
handle.add( "Hello!" );
handle.addex( " The GameTime is %f",...
Showing results 1 to 25 of 500

 
Forum Jump

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


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