Raised This Month: $ Target: $400
 0% 

Why doesnt my write_byte thing work?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 05-23-2006 , 00:23   Why doesnt my write_byte thing work?
Reply With Quote #1

Umm heres the code..Gets compile errors:

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> #define PLUGIN "Powerup" #define VERSION "1.0" #define AUTHOR "SweatyBanana" new g_Menu new g_msg_status_text public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_event("ResetHUD", "stopItems", "b")     register_event("CurWeapon", "eventCurWeapon", "b")     register_event("ResetHUD", "Checker", "b")     register_cvar("frag_amount","10");     new g_Menu = menu_create("Select an Upgrade:", "Menu_Handle")     menu_additem(g_Menu, "Silent Footsteps", "1")     menu_additem(g_Menu, "Low Gravity", "2")     menu_additem(g_Menu, "Faster Speed", "3")     menu_additem(g_Menu, "Invisibility", "4")     menu_additem(g_Menu, "Armor & Health (150)", "5") } public Checker(id) {     new Frags = get_user_frags(id);         if(Frags >= get_cvar_num("frag_amount"))     {         set_task(0.1,"Menu_Command")     } } public Menu_Command(id) {     menu_display(id, g_Menu, 0)           return PLUGIN_HANDLED } public Menu_Handle(id, Menu, Item) {       new szCommand[3],  Accesss, Callback           menu_item_getinfo(Menu, Item, Accesss, szCommand, 2, _, _, Callback)           switch(szCommand[0])     {         case '-':         {             return PLUGIN_HANDLED         }                   case '1':         {             set_user_footsteps (id, 1)         }                   case '2':         {             set_user_gravity (id, 0.25)         }                     case '3':         {             eventCurWeapon(id)         }                   case '4':         {             set_user_rendering(id,kRenderFxNone,0,0,0,kRenderTransAdd,0)         }                   case '5':         {             cs_set_user_armor (id, 150, CsArmorType:2)             // Set regular armor             set_user_health(id, 150)         }     }     set_user_frags(id,0)     set_task(30.0,"stopItems")     return PLUGIN_HANDLED } public stopItems(id) {     set_user_footsteps (id, 0)                     // Set regular footsteps     cs_set_user_armor (id, 100, CsArmorType:2)             // Set regular armor     set_user_health(id, 100)                    // Set regular health     set_user_gravity (id, 1.0)                     // Set 800 gravity     set_user_maxspeed (id, 0.0)                     // Set regular speed     set_user_rendering(id,kRenderFxNone,0,0,0,kRenderNormal,25)      // Set Visible         g_msg_status_text = get_user_msgid("StatusText")         message_begin(MSG_ONE, g_msg_status_text, {0,0,0}, id)     write_byte(0)     write_string("Kills/Kills-Needed for power-up %i/%i",get_user_frags(id),get_cvar_num("frag_amount"))     message_end()         return PLUGIN_HANDLED } public eventCurWeapon(id) {     new Float:speed = get_user_maxspeed(id) + 75.0     set_user_maxspeed(id, speed) }
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 05-23-2006 , 00:37  
Reply With Quote #2

Oh and just an FYI...the menu isnt showing for some reason either.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
VEN
Veteran Member
Join Date: Jan 2005
Old 05-23-2006 , 02:08  
Reply With Quote #3

Format your string before write_string
VEN is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 05-23-2006 , 07:04  
Reply With Quote #4

And How would I display this in the bottom left hand corner of the users screen?

Code:
message_begin(MSG_ONE, g_msg_status_text, {0,0,0}, id)
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 05-23-2006 , 07:57  
Reply With Quote #5

Would it be like:

Code:
message_begin(MSG_ONE, g_msg_status_text, {-20,-20,0}, id)


IDK the cords for bottom left of screen...
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-23-2006 , 08:39  
Reply With Quote #6

