Raised This Month: $ Target: $400
 0% 

[BUG] SZ_GetSpace: overflow on 'Name'


Post New Thread Reply   
 
Thread Tools Display Modes
fxfighter
Veteran Member
Join Date: Feb 2007
Location: Trollhättan
Old 01-04-2008 , 13:06   Re: [BUG] SZ_GetSpace: overflow on 'Name'
Reply With Quote #11

Quote:
Originally Posted by AlexanderM View Post
Arh just found out what the problem is.
It's the 'give_item' command from the 'fun',
dont know why it's buggin.
Maby I could use a other include file command, I
dunno.

Ill edit the main post, so you can se the sma.
i also use to get errors in consol when using give_item
it always get solved for me when i cheek if he is alive.
before giving.
if(is_user_alive(id))
fxfighter is offline
Send a message via MSN to fxfighter
AlexanderM
Junior Member
Join Date: Dec 2007
Old 01-04-2008 , 13:36   Re: [BUG] SZ_GetSpace: overflow on 'Name'
Reply With Quote #12

Tried what you say fxfighter, diden't work :S
I mean command like give_item, dunno what it's called.
I was looking for the command/function to give a item/weapon
in Fakemeta.
__________________
Uhm... More Pizza...
______________________________
| Home | Search | Google | Steam |
AlexanderM is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 01-04-2008 , 20:56   Re: [BUG] SZ_GetSpace: overflow on 'Name'
Reply With Quote #13

