AlliedModders

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

Extremeone 02-22-2005 15:03

Anubis Help
 
Can someone help me take this superhero plugin and make it a stand alone plugin(its ok if it still uses vexd i just want it no superhero)

all it has to do is automaticly give anubis to admins with ban acess


Code:
// Anubis - King Of The Underworld /* CVARS - copy and paste to shconfig.cfg //Anubis anubis_level 0 anibus_showdamage 1     //(0|1) - hide|show bullet damage.. anibus_showchat 1       //(0|1) - hide|show ghostchat messages.. */ /* *   v1.17 - JTP10181 *   - Added ablily to disable the ghostchat like function *       for servers that already have ghostchat */ #include <amxmod> #include <Vexd_Utilities> #include <superheromod> // GLOBAL VARIABLES new gHeroName[]="Anubis" new bool:gHasAnubisPowers[SH_MAXSLOTS+1] new gmsgSayText //---------------------------------------------------------------------------------------------- public plugin_init() {     // Plugin Info     register_plugin("SUPERHERO Anubis","1.17.5","AssKicR/JTP10181")     // DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG     register_cvar("anubis_level", "0" )     register_cvar("anibus_showdamage", "1")     register_cvar("anibus_showchat", "1")     // FIRE THE EVENT TO CREATE THIS SUPERHERO!     shCreateHero(gHeroName, "Dark Notices", "Nothing Is Secret From You.  Hear Enemies - See Damage", false, "anubis_level" )     // REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)     register_event("ResetHUD","anubis_newround","b")     register_srvcmd("anubis_init", "anubis_init")     shRegHeroInit(gHeroName, "anubis_init")     // Damage Event     register_event("Damage", "damage_msg", "b", "2!0", "3=0", "4!0")     // Say     register_clcmd("say", "handle_say")     register_clcmd("say_team", "handle_say")     gmsgSayText = get_user_msgid("SayText") } //---------------------------------------------------------------------------------------------- public anubis_init() {     new temp[6]     // First Argument is an id     read_argv(1,temp,5)     new id = str_to_num(temp)     // 2nd Argument is 0 or 1 depending on whether the id has anubis     read_argv(2,temp,5)     new hasPowers=str_to_num(temp)     // Got to disable anubis that lost his powers...     gHasAnubisPowers[id] = (hasPowers!=0)     if (gHasAnubisPowers[id]) anubis_speak_on(id)     else anubis_speak_off(id) } //---------------------------------------------------------------------------------------------- public anubis_newround(id) {     if (gHasAnubisPowers[id]) anubis_speak_on(id) } //---------------------------------------------------------------------------------------------- public handle_say(id) {     if ( !get_cvar_num("anibus_showchat") ) return PLUGIN_CONTINUE     new command[10],players[SH_MAXSLOTS]     new message[191],name[33], player_count     new teamname[5], sMessage[191]     read_argv(0, command, 16)     read_argv(1, message, 190)     if (equal(message,"") || equal(message,"[")) return PLUGIN_CONTINUE     new is_alive = is_user_alive(id)     new team = get_user_team(id)     new isSayTeam = equal(command, "say_team")     get_user_name(id, name, 32)     if (team == 1) copy(teamname,4,"(T)")     else if (team == 2) copy(teamname,4,"(CT)")     format(sMessage,190, "%c[DN]%s%s%s :  %s^n", 2,  isSayTeam ? teamname : "", is_alive ? "*ALIVE*" : "*DEAD*", name, message)     get_players(players, player_count, "c")     for (new i = 0; i < player_count; i++) {         if (gHasAnubisPowers[players[i]] && is_user_connected(players[i])) {             if (is_user_alive(players[i]) && !is_alive || isSayTeam && team != get_user_team(players[i])) {                 message_begin(MSG_ONE,gmsgSayText,{0,0,0},players[i])                 write_byte(id)                 write_string(sMessage)                 message_end()             }         }     }     return PLUGIN_CONTINUE } //---------------------------------------------------------------------------------------------- public anubis_speak_on(id) {     if (gHasAnubisPowers[id] && is_user_connected(id)) {         SetSpeak(id, SPEAK_LISTENALL)     } } //---------------------------------------------------------------------------------------------- public anubis_speak_off(id) {     if (!gHasAnubisPowers[id] && is_user_connected(id)) {         SetSpeak(id, SPEAK_NORMAL)     } } //---------------------------------------------------------------------------------------------- public damage_msg(vIndex) {     if (!is_user_connected(vIndex)) return PLUGIN_CONTINUE     if ( get_cvar_num("anibus_showdamage") ) {         new aIndex = get_user_attacker(vIndex)         if ( aIndex <= 0 || aIndex > SH_MAXSLOTS ||vIndex <= 0 || vIndex > SH_MAXSLOTS  || vIndex == aIndex ) return PLUGIN_CONTINUE         new damage = read_data(2)         if ( is_user_alive(aIndex) && gHasAnubisPowers[aIndex]) {             set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 2.0, 0.02, 0.02, 74)             show_hudmessage(aIndex,"%i", damage)         }         if ( is_user_alive(vIndex) && gHasAnubisPowers[vIndex] ) {             set_hudmessage(200, 0, 0, -1.0, 0.48, 2, 0.1, 2.0, 0.02, 0.02, 76)             show_hudmessage(vIndex,"%i", damage)         }     }     return PLUGIN_CONTINUE } //---------------------------------------------------------------------------------------------- public client_connect(id) {     gHasAnubisPowers[id] = false } //----------------------------------------------------------------------------------------------

