AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   nebie in need of a tut or something (https://forums.alliedmods.net/showthread.php?t=5331)

svendude 08-31-2004 20:25

I looked at your plug in, and i made my own. i did the god mode and ungod mode thingy, plus i made it so u can go faster, but when i compiled i get like 26 warnings, and it doesn't compile =(

heres wat i got:
Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <amxmod> public plugin_init(){     register_plugin("godspeed 007","1.0","carl")     register_concmd("amx_godmode","cmdgod",ADMIN_LEVEL_A,"<name or #userid>")     register_concmd("amx_fast","cmdfast",ADMIN_LEVEL_A,"<name or #userid>")     register_concmd("amx_fast","cmdunfast",ADMIN_LEVEL_A,"<name or #userid>")     register_concmd("amx_ungod","cmdungod",ADMIN_LEVEL_A,"<name or #userid>") } public cmdgod(id, level, cid) {     if (!cmd_access(id,level,cid2))     return PLUGIN_HANDLED     new arg[32]     read_argv(1,arg,31)     new player = cmd_target(id,arg,8)     if (!player) return PLUGIN_HANDLED     new authid[32],authid2[32],name2[32],name[32]     get_user_authid(id,authid,31)     get_user_authid(player,authid2,31)     get_user_name(player,name2,31)     get_user_name(id,name,31)     log_amx("God Mode: ^"%s<%s><>^" Made ^"%s<%s><>^"A God",     name,authid,name2,authid2)     set_user_godmode(player, 1);     return PLUGIN_HANDLED } {     if (!cmd_access(id,level,cid,2))     return PLUGIN_HANDLED     new arg[32]     read_argv(1,arg,31)     new player = cmd_target(id,arg,8)     new authid[32],authid2[32],name2[32],name[32]     get_user_authid(id,authid,31)     get_user_authid(player,authid2,31)     get_user_name(player,name2,31)     get_user_name(id,name,31)     if (!player) return PLUGIN_HANDLED     if (!get_user_godmode(player))     {         return PLUGIN_HANDLED         }     else     {     log_amx("God Mode: ^"%s<%s><>^" Made ^"%s<%s><>^"A Mortal",     name,authid,name2,authid2)     set_user_godmode(player, 0);     return PLUGIN_HANDLED     }     return PLUGIN_HANDLED } public cmdfast(id, level, cid) {     if (!cmd_access(id,level,cid2))     return PLUGIN_HANDLED     new arg[32]     read_argv(1,arg,31)     new player = cmd_target(id,arg,8)     if (!player) return PLUGIN_HANDLED     new authid[32],authid2[32],name2[32],name[32]     get_user_authid(id,authid,31)     get_user_authid(player,authid2,31)     get_user_name(player,name2,31)     get_user_name(id,name,31)     log_amx("speed: ^"%s<%s><>^" Made ^"%s<%s><>^"go faster!",     name,authid,name2,authid2)     set_user_maxspeed(id,750.0)     set_cvar_num("sv_maxspeed", 750)     return PLUGIN_HANDLED } public cmdunfast(id, level, cid) {     if (!cmd_access(id,level,cid2))     return PLUGIN_HANDLED     new arg[32]     read_argv(1,arg,31)     new player = cmd_target(id,arg,8)     if (!player) return PLUGIN_HANDLED     new authid[32],authid2[32],name2[32],name[32]     get_user_authid(id,authid,31)     get_user_authid(player,authid2,31)     get_user_name(player,name2,31)     get_user_name(id,name,31)     log_amx("speed: ^"%s<%s><>^" Made ^"%s<%s><>^"go normal speed!",     name,authid,name2,authid2)     set_user_maxspeed(id,320.0)     set_cvar_num("sv_maxspeed", 320)     return PLUGIN_HANDLED }

Peli 08-31-2004 20:41

Svendue want to just make a smaller plugin that makes everyone have godmode at the start of the round? Would be easier for you to work off of.

elmerfudd 08-31-2004 20:47

hey, just a tip newbie to newbie: dont use the fun or amxmod modules. instead, use the engine and amxmodx modules. im not sure if amxmisc even exists anymore. Someone with more experience, please do correct me.

I think that this was very good for a first post here...

svendude 08-31-2004 22:14

Quote:

Originally Posted by Peli
Svendue want to just make a smaller plugin that makes everyone have godmode at the start of the round? Would be easier for you to work off of.

ok sure, i had hard time with this plugin =D

Peli 09-01-2004 00:39

Quote:

Originally Posted by elmerfudd
hey, just a tip newbie to newbie: dont use the fun or amxmod modules. instead, use the engine and amxmodx modules. im not sure if amxmisc even exists anymore. Someone with more experience, please do correct me.

I think that this was very good for a first post here...

You can use Fun.inc and Amxmisc.inc but do not use Amxmod.inc , use Amxmodx.inc.
Quote:

Originally Posted by svendude
ok sure, i had hard time with this plugin =D

Here is a pretty simple plugin that gives everyone godmode at the start of the round , untested but compiled with no errors :
Code:
#include <amxmodx> // You need this so it can use Amxmodx.inc natives #include <fun> // You need this so it can use Fun.inc natives public plugin_init() // This is where you register stuff , like plugin name/version/author , cvars , client commands etc. {     register_plugin("Godmode","0.1","Svendude")     register_event("ResetHUD","god_on","b") } public god_on(id) // This is the godmode function I registered in the plugin_init() above {     set_user_godmode(id,1) // This sets someone to godmode     set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 5.0, 0.5, 1.5, 4) // This makes a hudmessage ( center of the screen )     show_hudmessage(0, "Everyone has godmode") // This is the actual message        return PLUGIN_HANDLED }

svendude 09-01-2004 05:37

omg WOW! thats easy!!! thx! =)

Votorx 09-01-2004 14:10

Quote:

hey, just a tip newbie to newbie: dont use the fun or amxmod modules. instead, use the engine and amxmodx modules. im not sure if amxmisc even exists anymore. Someone with more experience, please do correct me.
Amxmisc is used all the time to set restrictions to certain plugins. Without it people could give themselves god mode or slay anyone they want all the time. Althought you can mimic alot of the functions in the other include files I wouldn't recommend it since its harder to read and harder to do.

Svendude, the plugin I gave you is a bit excessive as it logs every action in the plugin. Don't even bother trying to log things unless you really want to keep track of your server. If I were to remake that plugin I could possibly deleate like over 100 lines of code and still generate the same effect.

svendude 09-01-2004 18:04

i know, i say the log thing, i just thought i HAD to put the log thing, btw if some1 would be kind enough to point out my mistakes, i would greatly appriciate it =D

Votorx 09-02-2004 14:11

Quote:

btw if some1 would be kind enough to point out my mistakes
Part of learning how to code is finding your own mistakes and correcting them yourself. If you have problems after that then you come searching for help.

svendude 09-02-2004 17:58

will do =) i see 2 of my mistakes, but thats about it =D im still looking for some though


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

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