Raised This Month: $ Target: $400
 0% 

Native problem.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
RafalB.
Junior Member
Join Date: Nov 2012
Old 01-25-2013 , 15:12   Native problem.
Reply With Quote #1

This is my code in expmod.sma :
PHP Code:
public plugin_natives(){
register_native"use_pobierz_KameHame""FPobierzUzylKameHame"1);
register_native"use_ustaw_KameHame""FUstawUzylKameHame"1); }

public 
FPobierzUzylKameHame(id)
return 
UzylKameHame[id]
public 
FUstawUzylKameHame(id,bool:wartosc)
UzylKameHame[id] = wartosc 
in exp.inc
Code:
native use_pobierz_KameHame(id)
native use_ustaw_KameHame(id,bool:wartosc)
adds this code:
PHP Code:
use_pobierz_KameHame(id) == false 
and I have error :
Warning: Tag mismatch on line 29

Last edited by RafalB.; 01-25-2013 at 15:30.
RafalB. is offline
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 01-25-2013 , 15:30   Re: Natibe help please.
Reply With Quote #2

registering native is like this:
PHP Code:
// plugins_natives
register_native"use_pobierz_KameHame""FPobierzUzylKameHame"1);
/// end

public FPobierzUzylKameHame(plugin,params){
    new 
id get_params(0);

    
//Code

__________________
simanovich is offline
RafalB.
Junior Member
Join Date: Nov 2012
Old 01-25-2013 , 15:34   Re: Native problem.
Reply With Quote #3

error : Error: Undefined symbol "get_params" on line 1731
why I have to add get_params(0); ?
RafalB. is offline
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 01-25-2013 , 15:44   Re: Native problem.
Reply With Quote #4

use "get_param(number of parameter)"

you have to add get_param, to for plugin correctly:}, really params counts can be different, if you use fixed params, this will be problem for other plugins and etc..
__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT
AngeIII is offline
Send a message via Skype™ to AngeIII
RafalB.
Junior Member
Join Date: Nov 2012
Old 01-25-2013 , 15:50   Re: Native problem.
Reply With Quote #5

I have :
PHP Code:
public plugin_natives(){
    
register_library("expmod");
register_native(    "use_pobierz_KameHame",     "FPobierzUzylKameHame",        1);
register_native(    "use_ustaw_KameHame",         "FUstawUzylKameHame",        1);

register_native(    "use_pobierz_Drop",         "FPobierzUzylDropu",        1);
register_native(    "use_ustaw_Drop",         "FUstawUzylDropu",        1);

register_native(    "use_pobierz_Push",         "FPobierzUzylPush",        1);
register_native(    "use_ustaw_Push",         "FUstawUzylPush",        1);

register_native(    "use_pobierz_Piorun",         "FPobierzUzylPiorun",        1);
register_native(    "use_ustaw_Piorun",         "FUstawUzylPiorun",        1);


register_native(    "use_pobierz_Wykrywacz",     "FPobierzUzylWykrywacz",    1);
register_native(    "use_ustaw_Wykrywacz",         "FUstawUzylWykrywacz",        1)
};

public 
FPobierzUzylKameHame(plugin,params){
new 
id get_params(0);
return 
UzylKameHame[id]
}
public 
FUstawUzylKameHame(id,bool:wartosc)
UzylKameHame[id] = wartosc

public FPobierzUzylDropu(id)
return 
uzylDropu[id]
public 
FUstawUzylDropu(id,bool:wartosc)
uzylDropu[id] = wartosc

public FPobierzUzylPush(id)
return 
uzylPush[id]
public 
FUstawUzylPush(id,bool:wartosc)
uzylPush[id] = wartosc

public FPobierzUzylPiorun(id)
return 
uzylPiorun[id]
public 
FUstawUzylPiorun(id,bool:wartosc)
uzylPiorun[id] = wartosc

public FPobierzUzylWykrywacz(id)
return 
uzylWykrywacz[id]
public 
FUstawUzylWykrywacz(id,wartosc)
uzylWykrywacz[id] = wartosc 
Can you help me fix this plugin ?
RafalB. is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-25-2013 , 15:52   Re: Native problem.
Reply With Quote #6

Quote:
Originally Posted by simanovich View Post
registering native is like this:
PHP Code:
// plugins_natives
register_native"use_pobierz_KameHame""FPobierzUzylKameHame"1);
/// end

public FPobierzUzylKameHame(plugin,params){
    new 
id get_params(0);

    
//Code

Quote:
Originally Posted by AngeIII View Post
use "get_param(number of parameter)"

you have to add get_param, to for plugin correctly:}, really params counts can be different, if you use fixed params, this will be problem for other plugins and etc..
Header like (plugins,params) is only for natives registered with style 0
Here natives are registered with style 1
(plugins,params) and get_param are not relevant here.


In exp.inc file you may have to do :

Code:
native bool:use_pobierz_KameHame ( index );
native use_ustaw_KameHame ( index , bool:wartosc );

Also, i hope that
PHP Code:
use_pobierz_KameHame(id) == false 
is in fact something like this :
PHP Code:
if( use_pobierz_KameHame(id) == false 
Anyway, to check a bool value you only have to do

Check false:
PHP Code:
if( !use_pobierz_KameHame(id) ) 
Check true:
PHP Code:
if( use_pobierz_KameHame(id) ) 
And this way you wouldn't have any tag problem.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 01-25-2013 at 15:53.
ConnorMcLeod is offline
RafalB.
Junior Member
Join Date: Nov 2012
Old 01-25-2013 , 16:04   Re: Native problem.
Reply With Quote #7

PHP Code:
native bool:use_pobierz_restart(id)
native use_ustaw_restart(id,wartosc)
    
native bool:use_pobierz_KameHame(id)
native use_ustaw_KameHame(id,bool:wartosc)

native bool:use_pobierz_Drop(id)
native use_ustaw_Drop(id,bool:wartosc)    

native bool:use_pobierz_Push(id)
native use_ustaw_Push(id,bool:wartosc)    


native bool:use_pobierz_Piorun(id)
native use_ustaw_Piorun(id,bool:wartosc)


public 
FPobierzUzylKameHame(id,bool:wartosc){
new 
id get_params(0);
return 
UzylKameHame[id]
}
public 
FUstawUzylKameHame(id,bool:wartosc)
UzylKameHame[id] = wartosc

public FPobierzUzylDropu(id)
return 
uzylDropu[id]
public 
FUstawUzylDropu(id,bool:wartosc)
uzylDropu[id] = wartosc

public FPobierzUzylPush(id)
return 
uzylPush[id]
public 
FUstawUzylPush(id,bool:wartosc)
uzylPush[id] = wartosc

public FPobierzUzylPiorun(id)
return 
uzylPiorun[id]
public 
FUstawUzylPiorun(id,bool:wartosc)
uzylPiorun[id] = wartosc

public FPobierzUzylWykrywacz(id)
return 
uzylWykrywacz[id]
public 
FUstawUzylWykrywacz(id,wartosc)
uzylWykrywacz[id] = wartosc 
good ?

Last edited by RafalB.; 01-25-2013 at 16:05.
RafalB. is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-25-2013 , 20:11   Re: Native problem.
Reply With Quote #8

Remove :

new id = get_params(0);

And try to understand what you are doing... there is a tutorial about fake natives.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
RafalB.
Junior Member
Join Date: Nov 2012
Old 01-27-2013 , 06:30   Re: Native problem.
Reply With Quote #9

I know.
Is the rest is okay?
RafalB. is offline
Reply


Thread Tools
Display Modes

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 20:40.


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