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
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 10-23-2015 , 15:43   Re: [Help ASAP] Problem with a native that returns a string
Reply With Quote #7

I want to get the weapon name that corresponds to the given weapon, so if the weapon is "weapon_mp5navy", I would get "Balrog Ethereal". Ignore the other things in the array, because this isn't the full code of the plugin.

So, I changed it like this now:

PHP Code:
public _furien_get_weaponname(PluginIndexPluginParams)
{
    new 
szWeapon[32], i
    get_string
(PluginParamsszWeaponcharsmax(szWeapon))
    
    for(
0sizeof(g_szModels) - 3+= 4)
    {
        if(
equali(szWeapong_szModels[i]))
        {
            
set_string(2g_szModels[1], get_param(2))
            break
        }
    }
    
    return 
1

And the native is:

PHP Code:
native furien_get_weaponname(szWeapon[], szString[], const iMax
The test function:

PHP Code:
public test(id)
{
    new 
szName[32]
    
furien_get_weaponname("weapon_mp5navy"szNamecharsmax(szName))
    
client_print(idprint_chat"The name is %s"szName)

I'm still not getting the desired name.

This is what I'm trying to do - http://i.imgur.com/RS7k4sa.jpg
I made the image with a simple array of strings in the same plugin, but I want to add the name in my other plugin, where all the weapon models are.

Last edited by OciXCrom; 10-23-2015 at 15:46.
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:07.


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