This might work:
Code:
/*   ---------------------------------------------- ############################################## ---------------------------------------------- It's only the Warlock were I added a weapon, dunno why it is bugged. V 0.2 Realese 2008 3. January Note : Only the rouge class have somthing more than extra health. Warlock - 150 health Mage    - 150 health Warrior - 200 health Rouge   - 100 health + 250 % extra speed, and the half gravity Added : Added a hudmsg that tells you wich class you are, every spawn. Added a new command 'showchar', when used, you can se your class! Added a new command 'clearchar'. when used, you clear you class Fixed : Fixed a lot of small bugs, only 1 error when       compiling. Classes isen't used. Fixed major problem with the class menu, know you can chance race without bugs! ---------------------------------------------- ############################################## ---------------------------------------------- V 0.1 MOD REALESE 2007 December ---------------------------------------------- ############################################## ---------------------------------------------- World of Warcraft TBC Mod By Alexander Mathiasen Thanks to XunTric & PM            Class creation EMP'                Menu tutorail purple_pixie            On_spawn funktion V3X             give_weapon And all other helpfull people at <a href="http://www.forum.alliedmods.net" target="_blank" rel="nofollow noopener">http://www.forum.alliedmods.net</a> thanks to every one that helped :D Ive made this mainly on Xuntric XP based tutorial, and EMP's Menu tutorial. I have looked at the other's code, to find out things (or be sure), so woulden't be fair if I diden't put them on the list :-) */ #include <amxmodx> #include <amxmisc> #include <cstrike> #include <fakemeta> #define PLUGIN "World of Warcraft TBC mod" #define VERSION "0.2" #define AUTHOR "AlexanderM" // Here I create all the class's. I make the 'Nothing' class, so the plugin can se if a client hasen't choosen a class. #define CLASS_NOTHING 0     #define CLASS_WARLOCK 1 #define CLASS_MAGE 2 #define CLASS_WARRIOR 3 #define CLASS_ROUGE 4 // This is so you don't see, for instance CLASS_WARLOCK in the game. #define MAXCLASSES 5 #define TASK_REGEN 999 new PlayerClass[33] new curweapon[33] // This is where I add other names. new const CLASSES[MAXCLASSES][] = {     "None",     "Warlock",     "Mage",     "Warrior",     "Rouge" }   public plugin_init() {         register_plugin("World of Warcraft TBC mod", "0.2", "AlexanderM")         // Makes a cvar, so the host/admin can type sv_wow 0 to turn off.     register_cvar("sv_wow","1")         // Allows a client to write 'Change' and tells the plugin to read 'Change'.     register_clcmd("say /change", "Change")     register_clcmd("say change", "Change")     register_clcmd("say_team /change", "Change")     register_clcmd("say_team change", "Change")     register_concmd("/change", "Change")     register_concmd("change", "Change")         // Allows a client to write 'ShowChar' and tells the plugin to read 'ShowChar'.     register_clcmd("say /showchar", "ShowChar")     register_clcmd("say showchar", "ShowChar")     register_clcmd("say_team /showchar", "ShowChar")     register_clcmd("say_team showchar", "ShowChar")     register_concmd("/showchar", "ShowChar")     register_concmd("showchar", "ShowChar")         // Allows a client to write 'ClearChar' and tells the plugin to read 'ClearChar'     register_clcmd("say /clearchar", "ClearChar")     register_clcmd("say clearchar", "ClearChar")     register_clcmd("say_team /clearchar", "ClearChar")     register_clcmd("say_team clearchar", "ClearChar")     register_concmd("/clearchar", "ClearChar")     register_concmd("clearchar", "ClearChar")         // This is for the rouge's speed. The speed of a client reset's every time you     // chance weapon. So it should be called every time the client chance weapon.     register_event("CurWeapon", "Event_Rouge_Speed", "be","1=1")         // This event is called on spawn. I can use this to give people health or weapons,     // when they spawn.     register_event("ResetHUD","on_spawn","be") } public client_connect(id) {         if(get_cvar_num("sv_wow") == 1)     {         // When a client connect's, I give him the class 'Nothing'.         PlayerClass[id] = CLASS_NOTHING         return PLUGIN_HANDLED;     }         return PLUGIN_HANDLED; } public Change(id) {     // Should only make this if 'sv_wow' is equal to 1.     if(get_cvar_num("sv_wow") == 1)     {         //I create the menu, and give it a title. I also tells         // the plugin, it should look under 'menu_handler'.         new menu = menu_create("\r[WOW] Character Menu!:", "menu_handler")                 // Here I create the options in the menu, give it the number it should be displayed.         // The last '0' is wich admin flag you should be. It is set to 0 becurs every one should         // be able to use this menu.         menu_additem(menu, "\wWarlock", "1", 0)         menu_additem(menu, "\wMage", "2", 0)         menu_additem(menu, "\wWarrior", "3", 0)         menu_additem(menu, "\wRouge", "4", 0)                 // Here I create the exit option         menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)                 // Then after all, the menu gets displayed.         menu_display(id, menu, 0)     } } public menu_handler(id, menu, item) {     if (item == MENU_EXIT) {         menu_destroy(menu)         return PLUGIN_HANDLED;     }         new data[6], iName[64]     new access, callback         menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)         new key = str_to_num(data)         switch(key) {                 // If client takes option 1, we have to be sure he isen't allready a Warlock.         case 1:{             if(PlayerClass[id] == CLASS_WARLOCK) {                                 // If the client is a Warlock, I would tell the client.                 client_print(id, print_chat, "[WOW] You are allready a Warlock!")                                 menu_destroy(menu)                                 // And just to be kind, I open the menu for him again.                 Change(id)                                 return PLUGIN_HANDLED;                             }                         // Here I tell the plugin to run 'Clear', and it should do it             // for the client who opened the menu '(id)'.             Clear(id)                         // Know can I set the client's class to Warlock..             PlayerClass[id] = CLASS_WARLOCK                         // Here I show's the client's class with a HUD msg.             set_hudmessage(0, 255, 255, 0.01, 0.91, 0, 6.0, 3.0)             show_hudmessage(id, "Class: Warlock")                         return PLUGIN_HANDLED;                     }         // Know the whole thing comes again, so I haven't commented it.         case 2:{             if(PlayerClass[id] == CLASS_MAGE) {                                 client_print(id, print_chat, "[WOW] You are allready a Mage!")                                 menu_destroy(menu)                                 Change(id)                                 return PLUGIN_HANDLED;                             }                         Clear(id)                         PlayerClass[id] = CLASS_MAGE                         set_hudmessage(0, 255, 255, 0.01, 0.91, 0, 6.0, 3.0)             show_hudmessage(id, "Class: Mage")                         return PLUGIN_HANDLED;                     }         case 3:{             if(PlayerClass[id] == CLASS_WARRIOR) {                                 client_print(id, print_chat, "[WOW] You are allready a Warrior!")                                 menu_destroy(menu)                                 Change(id)                                 return PLUGIN_HANDLED;                             }                         Clear(id)                         PlayerClass[id] = CLASS_WARRIOR                         set_hudmessage(0, 255, 255, 0.01, 0.91, 0, 6.0, 3.0)             show_hudmessage(id, "Class: Warrior")                         return PLUGIN_HANDLED;                     }         case 4:{             if(PlayerClass[id] == CLASS_ROUGE) {                                 client_print(id, print_chat, "[WOW] You are allready a Rouge!")                                 menu_destroy(menu)                                 Change(id)                                 return PLUGIN_HANDLED;                             }                         Clear(id)                         PlayerClass[id] = CLASS_ROUGE                                   set_hudmessage(0, 255, 255, 0.01, 0.91, 0, 6.0, 3.0)             show_hudmessage(id, "Class: Rouge")                         return PLUGIN_HANDLED;                     }             }     return PLUGIN_HANDLED;  } public ClearChar(id) {         if(get_cvar_num("sv_wow") == 1) {                   // If the client already haven't choosen a class. I don't want to reset it.         if ( PlayerClass[id] == CLASS_NOTHING) {                         // Here I write a msg telling him he hasen't choosen a class.             client_print(id, print_chat, "[WOW] You can't clear you character when you havent choosen one!")                         // And again I am so kind to open the class menu for the client.             Change(id)                         return PLUGIN_HANDLED;                     }                 // Here I change the client's class to 'Nothing'         PlayerClass[id] = CLASS_NOTHING                 // Here I let the client know that the class was succesful reset.         client_print(id, print_chat, "[WOW] You had your character succesful reset!")                 return PLUGIN_HANDLED;             }     return PLUGIN_HANDLED; } public Clear(id) {         if(get_cvar_num("sv_wow") == 1) {                 // This is sort of the same as above, but I make this with no msg.         // I call this every time a client choose's a class in the 'Change' command.         if ( PlayerClass[id] == CLASS_NOTHING) {                         // Again I don't want to reset the class, if the client already             // hasen't choosen a class.             return PLUGIN_HANDLED;                     }                 // Here I change the class to 'Nothing',         PlayerClass[id] = CLASS_NOTHING                 return PLUGIN_HANDLED;             }     return PLUGIN_HANDLED; } public on_spawn(id) {     if(get_cvar_num("sv_wow") == 0 || !is_user_alive(id))         return PLUGIN_HANDLED             switch(PlayerClass[id])     {         case CLASS_NOTHING:         {             set_hudmessage(0, 255, 255, 0.01, 0.91, 0, 6.0, 3.0)             show_hudmessage(id, "Class: None")             Change(id)         }         case CLASS_WARLOCK:         {             fm_give_item(id, "weapon_awp")                         fm_set_user_health(id, 150)                         // Then I write wich class the client is, always usefull             // to know.                         set_hudmessage(0, 255, 255, 0.01, 0.91, 0, 6.0, 3.0)             show_hudmessage(id, "Class: Warlock");         }         case CLASS_MAGE:         {             fm_set_user_health(id,150)                                                  set_hudmessage(0, 255, 255, 0.01, 0.91, 0, 6.0, 3.0)             show_hudmessage(id, "Class: Mage")                              }         case CLASS_WARRIOR:         {             fm_set_user_health(id,200)                          set_hudmessage(0, 255, 255, 0.01, 0.91, 0, 6.0, 3.0)             show_hudmessage(id, "Class: Warrior")                     }         case CLASS_ROUGE:         {             // And here I set the gravity to the half.             fm_set_user_gravity(id,0.5)             // Here I change the client's speed. This only last to the client             // changes weapon. The event below change's the client's speed every             // time the client change's weapon.             fm_set_user_maxspeed(id,(fm_get_user_maxspeed(id)*2.5))                         set_hudmessage(0, 255, 255, 0.01, 0.91, 0, 6.0, 3.0)             show_hudmessage(id, "Class: Rouge")         }     }     return PLUGIN_HANDLED } public Event_Rouge_Speed(id) {     if(get_cvar_num("sv_wow") == 1)     {         if ( PlayerClass[id] == CLASS_ROUGE)         {             new dummy;                      new tempweapon = get_user_weapon(id,dummy,dummy)                     if ( tempweapon != curweapon[id] )             {                 curweapon[id] = tempweapon                 fm_set_user_maxspeed(id,(fm_get_user_maxspeed(id)*10.5))                }         }     } } public ShowChar(id) {                       if(get_cvar_num("sv_wow") == 1) {                 // Here I se wich class the client is. It is the same code all the way down.         // The only different is, that I open the menu, if the client is the 'Nothing'         // class.         if ( PlayerClass[id] == CLASS_NOTHING) {                            Change(id)                         set_hudmessage(0, 255, 255, -1.0, -1.0, 0, 6.0, 12.0)               show_hudmessage(id, "[WOW] You haven't choosen a class !")                         return PLUGIN_HANDLED;                                      }         // As I wrote above, this is just the same code again and again.         if ( PlayerClass[id] == CLASS_WARLOCK) {                         set_hudmessage(0, 255, 255, -1.0, -1.0, 0, 6.0, 12.0)             show_hudmessage(id, "[WOW] You are a Warlock !")                         return PLUGIN_HANDLED;                     }           if ( PlayerClass[id] == CLASS_MAGE) {                         set_hudmessage(0, 255, 255, -1.0, -1.0, 0, 6.0, 12.0)             show_hudmessage(id, "[WOW] You are a Mage !")                         return PLUGIN_HANDLED;                     }           if ( PlayerClass[id] == CLASS_WARRIOR) {                         set_hudmessage(0, 255, 255, -1.0, -1.0, 0, 6.0, 12.0)             show_hudmessage(id, "[WOW] You are a Warrior !")                         return PLUGIN_HANDLED;                     }           if ( PlayerClass[id] == CLASS_ROUGE) {                         set_hudmessage(0, 255, 255, -1.0, -1.0, 0, 6.0, 12.0)             show_hudmessage(id, "[WOW] You are a Rouge !")                         return PLUGIN_HANDLED;         }         return PLUGIN_HANDLED;     }     return PLUGIN_HANDLED; } // Functions below are copied from Fakemeta_Util.inc by VEN stock fm_give_item(index, const item[]) {     if (!equal(item, "weapon_", 7) && !equal(item, "ammo_", 5) && !equal(item, "item_", 5) && !equal(item, "tf_weapon_", 10))         return 0;     new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString,item))     if (!pev_valid(ent))         return 0;     new Float:origin[3];     pev(index, pev_origin, origin);     set_pev(ent, pev_origin, origin);     set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN);     dllfunc(DLLFunc_Spawn, ent);     new save = pev(ent, pev_solid);     dllfunc(DLLFunc_Touch, ent, index);     if (pev(ent, pev_solid) != save)         return ent;     engfunc(EngFunc_RemoveEntity, ent);     return -1; } stock fm_set_user_health(index, health) {     health > 0 ? set_pev(index, pev_health, float(health)) : dllfunc(DLLFunc_ClientKill, index);     return 1; } stock fm_set_user_gravity(index, Float:gravity = 1.0) {     set_pev(index, pev_gravity, gravity);     return 1; } stock fm_set_user_maxspeed(index, Float:speed = -1.0) {     engfunc(EngFunc_SetClientMaxspeed, index, speed);     set_pev(index, pev_maxspeed, speed);     return 1; } stock Float:fm_get_user_maxspeed(index) {     new Float:speed;     pev(index, pev_maxspeed, speed);     return speed; }
It uses Fakemeta instead of fun, so make sure you have the fakemeta module running.
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
AlexanderM
Junior Member
Join Date: Dec 2007
Old 01-06-2008 , 09:20   Re: [BUG] SZ_GetSpace: overflow on 'Name'
Reply With Quote #14

