AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   What did i do wrong? (https://forums.alliedmods.net/showthread.php?t=10586)

Extremeone 02-23-2005 22:24

What did i do wrong?
 
Can Someone help me with this for some reason when i go in the server it doesent show the team says or dead peoples chat

Code:
#include <amxmodx> #include <Vexd_Utilities> #include <superheromod> new bool:gHasAnubisPowers[SH_MAXSLOTS+1] new gmsgSayText //---------------------------------------------------------------------------------------------- public plugin_init() {     register_plugin("SUPERHERO Anubis","1.17.5","AssKicR/JTP10181")     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 (get_user_flags(33) & ADMIN_BAN)            (gHasAnubisPowers [32]) = true            else            (gHasAnubisPowers [32]) = false     }     new temp[6]     read_argv(1,temp,5)     read_argv(2,temp,5) } //---------------------------------------------------------------------------------------------- public handle_say() {     new command[10],players[32]     new message[191],name[33], player_count     new teamname[5], sMessage[191]     read_argv(0, command, 16)     read_argv(1, message, 190)     new temp[6]     new id = str_to_num(temp)     new is_alive = is_user_alive(id)     new team = get_user_team(id)     new isSayTeam = equal(command, "say_team")     get_user_name(id, name, 33)     if (team == 1) copy(teamname,4,"(T)")     else if (team == 2)    copy(teamname,4,"(CT)")     format(sMessage,190, "%c[AN]%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[id]] & is_user_connected(players[i]))         {             if (is_user_alive(players[id]) & !is_alive || isSayTeam & team != get_user_team(players[id]))             {                 message_begin(MSG_ONE,gmsgSayText,{0,0,0},players[id])                 write_byte(id)                 write_string(sMessage)                 message_end()             }         }     }     return PLUGIN_CONTINUE } //---------------------------------------------------------------------------------------------- public damage_msg(id) {         new aIndex = get_user_attacker(id)         new damage = read_data(2)         if ( is_user_alive(id))  {             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(id)) {             set_hudmessage(200, 0, 0, -1.0, 0.48, 2, 0.1, 2.0, 0.02, 0.02, 76)             show_hudmessage(id,"%i", damage)         } }

BTW this compiles fine with only two warnings

Code:

(61) : warning 213: tag mismatch
(63) : warning 213: tag mismatch


Freecode 02-23-2005 22:36

is_alive()

Extremeone 02-24-2005 09:00

i fixed so theres no more warnings but wat do you meen freecode?


edit oh heres the one with no warnings

Code:
#include <amxmodx> #include <Vexd_Utilities> #include <superheromod> new bool:gHasAnubisPowers[SH_MAXSLOTS+1] new gmsgSayText //---------------------------------------------------------------------------------------------- public plugin_init() {     register_plugin("SUPERHERO Anubis","1.17.5","AssKicR/JTP10181")     register_cvar("anibus_showdamage", "1")         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 (get_user_flags(33) & ADMIN_BAN)            (gHasAnubisPowers [32]) = true            else            (gHasAnubisPowers [32]) = false     }     new temp[6]     read_argv(1,temp,5)     read_argv(2,temp,5) } //---------------------------------------------------------------------------------------------- public handle_say() {     new command[10],players[32]     new message[191],name[33], player_count     new teamname[5], sMessage[191]     read_argv(0, command, 16)     read_argv(1, message, 190)     new temp[6]     new id = str_to_num(temp)     new is_alive = is_user_alive(id)     new team = get_user_team(id)     new isSayTeam = equal(command, "say_team")     get_user_name(id, name, 33)     if (team == 1) copy(teamname,4,"(T)")     else if (team == 2)    copy(teamname,4,"(CT)")     format(sMessage,190, "%c[AN]%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[id]] && is_user_connected(players[i]))         {             if (is_user_alive(players[id]) && !is_alive || isSayTeam && team != get_user_team(players[id]))             {                 message_begin(MSG_ONE,gmsgSayText,{0,0,0},players[id])                 write_byte(id)                 write_string(sMessage)                 message_end()             }         }     }     return PLUGIN_CONTINUE } //---------------------------------------------------------------------------------------------- public damage_msg(id) {         new aIndex = get_user_attacker(id)         new damage = read_data(2)         if ( is_user_alive(id))  {             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(id)) {             set_hudmessage(200, 0, 0, -1.0, 0.48, 2, 0.1, 2.0, 0.02, 0.02, 76)             show_hudmessage(id,"%i", damage)         } }

Extremeone 02-24-2005 19:25

does anyone know wat free code ment? :?

Crazywelder1 02-24-2005 21:00

i think he ment the string is_alive or something like that and this plugin doesnt work??

Extremeone 02-24-2005 23:24

the chat part doesent work

Extremeone 02-26-2005 09:22

Quote:

Originally Posted by Extremeone
does anyone know wat free code ment? :?


Freecode 02-26-2005 14:11

i mean this part "is_alive ?" has to be changed to "is_user_alive(id) ?"
but make sure u put in the right id in there

Extremeone 02-26-2005 16:10

but lol you didnt tell me the right id to put in there

Freecode 02-26-2005 23:53

actualy nvm. i didnt see ur is_alive declaration. but ur whole function looks very messy. theres so much useless stuff. get rid of it.


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

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