AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Can anyone help me on this ? (https://forums.alliedmods.net/showthread.php?t=29956)

vids 06-19-2006 14:11

Can anyone help me on this ?
 
This is for DOD HL1
Can anyone help me on this scripts? Is there anything wrong with it ? It's seems don't work even deaths reach to 10 . Maybe I'm too nub to understand where did I go wrong.


==================================

#include <amxmodx>


public plugin_init() {
// ..
register_plugin("deaths_Kicker","1.0","Shadow Leader(123)")
register_event("ResetHUD","newRound","b")
register_cvar("deaths_limit","10")
}

public newRound(id) {

if(get_user_deaths(id) >= get_cvar_num("deaths_limit")) {
server_cmd("banid #%d 5",get_user_userid(id))
server_cmd("kick #%d ^"Reached Death Limits (%d) - Banned 5 min^"",get_user_userid(id),get_user_deaths(id ))
}

return PLUGIN_HANDLED
}

=================

Thank you in advance

Z@C 06-19-2006 14:50

server_cmd(kick ..... change to server_cmd(ban .....
and
server_cmd(ban ..... change to server_cmd(kick .....

Reached Death Limits (%d),get_user_deaths(id) change to
Reached Death Limits (%d),get_cvar_num("deaths_limit")

server_cmd("banid #%d 5",get_user_userid(id)) change to
new authid[32]
get_user_authid(id, authid, 31)
server_cmd("banid %d 5",authid)

vids 06-20-2006 03:30

Hi there. thanks for the reply, I've tried to change it as mentioned.
But no luck, it won't kick when reach 10 deaths. Did I make anymore mistakes ?

Thanks in advance

============================
#include <amxmodx>


public plugin_init() {
// ..
register_plugin("deaths_Kicker","1.0","Shadow Leader(123)")
register_event("ResetHUD","newRound","b")
register_cvar("deaths_limit","10")
}

public newRound(id) {

if(get_user_deaths(id) >= get_cvar_num("deaths_limit")) {
server_cmd("kick #%d ^"Reached Death Limits (%d)^"",get_cvar_num("deaths_limit"),get_user _deaths(id))
new authid[32]
get_user_authid(id, authid, 31)
server_cmd("banid %d 5",authid)

}

return PLUGIN_HANDLED
}

=============================

Z@C 06-20-2006 04:11

you have 1 line not right
Code:
#include <amxmodx> public plugin_init() { register_plugin("deaths_Kicker","1.0","ShadowLeader(123)") register_event("ResetHUD","newRound","b") register_cvar("deaths_limit","10") } public newRound(id) { new authid[32] get_user_authid(id, authid, 31) if(get_user_deaths(id) >= get_cvar_num("deaths_limit")) { server_cmd("kick #%d ^"Reached Death Limits (%d)^"",get_user_userid(id),get_cvar_num("deaths_limit")) server_cmd("banid %d 5",authid) } return PLUGIN_HANDLED }
this is right code,write all

vids 06-20-2006 04:37

Thanks Again.
But still no luck. It did not auto kick or auto banned. Script compile correctly and run perfectly....

Thank you.

v3x 06-20-2006 05:46

try this:
Code:
#include <amxmodx> #include <dodfun> public plugin_init() { register_plugin("deaths_Kicker","1.0","ShadowLeader(123)") register_event("ResetHUD","newRound","b") register_cvar("deaths_limit","10") } public newRound(id) {   new authid[32]   get_user_authid(id, authid, 31)   if(dod_get_pl_deaths(id) >= get_cvar_num("deaths_limit")) {     server_cmd("kick #%d ^"Reached Death Limits (%d)^"",get_user_userid(id),get_cvar_num("deaths_limit"))     server_cmd("banid %s 5",authid) // changed %d to %s because authid is a string   } }
You must download/enable the dodfun module.

Z@C 06-20-2006 07:44

Quote:

Originally Posted by v3x
try this:
Code:
server_cmd("banid %s 5",authid) // changed %d to %s because authid is a string
You must download/enable the dodfun module.

you right i notice this (%d to %s)

vids 06-20-2006 09:41

Thank you for the Reply.


I've tried both: By v3x
if(dod_get_pl_deaths(id) >= get_cvar_num("deaths_limit"))

and by: Z@C
if(get_user_deaths(id) >= get_cvar_num("deaths_limit"))

Both scripts I have changed the "%s"
and enable/disable dodfun (tried both)

But it seems luck not on my side. It still won't kick when reach 10 deaths.

any further suggestion to help?

Thank you.

Z@C 06-28-2006 23:38

Re: Can anyone help me on this ?
 
try this:
#include <amxmodx>
#include <dodfun>

public plugin_init() {
register_plugin("deaths_Kicker","1.0","Shadow Leader(123)")
register_event("ResetHUD","newRound","a") // flag "b" change to "a"
register_cvar("deaths_limit","10")
}

public newRound(id) {
new authid[32],reason[64]
get_user_authid(id, authid, 31)
if(dod_get_pl_deaths(id) >= get_cvar_num("deaths_limit")) {
format(reason,63,"Reached Death Limits (%s)",get_cvar_num("deaths_limit")) // i add this
server_cmd("kick #%d %s,get_user_userid(id),reason)
server_cmd("banid %s 5",authid) // changed %d to %s because authid is a string
}
}


All times are GMT -4. The time now is 08:06.

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