Thanks drak, realy big work :-)

My server stil shows the same error
Just reinstalled, same bug. Maby it's my
pc ?
__________________
Uhm... More Pizza...
______________________________
| Home | Search | Google | Steam |
AlexanderM is offline
fxfighter
Veteran Member
Join Date: Feb 2007
Location: Trollhättan
Old 01-06-2008 , 09:25   Re: [BUG] SZ_GetSpace: overflow on 'Name'
Reply With Quote #15

First off all you strip and give guns and even return PLUGIN_HANDLED
at spawn.
thats no good ides first off all before striping and giving make a task at spawn second use return PLUGIN_CONTINUE

Code:
 
public on_spawn(id)
{
    if(get_cvar_num("sv_wow") == 1 || is_user_alive(id))
        set_task(1.0,spawned,id)
}
public spawned(id) 
{
    switch(PlayerClass[id])
    {
        case CLASS_NOTHING:
        {
            set_hudmessage(0, 255, 255, 0.01, 0.91, 0, 6.0, 3.0)
            show_hudmessage(id, "Class: None")
            Change(id)
        }
        case CLASS_WARLOCK:
        {
            fm_give_item(id, "weapon_awp")
            
            fm_set_user_health(id, 150)
            
            // Then I write wich class the client is, always usefull
            // to know.
            
            set_hudmessage(0, 255, 255, 0.01, 0.91, 0, 6.0, 3.0)
            show_hudmessage(id, "Class: Warlock");
        }
        case CLASS_MAGE:
        {
            fm_set_user_health(id,150)              
            
            set_hudmessage(0, 255, 255, 0.01, 0.91, 0, 6.0, 3.0)
            show_hudmessage(id, "Class: Mage")      
            
        }
        case CLASS_WARRIOR:
        {
            fm_set_user_health(id,200)  
            
            set_hudmessage(0, 255, 255, 0.01, 0.91, 0, 6.0, 3.0)
            show_hudmessage(id, "Class: Warrior")
            
        }
        case CLASS_ROUGE:
        {
            // And here I set the gravity to the half.
            fm_set_user_gravity(id,0.5)
            // Here I change the client's speed. This only last to the client
            // changes weapon. The event below change's the client's speed every
            // time the client change's weapon.
            fm_set_user_maxspeed(id,(fm_get_user_maxspeed(id)*2.5))
            
            set_hudmessage(0, 255, 255, 0.01, 0.91, 0, 6.0, 3.0)
            show_hudmessage(id, "Class: Rouge")
        }
    }
}