I don't know what you mean by the bottom left or whatever, but write_string does not allow you to format.

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> #define PLUGIN "Powerup" #define VERSION "1.0" #define AUTHOR "SweatyBanana" new g_Menu new g_msg_status_text public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_event("ResetHUD", "stopItems", "b")     register_event("CurWeapon", "eventCurWeapon", "b")     register_event("ResetHUD", "Checker", "b")     register_cvar("frag_amount","10");     new g_Menu = menu_create("Select an Upgrade:", "Menu_Handle")     menu_additem(g_Menu, "Silent Footsteps", "1")     menu_additem(g_Menu, "Low Gravity", "2")     menu_additem(g_Menu, "Faster Speed", "3")     menu_additem(g_Menu, "Invisibility", "4")     menu_additem(g_Menu, "Armor & Health (150)", "5") } public Checker(id) {     new Frags = get_user_frags(id);         if(Frags >= get_cvar_num("frag_amount"))     {         set_task(0.1,"Menu_Command")     } } public Menu_Command(id) {     menu_display(id, g_Menu, 0)         return PLUGIN_HANDLED } public Menu_Handle(id, Menu, Item) {       new szCommand[3],  Accesss, Callback         menu_item_getinfo(Menu, Item, Accesss, szCommand, 2, _, _, Callback)         switch(szCommand[0])     {         case '-':         {             return PLUGIN_HANDLED         }                 case '1':         {             set_user_footsteps (id, 1)         }                 case '2':         {             set_user_gravity (id, 0.25)         }                   case '3':         {             eventCurWeapon(id)         }                 case '4':         {             set_user_rendering(id,kRenderFxNone,0,0,0,kRenderTransAdd,0)         }                 case '5':         {             cs_set_user_armor (id, 150, CsArmorType:2)             // Set regular armor             set_user_health(id, 150)         }     }     set_user_frags(id,0)     set_task(30.0,"stopItems")     return PLUGIN_HANDLED } public stopItems(id) {     set_user_footsteps (id, 0)                     // Set regular footsteps     cs_set_user_armor (id, 100, CsArmorType:2)             // Set regular armor     set_user_health(id, 100)                    // Set regular health     set_user_gravity (id, 1.0)                     // Set 800 gravity     set_user_maxspeed (id, 0.0)                     // Set regular speed     set_user_rendering(id,kRenderFxNone,0,0,0,kRenderNormal,25)      // Set Visible         g_msg_status_text = get_user_msgid("StatusText")         new szMessage[64]     format(szMessage,63,"Kills/Kills-Needed for power-up %i/%i",get_user_frags(id),get_cvar_num("frag_amount"))         message_begin(MSG_ONE, g_msg_status_text, {0,0,0}, id)     write_byte(0)     write_string(szMessage)     message_end()           return PLUGIN_HANDLED } public eventCurWeapon(id) {     new Float:speed = get_user_maxspeed(id) + 75.0     set_user_maxspeed(id, speed) }
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
VEN
Veteran Member
Join Date: Jan 2005
Old 05-23-2006 , 11:55  
Reply With Quote #7

Quote:
And How would I display this in the bottom left hand corner of the users screen?
Isn't this your thread? http://forums.alliedmods.net/showthread.php?t=27787

Quote:
IDK the cords for bottom left of screen
Message's origin have nothing to do with that.
VEN is offline
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 05-23-2006 , 13:40  
Reply With Quote #8

change hud_centertext to 0 not 1.
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 05-23-2006 , 14:28  
Reply With Quote #9

Quote:
Originally Posted by VEN
Quote:
And How would I display this in the bottom left hand corner of the users screen?
Isn't this your thread? http://forums.alliedmods.net/showthread.php?t=27787

Quote:
IDK the cords for bottom left of screen
Message's origin have nothing to do with that.

Yes...But i wasnt sure how to make it in the bottom left.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-23-2006 , 20:03  
Reply With Quote #10

Quote:
Originally Posted by knekter
change hud_centertext to 0 not 1.
lol, I remember telling you about that like 3 months ago.
__________________
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:25.


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