Raised This Month: $ Target: $400
 0% 

Invalid return type when using pev with DOD ??


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 05-31-2006 , 12:40   Invalid return type when using pev with DOD ??
Reply With Quote #1

This is the code:

Code:
new iVal; iVal = pev( id, 1 );

And I get invalid return type??? anyone know why? (it occurs in day of defeat but not CS/CZ)

Thanks,
Josh
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
VEN
Veteran Member
Join Date: Jan 2005
Old 05-31-2006 , 13:10  
Reply With Quote #2

try that:
Code:
new iVal, sz[32]; iVal = pev( id, 1, sz, 31 );
VEN is offline
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 05-31-2006 , 13:26  
Reply With Quote #3

OK that works for a little...

I'm basically doing:

Code:
public test( id ) {     new iVal, sz[32];     for ( new i = 1; i < 145; i++ )     {         iVal = pev( id, i, sz, 31 );         server_print( "[%d] %d", i, iVal );     } }

I get invalid return type when i is greater than 11 and i also get the error "unknown pev index or return combination 12"

This is really confusing, why won't pev just work in dod?
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
VEN
Veteran Member
Join Date: Jan 2005
Old 05-31-2006 , 13:35  
Reply With Quote #4

There are Float, Int, Vec and Sz PEVs, therefore you cant just do
Code:
pev( id, i, sz, 31 );
or
Code:
pev( id, i );
for all of them.

For example 1st is a string:
Code:
pev( id, 1, sz, 31 ) // classname
#17 is an integer:
Code:
x = pev( id, 17 ) // aiment
#41 is a float:
Code:
pev( id, 41, f_by_ref ) // health
#118 is a vector:
Code:
pev( id, 118, Vec ) // origin
VEN is offline
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 05-31-2006 , 13:42  
Reply With Quote #5

OK so there isn't a way for me to just loop through all of them though?

i.e. I just want to loop through all the ints
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 05-31-2006 , 14:00  
Reply With Quote #6

Code:
for( new i = pev_int_start + 1; i < pev_int_end; i++ )         client_print( id, print_chat, "PevId: %i | Value %i", i, pev( id, i ) );

try this ;)
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 05-31-2006 , 14:36  
Reply With Quote #7

Quote:
Originally Posted by Greenberet
Code:
for( new i = pev_int_start + 1; i < pev_int_end; i++ )         client_print( id, print_chat, "PevId: %i | Value %i", i, pev( id, i ) );

try this ;)
Thats what I was doing originally and it errors out after so many...
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 05-31-2006 , 14:57  
Reply With Quote #8

Message overflow?
if yes
Code:
static text[256],temp[32]; for( new i = pev_int_start + 1; i < pev_int_end; i++ ) {         formatex( temp, 31, "PevID %i | Value %i^n", i, pev(id,i));         add( text, 256, temp ); } client_print( id, print_console, "%s", text );
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 05-31-2006 , 18:31  
Reply With Quote #9

no, the first error in this thread... I do server_print to prevent overflow Come on I'm not a noob
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
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 16:21.


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