Raised This Month: $ Target: $400
 0% 

Im stuck


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SuperDuper
Member
Join Date: May 2006
Location: na
Old 05-21-2006 , 19:58   Im stuck
Reply With Quote #1

Im trying to make a plugin where when you activate it, everyone has crazy health, speed, armor and gravity. but now i am stuck and dont know how to finish. can anyone help?

Code:
#include <amxmodx>   #include <amxmisc>   #include <fun>   #include <engine> #include <cstrike> #define PLUGIN "Epic"   #define VERSION "1.0"   #define AUTHOR "SuperDuper" public plugin_init()     {       register_plugin(PLUGIN, VERSION, AUTHOR)             register_clcmd("amx_epicon", "cmd_epicon")     register_clcmd("amx_epicoff", "cmd_epicoff") } public cmd_epicon(id, level, cid) {     if (!cmd_access(id, level, cid, 1))               return PLUGIN_HANDLED                   set_user_footsteps (id, 1)       set_user_health(id, 5000)     set_user_gravity (id, 0.20)     set_user_maxspeed (id, -3.0)     set_user_armor (id, 5000)   }   public cmd_epicoff(id, level, cid) {     if (!cmd_access(id, level, cid, 0))             return PLUGIN_HANDLED                 set_user_fottsteps (id, 0)     set_user_health(id, 100)            set_user_gravity(id, 1.0)     set_user_maxspeed(id, 1.0)      set_user_armor(id, 100) }

thans...
__________________
[Team.Profit] Profit' <LDR>. Our server owns!

CS:CZ or DIE
SuperDuper is offline
Send a message via AIM to SuperDuper Send a message via MSN to SuperDuper Send a message via Yahoo to SuperDuper
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 05-21-2006 , 20:00  
Reply With Quote #2

What are you stuck on? Give us clues.
Peli is offline
Send a message via MSN to Peli
SuperDuper
Member
Join Date: May 2006
Location: na
Old 05-21-2006 , 20:01  
Reply With Quote #3

it says that cmd_epicon and cmd_epicoff must return a variable. + i dont know how to end it. Im new at coding
__________________
[Team.Profit] Profit' <LDR>. Our server owns!

CS:CZ or DIE
SuperDuper is offline
Send a message via AIM to SuperDuper Send a message via MSN to SuperDuper Send a message via Yahoo to SuperDuper
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-21-2006 , 20:04  
Reply With Quote #4

If you want it to work after round ends, it'll involve a lot more work:

Code:
#include <amxmodx>   #include <amxmisc>   #include <fun>   #include <engine> #include <cstrike> #define PLUGIN "Epic"   #define VERSION "1.0"   #define AUTHOR "SuperDuper" public plugin_init()     {       register_plugin(PLUGIN, VERSION, AUTHOR)           register_clcmd("amx_epicon", "cmd_epicon")     register_clcmd("amx_epicoff", "cmd_epicoff") } public cmd_epicon(id, level, cid) {     if (!cmd_access(id, level, cid, 1))           return PLUGIN_HANDLED         new iPlayers[32],iPlayersnum,iPlayer     get_players(iPlayers,iPlayersnum,"a")         for(new iCount = 0;iCount < iPlayersnum;iCount++)     {         iPlayer = iPlayers[iCount]         set_user_footsteps (iPlayer, 1)           set_user_health(iPlayer, 5000)         set_user_gravity (iPlayer, 0.20)         set_user_maxspeed (iPlayer, -3.0)         set_user_armor (iPlayer, 5000)       }         client_print(0,print_chat,"[AMXX] Epic has been enabled.")         return PLUGIN_HANDLED }   public cmd_epicoff(id, level, cid) {     if (!cmd_access(id, level, cid, 0))         return PLUGIN_HANDLED             new iPlayers[32],iPlayersnum,iPlayer     get_players(iPlayers,iPlayersnum,"a")         for(new iCount = 0;iCount < iPlayersnum;iCount++)     {         iPlayer = iPlayers[iCount]         set_user_footsteps (iPlayer, 0)           set_user_health(iPlayer, 100)         set_user_gravity (iPlayer, 1.0)         set_user_maxspeed (iPlayer, 1.0)         set_user_armor (iPlayer, 100)       }         client_print(0,print_chat,"[AMXX] Epic has been disabled.")         return PLUGIN_HANDLED }
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
SuperDuper
Member
Join Date: May 2006
Location: na
Old 05-21-2006 , 20:06  
Reply With Quote #5

