Raised This Month: $ Target: $400
 0% 

Stack implementation


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Marcin RN
New Member
Join Date: Dec 2012
Old 12-17-2014 , 09:07   Re: Stack implementation
Reply With Quote #1

Okay, I just found that it's in dev version

However, I have an issue with it.

I need an array that holds stack handles for each of player
Code:
new Stack:g_LastHP[33]

for ( new i = 1; i <= g_MaxPL; i++ )
	g_LastHP[i] = CreateStack()
However, if I try to use any cellstack function on any handle it would print Invalid handle error.

Code:
PushStackCell(g_LastHP[id], pev(target, pev_health))

L 12/17/2014 - 15:02:13: Invalid array handle provided (0)
L 12/17/2014 - 15:02:13: [AMXX] Displaying debug trace (plugin "test.amxx", version "2.8.2")
L 12/17/2014 - 15:02:13: [AMXX] Run time error 10: native error (native "PushStackCell")
For a single stack handle (not an array) it works fine:

Code:
	g_testStack = CreateStack()
		
	PushStackCell(g_testStack, 5)
	PushStackCell(g_testStack, 25)
	new z;
	PopStackCell(g_testStack, z)
	server_print("%d", z)   //prints 25
Any help appreciated!
Marcin RN is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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