AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Wrong style of dynamic native (https://forums.alliedmods.net/showthread.php?t=194002)

grs4 08-24-2012 12:14

Wrong style of dynamic native
 
Hi all.. I from Poland and first im sorry for my bad english.

I have my mod.. ExpMod by STRIKER.. and i total rebuild engine of my expmod.

Now im rebuild shop, and i have this error:
PHP Code:


L 08
/24/2012 18:03:31Wrong style of dynamic native
L 08
/24/2012 18:03:31: [AMXXDisplaying debug trace (plugin "expmod_shop.amxx")
L 08/24/2012 18:03:31: [AMXXRun time error 10native error (native "param_convert")
L 08/24/2012 18:03:31: [AMXX]    [0expmod_shop.sma::shop_register_item (line 125)
L 08/24/2012 18:03:31Unhandled dynamic native error
L 08
/24/2012 18:03:31: [AMXXDisplaying debug trace (plugin "expmod_shop_amunicja.amxx")
L 08/24/2012 18:03:31: [AMXXRun time error 10native error (native "exp_shop_register_item")
L 08/24/2012 18:03:31: [AMXX]    [0expmod_shop_amunicja.sma::plugin_init (line 24

amunicja = ammo
(expmod_shop_ammo.sma)

Function : register_item :
PHP Code:

public shop_register_item(const name[], const description[], priceone_round)
{
    
liczba_itemow++
    if(
liczba_itemow MAX_ITEMY+1)
        return 
PLUGIN_CONTINUE
    param_convert
(1)
    
param_convert(2)
    
    
copy(NazwyItemow[liczba_itemow], 63name)
    
copy(OpisyItemow[liczba_itemow], 127description)

    
KosztyItemow[liczba_itemow] = price
    RazNaRunde
[liczba_itemow] = one_round
    
    
return liczba_itemow;


liczba_itemow = item_num
NazwyItemow = ItemsName
OpisyItemow = ItemsDesc
KosztyItemow = ItemsPrice
RazNaRunde = one_round

this is .inc
PHP Code:

#if defined _expmodshop_included
  #endinput
#endif
#define _expmodshop_included

native exp_shop_register_item(const name[], const description[], priceone_rund)

forward item_selected(iditemid

And this is code where im using exp_shop_register_item :

PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <expmod_shop>
#include <cstrike>

#define PLUGIN "ExpMod Shop Ammo"
#define VERSION "1.0"
#define AUTHOR "tomcionek15 & grs4"

new const maxAmmo[31] = {0,52,0,90,1,32,1,100,90,1,120,100,100,90,90,90,100,120,30,120,200,32,90,120,90,2,35,90,90,0,100};

new const 
nazwa[] = "Ammo"
new const opis[]  = "You got ammo for all your weapons"
new cena    0;
new 
one_round 0;

new 
item;
public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
item exp_shop_register_item(nazwaopiscenaone_round// name, desc, price
}
public 
item_selected(iditemid)
{
    if(
item == itemid)
    {
        new 
weapons[32];
        new 
weaponsnum;
        
get_user_weapons(idweaponsweaponsnum);
                
        for(new 
i=0i<weaponsnumi++)
            if(
is_user_alive(id) && is_user_connected(id) && !is_user_hltv(id))
                if(
maxAmmo[weapons[i]] > 0)
                    
cs_set_user_bpammo(idweapons[i], maxAmmo[weapons[i]]);
    }


Help me pls..

P.S : Sorry for my errors in topic.
This is my first topic ( im think )

grs4 08-24-2012 13:15

Re: Wrong style of dynamic native
 
Ok to close im use : "fake" natives and work well:)
http://forums.alliedmods.net/showthread.php?t=41251

ConnorMcLeod 08-24-2012 15:15

Re: Wrong style of dynamic native
 
You seems to register the native with style 0 but your header and param_convert implies style 1.
Have to see plugin_natives function.

grs4 08-25-2012 07:12

Re: Wrong style of dynamic native
 
Thanks, its work ;)


All times are GMT -4. The time now is 05:45.

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