i dont know how you do that so fast, your my hero
__________________
[Team.Profit] Profit' <LDR>. Our server owns!

CS:CZ or DIE
SuperDuper is offline
Send a message via AIM to SuperDuper Send a message via MSN to SuperDuper Send a message via Yahoo to SuperDuper
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-21-2006 , 20:06  
Reply With Quote #6

Quote:
Originally Posted by SuperDuper
i dont know how you do that so fast, your my hero
Practice makes perfect.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
SuperDuper
Member
Join Date: May 2006
Location: na
Old 05-21-2006 , 20:07  
Reply With Quote #7

what if i made a cvar command, like epicmod "0" 1". then wouldnt it stay on after each round???
__________________
[Team.Profit] Profit' <LDR>. Our server owns!

CS:CZ or DIE
SuperDuper is offline
Send a message via AIM to SuperDuper Send a message via MSN to SuperDuper Send a message via Yahoo to SuperDuper
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 05-21-2006 , 20:08  
Reply With Quote #8

Yes, and you could control it to active/deactive and check/uncheck on functions if an admin turns it on/off.
Peli is offline
Send a message via MSN to Peli
SuperDuper
Member
Join Date: May 2006
Location: na
Old 05-21-2006 , 20:11  
Reply With Quote #9

how would t hat work? is nt that a very advacned code?!
__________________
[Team.Profit] Profit' <LDR>. Our server owns!

CS:CZ or DIE
SuperDuper is offline
Send a message via AIM to SuperDuper Send a message via MSN to SuperDuper Send a message via Yahoo to SuperDuper
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-21-2006 , 20:13  
Reply With Quote #10



EDIT: as it stands, this will fuck with anything else that changes gravity, health etc

Code:
#include <amxmodx>   #include <amxmisc>   #include <fun>   #include <engine> #include <cstrike> #define PLUGIN "Epic"   #define VERSION "1.0"   #define AUTHOR "SuperDuper" new bool:g_bEpicEnabled public plugin_init()     {       register_plugin(PLUGIN, VERSION, AUTHOR)           register_clcmd("amx_epicon", "cmd_epicon")     register_clcmd("amx_epicoff", "cmd_epicoff")         register_event("ResetHUD","fnEventResetHUD","be")     register_event("CurWeapon","fnEventCurWeapon","be") } public cmd_epicon(id, level, cid) {     if (!cmd_access(id, level, cid, 1))           return PLUGIN_HANDLED         new iPlayers[32],iPlayersnum     get_players(iPlayers,iPlayersnum,"a")         g_bEpicEnabled = true         for(new iCount = 0;iCount < iPlayersnum;iCount++)         fnEventResetHUD(iPlayers[iCount])         client_print(0,print_chat,"[AMXX] Epic has been enabled.")         return PLUGIN_HANDLED }   public cmd_epicoff(id, level, cid) {     if (!cmd_access(id, level, cid, 0))         return PLUGIN_HANDLED             new iPlayers[32],iPlayersnum     get_players(iPlayers,iPlayersnum,"a")         g_bEpicEnabled = false         for(new iCount = 0;iCount < iPlayersnum;iCount++)         fnEventResetHUD(iPlayers[iCount])         client_print(0,print_chat,"[AMXX] Epic has been disabled.")         return PLUGIN_HANDLED } public fnEventResetHUD(id)     if(g_bEpicEnabled)     {         set_user_footsteps (id, 1)           set_user_health(id, 5000)         set_user_gravity (id, 0.20)         set_user_armor (id, 5000)       }     else     {         set_user_footsteps (id, 0)           set_user_health(id, 100)         set_user_gravity (id, 1.0)         set_user_armor (id, 100)       } public fnEventCurWeapon(id)     if(g_bEpicEnabled)         set_user_maxspeed(id,-3.0)
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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