AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Fake Natives (Solved) (https://forums.alliedmods.net/showthread.php?t=25011)

mysticssjgoku4 03-06-2006 03:39

Fake Natives (Solved)
 
How come, when you register a fake native, it doesn't pass a string through correctly?


Inc. - Registered INC file
Code:
native remorp_server_changelocks(id,targetname[]);

BuyMod - Plugin sending the command
The string is formatted correctly, so I know it is not the formatting.
Code:
remorp_server_changelocks(id,targetname)

KeyMod -
Code:
public plugin_natives() {     register_library ( "RemoRPKeyMod" )     register_native("remorp_server_changelocks","server_changelocks",1) } public server_changelocks(id,targetname[]) {     client_print(0,print_chat,"%s",targetname)     new targetname = param_convert(2)     client_print(0,print_chat,"%i",targetname)

The problem is

The first print chat on the changelocks command prints:
;
Then the second one prints
1

How can I fix this, if possible? Thanks.

Charr 03-06-2006 08:56

I believe you have to:
Code:
public server_changelocks(id,targetname[]) {     param_convert(1)     client_print(0,print_chat,"%s",targetname)     new target = str_to_num(targetname)     client_print(0,print_chat,"%i",target)     ... }

mysticssjgoku4 03-06-2006 15:49

The targetname needs to be a string, not a variable, I was just testing both the Integer and String Values.

Now it just returns a large number.

BAILOPAN 03-06-2006 17:30

Code:
public server_changelocks(id, targetname[]) {     param_convert(2)     client_print(0,print_chat,"%s",targetname)     new targetname = param_convert(2)     client_print(0,print_chat,"%i",targetname)

mysticssjgoku4 03-06-2006 22:01

Ty. Worked.


All times are GMT -4. The time now is 20:27.

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