cs_set_user_team crashes server?
i use this code:
Code:
after few seconds in game, server crashes with ED_Alloc: no free edicts error. i read somewhere in this forum, that reasons could be too many entities created or some entity handle was leaked, so it was never freed, and they kept building up. i am almost sure that error occures because cs_set_user_armor. how could i fix that? thanks :D |
It's because you never assign a value to ArmorType, it's just 0, which AFAIK doesn't work.
|
Some slight optimizations and fixes:
Code:
|
it doesn't work :?
here is whole script Code:
|
Try lowering the cvar.
|
ok, i know what's the problem. here it is:
register_event("WeapPickup","SetKnife","b") public SetKnife(players[]) { new players[32],num,i get_players(players,num) for(i = 0; i <= num; i++) { new id = players[i] if (is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T) { strip_user_weapons(id) give_item(id,"weapon_knife") } } } anybody has any suggestions? thanks :D |
Change SetKnife(players[]) to SetKnife(index) or something like that.
|
that doesn't work.
|
Quote:
|
this whole problem is because of WeapPickup event. if i do not register this event, server won't crash, but bots still drop all their weapons at round start, including C4. this event is there, so zombies would be stripped from weapon they have picked up during the play from a dead player and knife would be given to them once again.
but if this event is registered, server crashes after about 3 seconds with ED_Alloc: no free edicts error. :roll: |
| All times are GMT -4. The time now is 16:28. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.