Dizzy 02-22-2005 15:20

Try This

I went through it quick and got rid of some things..

You Might Need To Compile It With The superhero.inc though

try it without it first

I left #include <superhero> in there

Code:
#include <amxmod> #include <Vexd_Utilities> #include <superheromod> new bool:gHasAnubisPowers[32] //---------------------------------------------------------------------------------------------- public plugin_init() {     register_plugin("SUPERHERO Anubis","1.17.5","AssKicR/JTP10181")         register_cvar("anubis_level", "0" )     register_cvar("anibus_showdamage", "1")     register_cvar("anibus_showchat", "1")         register_event("ResetHUD","anubis_newround","b")         register_srvcmd("anubis_init", "anubis_init")         register_event("Damage", "damage_msg", "b", "2!0", "3=0", "4!0")         register_clcmd("say", "handle_say")     register_clcmd("say_team", "handle_say")         gmsgSayText = get_user_msgid("SayText") } //---------------------------------------------------------------------------------------------- public anubis_init() {     {         if (is_user_alive)             (gHasAnubisPowers) = true     }     else     {             (gHasAnubisPowers) = false     }     new temp[6]     read_argv(1,temp,5)     new id = str_to_num(temp)     read_argv(2,temp,5)     new hasPowers=str_to_num(temp) } public handle_say(id) {     if ( !get_cvar_num("anibus_showchat") ) return PLUGIN_CONTINUE     new command[10],players[SH_MAXSLOTS]     new message[191],name[33], player_count     new teamname[5], sMessage[191]     read_argv(0, command, 16)     read_argv(1, message, 190)     if (equal(message,"") || equal(message,"[")) return PLUGIN_CONTINUE     new is_alive = is_user_alive(id)     new team = get_user_team(id)     new isSayTeam = equal(command, "say_team")     get_user_name(id, name, 32)     if (team == 1) copy(teamname,4,"(T)")     else if (team == 2)    copy(teamname,4,"(CT)")     format(sMessage,190, "%c[DN]%s%s%s :  %s^n", 2,  isSayTeam ? teamname : "", is_alive ? "*ALIVE*" : "*DEAD*", name, message)     get_players(players, player_count, "c")     for (new i = 0; i < player_count; i++) {         if (gHasAnubisPowers[players[i]] && is_user_connected(players[i])) {             if (is_user_alive(players[i]) && !is_alive || isSayTeam && team != get_user_team(players[i])) {                 message_begin(MSG_ONE,gmsgSayText,{0,0,0},players[i])                 write_byte(id)                 write_string(sMessage)                 message_end()             }         }     }     return PLUGIN_CONTINUE } //---------------------------------------------------------------------------------------------- public anubis_speak_on(id) {     SetSpeak(id, SPEAK_LISTENALL) } //---------------------------------------------------------------------------------------------- public anubis_speak_off(id) {     SetSpeak(id, SPEAK_NORMAL) } //---------------------------------------------------------------------------------------------- public damage_msg(vIndex) {     if (!is_user_connected(vIndex)) return PLUGIN_CONTINUE     if ( get_cvar_num("anibus_showdamage") ) {         new aIndex = get_user_attacker(vIndex)         if ( aIndex <= 0 || aIndex > SH_MAXSLOTS ||vIndex <= 0 || vIndex > SH_MAXSLOTS  || vIndex == aIndex ) return PLUGIN_CONTINUE         new damage = read_data(2)         if ( is_user_alive(aIndex) {             set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 2.0, 0.02, 0.02, 74)             show_hudmessage(aIndex,"%i", damage)         }         if ( is_user_alive(vIndex) {             set_hudmessage(200, 0, 0, -1.0, 0.48, 2, 0.1, 2.0, 0.02, 0.02, 76)             show_hudmessage(vIndex,"%i", damage)         }     }     return PLUGIN_CONTINUE } //---------------------------------------------------------------------------------------------- public client_connect(id) {    (gHasAnubisPowers[id]) = true } public client_disconnect(id) {    (gHasAnubisPowers[id]) = false } //----------------------------------------------------------------------------------------------

