Raised This Month: $51 Target: $400
 12% 

[SOLVED]What Does This Mean?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Randomize
BANNED
Join Date: May 2012
Location: in your heart
Old 09-13-2013 , 06:14   [SOLVED]What Does This Mean?
Reply With Quote #1

What does "return i" mean? I try to print it in chat but stuck in 1.

PHP Code:
get_idweapon_from_ent(ent)
{
    new 
1check_value 1
    
while (check_value && MAX_WPN)
    {
        if (
c_wpnchange[i] <= 0check_value 0
        
else
        {
            new 
w_submodel[64]
            
pev(entpev_bodyw_submodelcharsmax(w_submodel))
            
//pev(ent, pev_model, model, charsmax(model))
            
            
client_print(0print_chat"%s pev body"w_submodel)
            
client_print(0print_chat"%i string"i)
            
            return 
i;
        }
        
i++
    }
    
    return 
0;

Code is take from CSO NST 1011 .sma

Last edited by Randomize; 09-14-2013 at 04:10.
Randomize is offline
Old 09-13-2013, 06:18
LordOfNothing
This message has been deleted by ConnorMcLeod. Reason: troll, or posting random confusing code, or posting for posts count
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 09-13-2013 , 06:27   Re: What Does This Mean?
Reply With Quote #2

it returns what the variable "i" contain.
__________________
simanovich is offline
Randomize
BANNED
Join Date: May 2012
Location: in your heart
Old 09-13-2013 , 06:39   Re: What Does This Mean?
Reply With Quote #3

okay thank you. I want to make world model using 1 model and use sub model to set the weapon was drop. I have .ini file and contain like this:
Code:
[name]AK47[models]ak47[w_model]primary[w_submodel]0
[name]M4A1[models]m4a1[w_model]primary[w_submodel]1
It is success by print chat like example above, but the problem is when I pick m4a1, it return the ak47 line.
Randomize is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 09-13-2013 , 09:55   Re: What Does This Mean?
Reply With Quote #4

This code is useless and the function will always return 0 no matter what.
__________________
Black Rose is offline
Randomize
BANNED
Join Date: May 2012
Location: in your heart
Old 09-13-2013 , 10:09   Re: What Does This Mean?
Reply With Quote #5

So there's no solution, is there?
Randomize is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 09-13-2013 , 10:26   Re: What Does This Mean?
Reply With Quote #6

It depends on what the problem is. I can't tell what the code is supposed to do.

Show me the function that reads the .ini.
__________________
Black Rose is offline
Randomize
BANNED
Join Date: May 2012
Location: in your heart
Old 09-13-2013 , 10:31   Re: What Does This Mean?
Reply With Quote #7

That's too complicated, I'll send it via PM
Randomize is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 09-13-2013 , 11:22   Re: What Does This Mean?
Reply With Quote #8

I hate zombie plugins.
Try this instead.
Code:
get_idweapon_from_ent(ent) {     get_pdata_int(ent, 43, 4) }
__________________
Black Rose is offline
Randomize
BANNED
Join Date: May 2012
Location: in your heart
Old 09-13-2013 , 21:19   Re: What Does This Mean?
Reply With Quote #9

It wasn't zombie plugins

that don't work either
Randomize is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-14-2013 , 02:08   Re: What Does This Mean?
Reply With Quote #10

On which entity are you trying to get weapon type ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 03:21.


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