Raised This Month: $ Target: $400
 0% 

[SOLVED] Problem with a native that returns a string


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 10-23-2015 , 09:35   [SOLVED] Problem with a native that returns a string
Reply With Quote #1

PHP Code:
new const g_szNotFound[] = "Not Found"

new const g_szModels[][] = {
    
"weapon_mp5navy""Balrog Ethereal""models/iplay_furien/v_ethereal.mdl""models/iplay_furien/p_ethereal.mdl""models/iplay_furien/w_ethereal.mdl""models/w_mp5.mdl"
}

public 
plugin_natives()
{
    
register_library("furien_weapons")
    
register_native("furien_get_weaponname""_furien_get_weaponname")
}

public 
_furien_get_weaponname(szWeapon[])
{
    static 
szName[32]
    
    for(new 
0sizeof(g_szModels) - 5+= 6)
    {
        if(
equali(szWeapong_szModels[i]))
            
formatex(szNamecharsmax(szName), "%s"g_szModels[1])
    }
    
    
formatex(szNamecharsmax(szName), "%s"g_szNotFound)
    return 
szName

The result is this: http://i.imgur.com/13e4iNk.jpg
I'm using furien_get_weaponname("weapon_mp5navy"). I have no idea how I'm getting the last sound that was played, instead of the weapon's name, which in this case is "Balrog Ethereal".

Last edited by OciXCrom; 10-25-2015 at 10:54.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
 



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 22:06.


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