Need help with my first script
Hi everybody, It's my first script, so don't call me n00b (I'm a n00b, as you can see, but don't tell me)
Code:
When I compile it, I have 2 warnings in files 41 and 47... It's a TSRP plugin, workin with Harbu's. When I use that item in the server, it plays the sound, but doesn't teleport me, in the server console I can see this: ----------------------------------------------- L 05/05/2006 - 07:56:22: [AMXX] Native error in "get_user_origin" on line 42 (file "matrix_phone.sma"). ----------------------------------------------- Please help me (I'm Spanish, sorry my english) |
u registered "item_mphone" as a servercommand, so there won't be an id passed into the function (it will be 0)
use register_clcmd instead :) (btw, engine_stocks.inc is already included in engine.inc) |
You don't need all those included and to the person above me it's for tsrp i'm guessing so he needs to use server command
|
[small]
--------------------------------------------------------------------------------- /* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <dbi> #include <tsx> #include <engine> #include <engine_stocks> #include <fun> #include <tsxaddon> #define PLUGIN "Matrix Phone" #define VERSION "1.0" #define AUTHOR "Kuidao Ketemeto" public plugin_init() { register_plugin("Matrix Phone", "1.0", "Kuidao Ketemeto") register_clcmd("item_mphone","item_mphone") // Add your code here... } // Precaching some stuff public plugin_precache() { precache_sound("items/kuidao/teleport.wav") } //////////////////////////////////// // ITEM /////////////////////////////////// // The Matrix Phone public item_mphone(id) { new origin[3] new authid[32] get_user_authid(id,authid,31) get_user_origin(id,origin) origin[0] = -326 // X coordinates origin[1] = 152 // Y coordinates origin[2] = -25 // Z coordinates set_user_origin(id,origin) // Moves the player to the location stored in origin client_cmd(id,"speak ^"items/kuidao/teleport^"") return PLUGIN_HANDLED } ----------------------------------------------------------------------------------- [small] but now it's no working, the warnings are the same, but now is not working |
Hmm, maybe, try to put this in the top(after #define's)
Code:
Code:
Edit:Here: Code:
Edit: Fixage, forgot one thing <.< Edit:Fixed |
no
It doesn't work anyway...
Now the warnings are: <34> : warning 217: loose identation and <37> : warning 213: tag mismatch And now it's no workin, NOTHING, no errors in server console... // EDIT: I wrote register_srvcmd again, and it plays the sound and I get this error in console: [AMXX] Native error in "get_user_origin" on line 36 (file "matrix_phone.sma"). |
Yep, i know that, i get it around many scripts, got no idea what it means but doesn't matter for me :P
Anyways, this should work fine. Code:
|
well, I don't know, but look:
[AMXX] Native error in "get_user_origin" on line 30 (file "matrix_phone.sma"). But now I have only 1 warning! <33> : warning 213: tag mismatch |
[small]
---------------------------------------------------------------- #include <amxmodx> #include <amxmisc> #include <engine> #include <fun> #include <fakemeta> new porigin[3] = { -326, 152, -25 } public plugin_init() { register_plugin("Matrix Phone", "1.0", "Kuidao Ketemeto") register_clcmd("item_mphone","item_mphone") } // Precaching some stuff public plugin_precache() { precache_sound("items/kuidao/teleport.wav") } //////////////////////////////////// // ITEM /////////////////////////////////// // The Matrix Phone public item_mphone(id) { set_user_origin(id, porigin) // Moves the player to the location stored in origin client_cmd(id,"speak ^"items/kuidao/teleport^"") return PLUGIN_HANDLED } ---------------------------------------------- [small] ok, Sean D told me to do this, well, thanks, no warnings anymore... I edited this: [small] register_clcmd("item_mphone","item_mphone") [small] to this: [small] register_srvcmd("item_mphone","item_mphone") [small] and now the sound works, if I use the clcmd, nothin works. But I have a problem, this one that comes in server's console: [AMXX] Native error in "set_user_origin" on line 28 (file "matrix_phone.sma"). We are going to make it, I'll give all you some karma! hey, how to give karma? |
[small]
---------------------------------------------------------------- #include <amxmodx> #include <amxmisc> #include <engine> #include <fun> #include <fakemeta> new porigin[3] = { -326, 152, -25 } public plugin_init() { register_plugin("Matrix Phone", "1.0", "Kuidao Ketemeto") register_clcmd("item_mphone","item_mphone") } // Precaching some stuff public plugin_precache() { precache_sound("items/kuidao/teleport.wav") } //////////////////////////////////// // ITEM /////////////////////////////////// // The Matrix Phone public item_mphone(id) { set_user_origin(id, porigin) // Moves the player to the location stored in origin client_cmd(id,"speak ^"items/kuidao/teleport^"") return PLUGIN_HANDLED } ---------------------------------------------- [small] ok, Sean D told me to do this, well, thanks, no warnings anymore... I edited this: [small] register_clcmd("item_mphone","item_mphone") [small] to this: [small] register_srvcmd("item_mphone","item_mphone") [small] and now the sound works, if I use the clcmd, nothin works. But I have a problem, this one that comes in server's console: [AMXX] Native error in "set_user_origin" on line 28 (file "matrix_phone.sma"). We are going to make it, I'll give all you some karma! |
| All times are GMT -4. The time now is 05:05. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.