Last edited by fxfighter; 01-06-2008 at 09:27.
fxfighter is offline
Send a message via MSN to fxfighter
AlexanderM
Junior Member
Join Date: Dec 2007
Old 01-06-2008 , 10:09   Re: [BUG] SZ_GetSpace: overflow on 'Name'
Reply With Quote #16

Trying it out :p
__________________
Uhm... More Pizza...
______________________________
| Home | Search | Google | Steam |
AlexanderM is offline
AlexanderM
Junior Member
Join Date: Dec 2007
Old 01-06-2008 , 10:39   Re: [BUG] SZ_GetSpace: overflow on 'Name'
Reply With Quote #17

Yeah, so close giving up, woulden't compile !
Just found out you forgot a couple ""

public on_spawn(id)
{
if(get_cvar_num("sv_wow") == 1 || is_user_alive(id))
set_task(1.0,spawned,id)
}

So this is the prove, even the best can make a mistake

+ Karma for the help FxFighter (added you and drak to the credit's page)
__________________
Uhm... More Pizza...
______________________________
| Home | Search | Google | Steam |
AlexanderM is offline
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 01-09-2008 , 10:43   Re: [BUG] SZ_GetSpace: overflow on 'Name'
Reply With Quote #18

Pretty sure you mean "&&" and not "||" there.

Unless you want to call that function if:
a) wow is running
OR
b) the player is alive.

IMO you probably want both to be true before calling it ;-)

Some things are perfectly fine to do during the spawn event ( I think ) and some really screw things up.
IIRC setting HP, for example, does not make for a happy client.
purple_pixie is offline
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 11:02.


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