AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Kicking in AMX (https://forums.alliedmods.net/showthread.php?t=6200)

tekHneEk 09-24-2004 02:58

Kicking in AMX
 
okay I am BRAND new to AMX and have no previous coding experience as far as making plugins. I want to write a plugin.. preferably by myself that will kick people if they have 0 kills at the end of the round but have no idea how to do so, please don't write it for me just point me to a tuturial so I can learn, or tell me the command or help me with syntax anything, I am not a newb programmer, but new to AMX scripting I will pick it up fast with a little help, thanks alot.

-Bryan

on second thought I'm sure this is like 5-10 lines of code if even that much, so if you did write it out I wouldn't hate you, I would probably learn alot from it, just a thought.

johnjg75 09-24-2004 03:15

Sorry but this is at the beginning of a new round but it's still usable, right? :D
Code:
#include <amxmodx> // load functions from amxmodx.inc #inlcude <amxmisc> // some other functions from amxmisc.inc public plugin_init() { // declare the main of the plugin  register_plugin("Kick on 0","1","tekHneEk") // define the plugin as "Name" "version" and "author"  register_event("ResetHUD","docheck","b") // whenever someone spawns (usually on new round) execute docheck function and b flag sends it to the single player } // close the main function public docheck(id) { // make the function that is executed on new round and get their id  new frags = get_user_frags(id) // put their kills in the variable "frags"  if(frags == 0) { // if their kills are 0 then do this next part   client_cmd(id,"disconnect") // disconnect them from the server  } // end the if function  return PLUGIN_HANDLED // finish this function } // close this function
Im sorry that i written this for you but i added some pointers in it so you can understand how amxx scripting works but here's an example and i hope this helps :D

tekHneEk 09-24-2004 03:22

sweet man thanks alot I plan on becoming very good at this, and writing several plugins. thanks alot.


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

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