AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED]What Does This Mean? (https://forums.alliedmods.net/showthread.php?t=226059)

Randomize 09-13-2013 06:14

[SOLVED]What Does This Mean?
 
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

simanovich 09-13-2013 06:27

Re: What Does This Mean?
 
it returns what the variable "i" contain.

Randomize 09-13-2013 06:39

Re: What Does This Mean?
 
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.

Black Rose 09-13-2013 09:55

Re: What Does This Mean?
 
This code is useless and the function will always return 0 no matter what.

Randomize 09-13-2013 10:09

Re: What Does This Mean?
 
So there's no solution, is there?

Black Rose 09-13-2013 10:26

Re: What Does This Mean?
 
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.

Randomize 09-13-2013 10:31

Re: What Does This Mean?
 
That's too complicated, I'll send it via PM

Black Rose 09-13-2013 11:22

Re: What Does This Mean?
 
I hate zombie plugins.
Try this instead.
Code:
get_idweapon_from_ent(ent) {     get_pdata_int(ent, 43, 4) }

Randomize 09-13-2013 21:19

Re: What Does This Mean?
 
It wasn't zombie plugins :D

that don't work either

ConnorMcLeod 09-14-2013 02:08

Re: What Does This Mean?
 
On which entity are you trying to get weapon type ?


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

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