AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   no (https://forums.alliedmods.net/showthread.php?t=246191)

Awesome_man 08-13-2014 09:57

no
 
no

indraraj striker 08-13-2014 10:46

Re: Compile Error [HELP]
 
1 Attachment(s)
Quote:

Originally Posted by Awesome_man (Post 2183446)
Here the code but giving compile error, and i'm unable to fix it. please someone fix this little code

PHP Code:

#include <amxmodx>
#include <fun>
#include <colorchat>
#include <jctf>

#define PLUGIN ""
#define VERSION "1.0"
#define AUTHOR ""

const TASK_ID 6969
const BonusHP 30


new g_iSync


public plugin_init(){

register_plugin("""0.2""")

register_event("DeathMsg""onDeathMsgEvent""a")
register_event("CurWeapon""onCurWeaponEvent""be""1=1")

g_iSync CreateHudSyncObj()

new 
szVersion[6]

get_cvar_string("jctf_version"szVersioncharsmax(szVersion))

if(
str_to_float(szVersion) < 1.21)
set_fail_state("jCTF is required at least v1.21 !")
}


public 
onDeathMsgEvent()
{
    new 
id read_data(1)

    new 
szWeapon[32]
    
read_data(4szWeaponcharsmax(szWeapon))

    if(
equal(szWeapon"knife") && is_user_alive(id))
    {
        new 
szName[32], szName2[32]
        
get_user_name(idszNamecharsmax(szName))
        
get_user_name(read_data(2), szName2charsmax(szName2))

        
set_hudmessage(255000.020.210.16.00.10.1, -1)
        
ShowSyncHudMsg(0g_iSync"Player %s Knifed %s HAHA"szNameszName2)

        
client_cmd(0,"spk misc/laugh")
        
ColorChat(0GREEN"^Player %s Recieved 40 Adrenaline And 40 Hp For Knifing %s"szNameszName2)


        
set_user_health(idget_user_health(id) + 30
        
jctf_add_adrenaline(id40"no reason" );  
       
        
remove_task(id TASK_ID)
    } 




simple jctf.inc add in your include folder
and then try to do locally compile

last line you forget to add
expect tokens add this also
}

Eagle07 08-13-2014 15:06

Re: Compile Error [HELP]
 
First remove ^ in this line

Quote:

ColorChat(0, GREEN, "^Player %s Recieved 40 Adrenaline And 40 Hp For Knifing %s", szName, szName2)
And add } in the last of plugin

_____

PHP Code:

#include <amxmodx>
#include <fun>
#include <colorchat>
#include <jctf>

#define PLUGIN ""
#define VERSION "1.0"
#define AUTHOR ""

const TASK_ID 6969
const BonusHP 30


new g_iSync


public plugin_init(){

register_plugin("""0.2""")

register_event("DeathMsg""onDeathMsgEvent""a")
register_event("CurWeapon""onCurWeaponEvent""be""1=1")

g_iSync CreateHudSyncObj()

new 
szVersion[6]

get_cvar_string("jctf_version"szVersioncharsmax(szVersion))

if(
str_to_float(szVersion) < 1.21)
set_fail_state("jCTF is required at least v1.21 !")
}


public 
onDeathMsgEvent()
{
    new 
id read_data(1)

    new 
szWeapon[32]
    
read_data(4szWeaponcharsmax(szWeapon))

    if(
equal(szWeapon"knife") && is_user_alive(id))
    {
        new 
szName[32], szName2[32]
        
get_user_name(idszNamecharsmax(szName))
        
get_user_name(read_data(2), szName2charsmax(szName2))

        
set_hudmessage(255000.020.210.16.00.10.1, -1)
        
ShowSyncHudMsg(0g_iSync"Player %s Knifed %s HAHA"szNameszName2)

        
client_cmd(0,"spk misc/laugh")
        
ColorChat(0GREEN"Player %s Recieved 40 Adrenaline And 40 Hp For Knifing %s"szNameszName2)


        
set_user_health(idget_user_health(id) + 30
        
jctf_add_adrenaline(id40"no reason" );  
       
        
remove_task(id TASK_ID)
    } 
   } 


Awesome_man 08-14-2014 02:35

Re: Compile Error [HELP]
 
Thanks eagle, But code not working i mean when i am knifing someone nothing happens neither i get hp , adrenaline nor hud and chat message appear ? Whats wrong please help

Flick3rR 08-14-2014 03:19

Re: Compile Error [HELP]
 
Why you remove unexisting task? Useless.
You are not precaching the sound, therefore it won't be played. For the HUD, just check out the parameters and try to put some chat messages for markers to see which exactly is not working. Some error logs may be useful, too.

Awesome_man 08-14-2014 03:40

Re: Compile Error [HELP]
 
Quote:

Originally Posted by Flick3rR (Post 2183742)
Why you remove unexisting task? Useless.
You are not precaching the sound, therefore it won't be played. For the HUD, just check out the parameters and try to put some chat messages for markers to see which exactly is not working. Some error logs may be useful, too.

There already a line

Code:

client_cmd(0,"spk misc/laugh")
And why its not giving adrenaline ?
Also its not giving hp too

In other words plugins is just loading but not working please fix the code, i dont know scripting dat much :wink:

Flick3rR 08-14-2014 04:07

Re: Compile Error [HELP]
 
It is propably from that custom include and it's requires. Check out the error logs. The code was working for me in the firat request, so that's the option left. And this is scripting help forum, so don't wait for someone to make it for you...

Awesome_man 08-14-2014 04:20

Re: Compile Error [HELP]
 
Quote:

Originally Posted by Flick3rR (Post 2183757)
It is propably from that custom include and it's requires. Check out the error logs. The code was working for me in the firat request, so that's the option left. And this is scripting help forum, so don't wait for someone to make it for you...

L 08/14/2014 - 12:08:52: [AMXX] Run time error 10 (plugin "knife_kill.amxx") (native "ShowSyncHudMsg") - debug not enabled!
L 08/14/2014 - 12:08:52: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).

Applied debug, still not working

Flick3rR 08-14-2014 04:27

Re: Compile Error [HELP]
 
It won't work because of the debug. It just shows the error in details, so we can know exactly what's wrong. So, please post the output from the debugged error.

Awesome_man 08-14-2014 04:29

Re: Compile Error [HELP]
 
Quote:

Originally Posted by Flick3rR (Post 2183771)
It won't work because of the debug. It just shows the error in details, so we can know exactly what's wrong. So, please post the output from the debugged error.

how to get debugged error ?


All times are GMT -4. The time now is 13:17.

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