Extremeone 02-22-2005 15:40

Code:

//// anubis.sma
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\anubis.sma(25) : error 017: undefined symbol "gmsgSayText"
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\anubis.sma(33) : error 076: syntax error in the expression, or invalid
 function call
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\anubis.sma(34 -- 35) : error 033: array must be indexed (variable "gHa
sAnubisPowers")
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\anubis.sma(37) : error 029: invalid expression, assumed zero
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\anubis.sma(39 -- 40) : error 033: array must be indexed (variable "gHa
sAnubisPowers")
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\anubis.sma(50) : warning 204: symbol is assigned a value that is never
 used: "hasPowers"
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\anubis.sma(50) : warning 204: symbol is assigned a value that is never
 used: "id"
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\anubis.sma(79) : error 017: undefined symbol "gmsgSayText"
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\anubis.sma(79) : warning 215: expression has no effect
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\anubis.sma(79) : warning 215: expression has no effect
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\anubis.sma(79) : warning 215: expression has no effect
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\anubis.sma(79) : error 001: expected token: ";", but found "}"
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\anubis.sma(79) : error 029: invalid expression, assumed zero
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\anubis.sma(79) : fatal error 107: too many error messages on one line
//
// Compilation aborted.
// 9 Errors.
// Could not locate output file compiled\anubis.amx (compile failed).
//
// Compilation Time: 0.5 sec
// ----------------------------------------


Dizzy 02-22-2005 15:45

ehhh..

I am not too sure you have to define somethings at the top cause it doesn't know what hasPowers is

so just try to debug it..

I added something things and took out somethings

Extremeone 02-22-2005 16:10

Quote:

Originally Posted by Extremeone
//// anubis.sma
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\anubis.sma(25) : error 017: undefined symbol "gmsgSayText"
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\anubis.sma(33) : error 076: syntax error in the expression, or invalid
function call
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\anubis.sma(34 -- 35) : error 033: array must be indexed (variable "gHa
sAnubisPowers")
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\anubis.sma(37) : error 029: invalid expression, assumed zero
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\anubis.sma(39 -- 40) : error 033: array must be indexed (variable "gHa
sAnubisPowers")
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\anubis.sma(50) : warning 204: symbol is assigned a value that is never
used: "hasPowers"
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\anubis.sma(50) : warning 204: symbol is assigned a value that is never
used: "id"
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\anubis.sma(79) : error 017: undefined symbol "gmsgSayText"
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\anubis.sma(79) : warning 215: expression has no effect
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\anubis.sma(79) : warning 215: expression has no effect
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\anubis.sma(79) : warning 215: expression has no effect
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\anubis.sma(79) : error 001: expected token: ";", but found "}"
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\anubis.sma(79) : error 029: invalid expression, assumed zero
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\anubis.sma(79) : fatal error 107: too many error messages on one line
//
// Compilation aborted.
// 9 Errors.
// Could not locate output file compiled\anubis.amx (compile failed).
//
// Compilation Time: 0.5 sec
// ----------------------------------------


XxAvalanchexX 02-22-2005 16:19

This should go in the REQUESTS forum.

Dizzy 02-22-2005 17:09

Unless he just wants help with it

That's What I did was give a Little Help To Him :D

:D

Extremeone 02-22-2005 17:48

got it down to 6 errors anyone help?

Code:
#include <amxmodx> #include <engine> #include <fun> #include <Vexd_Utilities> #include <superheromod> new bool:gHasAnubisPowers[32] new gmsgSayText //---------------------------------------------------------------------------------------------- public plugin_init() {     register_plugin("SUPERHERO Anubis","1.17.5","AssKicR/JTP10181")         register_cvar("anubis_level", "0" )     register_cvar("anibus_showdamage", "1")     register_cvar("anibus_showchat", "1")         register_event("ResetHUD","anubis_newround","b")         register_srvcmd("anubis_init", "anubis_init")         register_event("Damage", "damage_msg", "b", "2!0", "3=0", "4!0")         register_clcmd("say", "handle_say")     register_clcmd("say_team", "handle_say")         gmsgSayText = get_user_msgid("SayText") } //---------------------------------------------------------------------------------------------- public anubis_init() {     {         if (is_user_alive)             (gHasAnubisPowers) = true     }     else     {             (gHasAnubisPowers) = false     }     new temp[6]     read_argv(1,temp,5)     new id = str_to_num(temp)     read_argv(2,temp,5)     new hasPowers=str_to_num(temp) } public handle_say(id) {     if ( !get_cvar_num("anibus_showchat") ) return PLUGIN_CONTINUE     new command[10],players[SH_MAXSLOTS]     new message[191],name[33], player_count     new teamname[5], sMessage[191]     read_argv(0, command, 16)     read_argv(1, message, 190)     if (equal(message,"") || equal(message,"[")) return PLUGIN_CONTINUE     new is_alive = is_user_alive(id)     new team = get_user_team(id)     new isSayTeam = equal(command, "say_team")     get_user_name(id, name, 32)     if (team == 1) copy(teamname,4,"(T)")     else if (team == 2)    copy(teamname,4,"(CT)")     format(sMessage,190, "%c[DN]%s%s%s :  %s^n", 2,  isSayTeam ? teamname : "", is_alive ? "*ALIVE*" : "*DEAD*", name, message)     get_players(players, player_count, "c")     for (new i = 0; i < player_count; i++) {         if (gHasAnubisPowers[players[i]] && is_user_connected(players[i])) {             if (is_user_alive(players[i]) && !is_alive || isSayTeam && team != get_user_team(players[i])) {                 message_begin(MSG_ONE,gmsgSayText,{0,0,0},players[i])                 write_byte(id)                 write_string(sMessage)                 message_end()             }         }     }     return PLUGIN_CONTINUE } //---------------------------------------------------------------------------------------------- public anubis_speak_on(id) {     SetSpeak(id, SPEAK_LISTENALL) } //---------------------------------------------------------------------------------------------- public anubis_speak_off(id) {     SetSpeak(id, SPEAK_NORMAL) } //---------------------------------------------------------------------------------------------- public damage_msg(vIndex) {     if (!is_user_connected(vIndex)) return PLUGIN_CONTINUE     if ( get_cvar_num("anibus_showdamage") ) {         new aIndex = get_user_attacker(vIndex)         if ( aIndex <= 0 || aIndex > SH_MAXSLOTS ||vIndex <= 0 || vIndex > SH_MAXSLOTS  || vIndex == aIndex ) return PLUGIN_CONTINUE         new damage = read_data(2)         if ( is_user_alive(aIndex) {             set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 2.0, 0.02, 0.02, 74)             show_hudmessage(aIndex,"%i", damage)         }         if ( is_user_alive(vIndex) {             set_hudmessage(200, 0, 0, -1.0, 0.48, 2, 0.1, 2.0, 0.02, 0.02, 76)             show_hudmessage(vIndex,"%i", damage)         }     }     return PLUGIN_CONTINUE } //---------------------------------------------------------------------------------------------- public client_connect(id) {    (gHasAnubisPowers[id]) = true } public client_disconnect(id) {    (gHasAnubisPowers[id]) = false } //----------------------------------------------------------------------------------------------

Code:

//// 1.sma
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\1.sma(36) : error 076: syntax error in the expression, or invalid func
tion call
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\1.sma(37 -- 38) : error 033: array must be indexed (variable "gHasAnub
isPowers")
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\1.sma(40) : error 029: invalid expression, assumed zero
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\1.sma(42 -- 43) : error 033: array must be indexed (variable "gHasAnub
isPowers")
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\1.sma(53) : warning 204: symbol is assigned a value that is never used
: "hasPowers"
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\1.sma(53) : warning 204: symbol is assigned a value that is never used
: "id"
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\1.sma(112) : error 001: expected token: ")", but found "{"
// C:\Documents and Settings\Radle Family\Desktop\Abe's Stuff\superhero editing\
scripting\1.sma(117) : error 001: expected token: ")", but found "{"
//
// 6 Errors.
// Could not locate output file compiled\1.amx (compile failed).
//
// Compilation Time: 0.65 sec
// ----------------------------------------


XxAvalanchexX 02-22-2005 18:57

Do you have any scripting experience? Can you read?

If you answered yes to both of these question, you should easily be able to go to the line number and fix the problems.

Extremeone 02-22-2005 19:33

do i have any scripting experience? no i came to amxx looking for some sweet plugins after using search around 500000 times i finally took it upon myself and asked some to be kind enough to fix 6 small errors in the code



please help i have almost no clue wat im doing all my knowledge comes from "search"


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

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