AlliedModders

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

n0obie4life 02-03-2005 07:59

script help.
 
Code:
#include <amxmodx> #include <amxmisc> #include <fun> #define TEAM_T 1 #define TEAM_CT 2 public round_start(id) {    switch(get_user_team(id)) {       case TEAM_T: if (get_cvar_num("c4_t")) give_item(id,"weapon_c4")       case TEAM_CT: if (get_cvar_num("c4_ct")) give_item(id,"weapon_c4") }    return PLUGIN_CONTINUE }   public plugin_init() { #define PLUGIN_NAME "C4 Madness" #define PLUGIN_VERSION "0.1" #define PLUGIN_AUTHOR "n0obie4life"    register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR) }    register_cvar("c4_t","1")    register_cvar("c4_ct","0")    register_event("ResetHUD", "round_start", "b") }

this is my script. i'm trying to port it and modify it. but now i'm having a problem.
Quote:

C:\Valve\Steam\SteamApps\n0obie4life\counter-strike\cstrike\addons\amxmodx\sc
ripting\c4_modes.sma(31) : error 021: symbol already defined: "register_cvar"
that is the error i'm getting. help please?

Damocles 02-03-2005 08:34

hmmm do u know how to code ? me thinks not

try removing the erroneous '}' in your code....and indent things nicely....the code compiles, not sure if its going to do what your after tho...

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #define TEAM_T 1 #define TEAM_CT 2 #define PLUGIN_NAME "C4 Madness" #define PLUGIN_VERSION "0.1" #define PLUGIN_AUTHOR "n0obie4life" public round_start(id) {       switch(get_user_team(id))     {         case TEAM_T: if (get_cvar_num("c4_t")) give_item(id,"weapon_c4")         case TEAM_CT: if (get_cvar_num("c4_ct")) give_item(id,"weapon_c4")     }     return PLUGIN_CONTINUE }   public plugin_init() {    register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)    register_cvar("c4_t","1")    register_cvar("c4_ct","0")    register_event("ResetHUD", "round_start", "b") }

n0obie4life 02-03-2005 09:01

nope nope, me dunno how to code, total n00b.

Damocles 02-03-2005 09:06

lol if you want to code some simple scripts why dont u read the stickys on good programming and the good stuff that was written about learning Small.

Would be much better for ya ;)

n0obie4life 02-05-2005 01:14

err okay :D..

but the plugin doesn't work the way i want it. look at the error?

BlueRaja 02-05-2005 01:24

What error might that be?

Damocles already told you how to fix the error in your original post...

n0obie4life 02-05-2005 03:46

i was told its some sort of cvar error...and besides what he gave me doesn't work :(.


All times are GMT -4. The time now is 19:16.

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