AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   can anyone help? (again) (https://forums.alliedmods.net/showthread.php?t=24778)

silversinner 03-02-2006 11:33

can anyone help? (again)
 
Right as you know im new to scripting i only really know simple plugin (like kick plugins) and im just looking for info to store in my brain!

I've been working on a new plugin for my friend! i call it hacker abuse!
all it does is count down from 5 to 0 after 0 it starts abusing! after abuse it bans them! Now i've put in the ban cmd at the end
Code:

new ip [16] {
        get_user_ip(id, ip, 15, 1)
        server_cmd("kick #%d ^"You have been banned for Hacking!.^"", get_user_userid(id))
        server_exec()
        server_cmd("addip 5 ^"%s^"", ip) 
        server_print("[AMXX] HaCkEr AbUsEd & BaNnEd!")
}

(This is the code a guy told me on my other topic :D cheers)

I need to know 2 things if i add:
Code:

set_task(1.0,"ip")
and then the ban code at the bottom:
Code:

new ip [16] {
        get_user_ip(id, ip, 15, 1)
        server_cmd("kick #%d ^"You have been banned for Hacking!.^"", get_user_userid(id))
        server_exec()
        server_cmd("addip 5 ^"%s^"", ip) 
        server_print("[AMXX] HaCkEr AbUsEd & BaNnEd!")
}

Will it pick up on the fact i want it to exicute that code after so&so amount of seconds. If not how do i do it? (I've looked everywere for tutorials so this is my last resort)

My second question is: If i want to add another code. that i want it to exicute amx_uberslap would it be this: (after adding set_task(0.0,"uberslap")

Code:

public uberslap [16] {
        get_user_ip(id, ip, 15, 1)
        server_cmd("amx_uberslap", get_user_userid(id))     
        server_print("[AMXX] HaCkEr AbUsEd & BaNnEd!")

Now i know i will have to add end tags ect... but all i need is a code that will enable me to do this

:( i know this may seem.... weird but i have searched high and low on the net for tutorials on this paticlur subject but havnt found any!

If you could help! id really appreciate it !

silversinner

Werewolf 03-02-2006 12:39

You could send whole sma file in 1 code "block" so we can see whole code. Would be easier to help then.[/code]

silversinner 03-02-2006 13:15

Ok this is what i have so far (this is my first attempt at making a plugin, may expect lots of mistakes :) )

Code:

//Hacker abuse v0.1 - Silversinner
//with help from VEN

#include <amxmodx>
#include <amxmisc>




public plugin_init() {
        register_plugin("HaCkEr AbUsE","0.1","Silversinner")
        register_concmd("amx_hacker_attack","hackerattack",ADMIN_BAN," - Punishes hackers then bans them")
}
         
public hackerattack(id) {
        if (!(get_user_flags(id)&ADMIN_LEVEL_A)) {
                console_print(id,"[AMXX] Access Denied!")
                return PLUGIN_HANDLED
}
        if (read_argc() == 0) {
        console_print(id,"[AMXX] You must specify a user")
        return PLUGIN_HANDLED
    }
   
    new user[32], uid 
    read_argv(1,user,32)
    uid = find_player("bh",user)
    if (uid == 0) {
        console_print(id,"[AMXX] Invalid User Id")
        return PLUGIN_HANDLED
}
        set_task(0.0,"alert")
        set_task(1.0,"five")
        set_task(2.0,"four")
        set_task(3.0,"three")
        set_task(4.0,"two")
        set_task(5.0,"one")
        set_task(6.0,"zero")
        set_task(7.0,"slap")
        set_task(8.0,"fire")
        set_task(16.0,"ban")
        return PLUGIN_HANDLED
}

public alert() {
        client_print(0,print_chat,"***** ALERT! HACKER DETECTED!")
        server_print("[AMXX] ***** ALERT! HACKER DETECTED! *****")
        client_cmd(0,"spk ^"fvox/warning.wav^"")
}


public five() {
        client_print(0,print_chat,"[AMXX] HaCkEr AbUsE in 5....")
        server_print("[AMXX] HaCkEr AbUsE in 5....")

        client_cmd(0,"spk ^"fvox/five.wav^"")
}

public four() {
        client_print(0,print_chat,"[AMXX] HaCkEr AbUsE in 4....")
        server_print("[AMXX] HaCkEr AbUsE in 4....")

        client_cmd(0,"spk ^"fvox/four.wav^"")
}

public three() {
        client_print(0,print_chat,"[AMXX] HaCkEr AbUsE in 3....")
        server_print("[AMXX] HaCkEr AbUsE in 3....")

        client_cmd(0,"spk ^"fvox/three.wav^"")
}

public two() {
        client_print(0,print_chat,"[AMXX] HaCkEr AbUsE in 2....")
        server_print("[AMXX] HaCkEr AbUsE in 2....")
 
        client_cmd(0,"spk ^"fvox/two.wav^"")
}

public one() {
        client_print(0,print_chat,"[AMXX] HaCkEr AbUsE in 1....")
        server_print("[AMXX] HaCkEr AbUsE in 1....")

        client_cmd(0,"spk ^"fvox/one.wav^"")
}

public zero() {
        client_print(0,print_chat,"[AMXX] HaCkEr AbUsEd....")
        server_print("[AMXX] HaCkEr AbUsing!")

        client_cmd(0,"spk ^"fvox/safe_day.wav^"")
}

public slap() {
                              get_user_ip(id, ip, 15, 1)
                              client_print(0,print_chat,"[AMXX] AbUsEd hacker"
                              server_cmd("amx_uberslap", get_user_userid(id))
}

public fire (){
                            get_user_ip(id, ip, 15, 1)
                            client_print(0,print_chat,"[AMXX] AbUsEd hacker MoRe!!"
                            server_cmd("amx_fire", get_user_userid(id))
}

public ban (16) {
        get_user_ip(id, ip, 15, 1)
        server_cmd("kick #%d ^"You have been banned for Hacking!.^"", get_user_userid(id))
        server_exec()
        server_cmd("addip 5 ^"%s^"", ip) 
        server_print("[AMXX] HaCkEr AbUsEd & BaNnEd!")
}

Now i havnt compiled it yet... im not even sure is its correct :s

VEN 03-02-2006 13:15

Please, use instead of tags.

silversinner 03-02-2006 13:17

:s ok...

bit late :P i post again

silversinner 03-02-2006 13:18

Code:
//Hacker abuse v0.1 - Silversinner //with help from VEN #include <amxmodx> #include <amxmisc> public plugin_init() {     register_plugin("HaCkEr AbUsE","0.1","Silversinner")     register_concmd("amx_hacker_attack","hackerattack",ADMIN_BAN," - Punishes hackers then bans them") }     public hackerattack(id) {     if (!(get_user_flags(id)&ADMIN_LEVEL_A)) {         console_print(id,"[AMXX] Access Denied!")         return PLUGIN_HANDLED }     if (read_argc() == 0) {         console_print(id,"[AMXX] You must specify a user")         return PLUGIN_HANDLED     }            new user[32], uid       read_argv(1,user,32)     uid = find_player("bh",user)     if (uid == 0) {         console_print(id,"[AMXX] Invalid User Id")         return PLUGIN_HANDLED }     set_task(0.0,"alert")     set_task(1.0,"five")     set_task(2.0,"four")     set_task(3.0,"three")     set_task(4.0,"two")     set_task(5.0,"one")     set_task(6.0,"zero")     set_task(7.0,"slap")     set_task(8.0,"fire")     set_task(16.0,"ban")     return PLUGIN_HANDLED } public alert() {     client_print(0,print_chat,"***** ALERT! HACKER DETECTED!")     server_print("[AMXX] ***** ALERT! HACKER DETECTED! *****")     client_cmd(0,"spk ^"fvox/warning.wav^"") } public five() {     client_print(0,print_chat,"[AMXX] HaCkEr AbUsE in 5....")     server_print("[AMXX] HaCkEr AbUsE in 5....")     client_cmd(0,"spk ^"fvox/five.wav^"") } public four() {     client_print(0,print_chat,"[AMXX] HaCkEr AbUsE in 4....")     server_print("[AMXX] HaCkEr AbUsE in 4....")     client_cmd(0,"spk ^"fvox/four.wav^"") } public three() {     client_print(0,print_chat,"[AMXX] HaCkEr AbUsE in 3....")     server_print("[AMXX] HaCkEr AbUsE in 3....")     client_cmd(0,"spk ^"fvox/three.wav^"") } public two() {     client_print(0,print_chat,"[AMXX] HaCkEr AbUsE in 2....")     server_print("[AMXX] HaCkEr AbUsE in 2....")       client_cmd(0,"spk ^"fvox/two.wav^"") } public one() {     client_print(0,print_chat,"[AMXX] HaCkEr AbUsE in 1....")     server_print("[AMXX] HaCkEr AbUsE in 1....")     client_cmd(0,"spk ^"fvox/one.wav^"") } public zero() {     client_print(0,print_chat,"[AMXX] HaCkEr AbUsEd....")     server_print("[AMXX] HaCkEr AbUsing!")     client_cmd(0,"spk ^"fvox/safe_day.wav^"") } public slap() {                               get_user_ip(id, ip, 15, 1)                               client_print(0,print_chat,"[AMXX] AbUsEd hacker"                               server_cmd("amx_uberslap", get_user_userid(id)) } public fire (){                              get_user_ip(id, ip, 15, 1)                              client_print(0,print_chat,"[AMXX] AbUsEd hacker MoRe!!"                              server_cmd("amx_fire", get_user_userid(id)) } public ban (16) {         get_user_ip(id, ip, 15, 1)         server_cmd("kick #%d ^"You have been banned for Hacking!.^"", get_user_userid(id))         server_exec()         server_cmd("addip 5 ^"%s^"", ip)           server_print("[AMXX] HaCkEr AbUsEd & BaNnEd!") }

Werewolf 03-02-2006 13:32

Biggest problem is = id and ip is undefined!
And after that it is only some small edits you have to do.
Here is the code so far.
Code:
//Hacker abuse v0.1 - Silversinner //with help from VEN #include <amxmodx> #include <amxmisc> public plugin_init() {    register_plugin("HaCkEr AbUsE","0.1","Silversinner")    register_concmd("amx_hacker_attack","hackerattack",ADMIN_BAN," - Punishes hackers then bans them") }       public hackerattack(id) {    if (!(get_user_flags(id)&ADMIN_LEVEL_A) ) {       console_print(id,"[AMXX] Access Denied!")       return PLUGIN_HANDLED }    if (read_argc() == 0) {         console_print(id,"[AMXX] You must specify a user")         return PLUGIN_HANDLED     }         new user[32],uid       read_argv(1, user, 32)     uid = find_player("bh",user)     if (uid == 0) {         console_print(id,"[AMXX] Invalid User Id")         return PLUGIN_HANDLED }    set_task(0.0,"alert")    set_task(1.0,"five")    set_task(2.0,"four")    set_task(3.0,"three")    set_task(4.0,"two")    set_task(5.0,"one")    set_task(6.0,"zero")    set_task(7.0,"slap")    set_task(8.0,"fire")    set_task(16.0,"ban")    return PLUGIN_HANDLED } public alert() {    client_print(0,print_chat,"***** ALERT! HACKER DETECTED!")    server_print("[AMXX] ***** ALERT! HACKER DETECTED! *****")    client_cmd(0,"spk ^"fvox/warning.wav^"") } public five() {    client_print(0,print_chat,"[AMXX] HaCkEr AbUsE in 5....")    server_print("[AMXX] HaCkEr AbUsE in 5....")    client_cmd(0,"spk ^"fvox/five.wav^"") } public four() {    client_print(0,print_chat,"[AMXX] HaCkEr AbUsE in 4....")    server_print("[AMXX] HaCkEr AbUsE in 4....")    client_cmd(0,"spk ^"fvox/four.wav^"") } public three() {    client_print(0,print_chat,"[AMXX] HaCkEr AbUsE in 3....")    server_print("[AMXX] HaCkEr AbUsE in 3....")    client_cmd(0,"spk ^"fvox/three.wav^"") } public two() {    client_print(0,print_chat,"[AMXX] HaCkEr AbUsE in 2....")    server_print("[AMXX] HaCkEr AbUsE in 2....")      client_cmd(0,"spk ^"fvox/two.wav^"") } public one() {    client_print(0,print_chat,"[AMXX] HaCkEr AbUsE in 1....")    server_print("[AMXX] HaCkEr AbUsE in 1....")    client_cmd(0,"spk ^"fvox/one.wav^"") } public zero() {    client_print(0,print_chat,"[AMXX] HaCkEr AbUsEd....")    server_print("[AMXX] HaCkEr AbUsing!")    client_cmd(0,"spk ^"fvox/safe_day.wav^"") } public slap() {                               get_user_ip(id, ip, 15, 1)                               client_print(0,print_chat,"[AMXX] AbUsEd hacker")                               server_cmd("amx_uberslap", get_user_userid(id) ) } public fire (){                              get_user_ip(id, ip, 15, 1)                              client_print(0,print_chat,"[AMXX] AbUsEd hacker MoRe!!")                              server_cmd("amx_fire", get_user_userid(id) ) } public ban (16) {         get_user_ip(id, ip, 15, 1)         server_cmd("kick #%d ^"You have been banned for Hacking!.^"", get_user_userid(id) )         server_exec()         server_cmd("addip 5 ^"%s^"", ip)           server_print("[AMXX] HaCkEr AbUsEd & BaNnEd!") }

silversinner 03-02-2006 13:33

How do i define it properly?

Werewolf 03-02-2006 13:41

Actually... I've only created superheroes for superheromod so far, and some small plugins. Not released though, but on my plugins. Created one named weapongiver, but anyways. I just added id to my plugins and woilla it worked. id is an index by the way. I'm working on it now anyways.

*Some minutes later*
Can't make it work. :?
And why do you use the amx_uberslap and the amx_fire?
Some people doesn't have amx_uberslap and amx_fire.
Eg. Me :lol:

silversinner 03-02-2006 13:43

Ok thank you. I coulndt see any other way to get it to use amx_uberslap & amx_fire one after another and then 11 seconds l8r amx_banid ect ect


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

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