AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Crash server (https://forums.alliedmods.net/showthread.php?t=230364)

_GamerX 11-24-2013 04:51

Crash server
 
I have a server exploding bullets.

PHP Code:

public ev_cur_weapon(id)
{
    if(!
is_user_alive(id)) return

    new 
weapon read_data(2), clip read_data(3);

    if(
LastWeapon[id] == weapon && LastAmmo[id] > clipstrely(id)

    
LastWeapon[id] = weapon
    LastAmmo
[id] = clip


PHP Code:

public strely(id)
{
    new 
Players[32], iNumFloatvEndPos[3], Floatstart[3], Floatend[3], hitend[3], startorigin[3], endorigin[3];
    
get_players(PlayersiNum"a")
    
get_user_origin(id,startorigin,1)
    
get_user_origin(id,endorigin,4)

    
start[0] = float(startorigin[0])
    
start[1] = float(startorigin[1])
    
start[2] = float(startorigin[2])
    
end[0] = float(endorigin[0])
    
end[1] = float(endorigin[1])
    
end[2] = float(endorigin[2])
    
    new 
pTr create_tr2(); 
    
engfunc(EngFunc_TraceLinestartendDONT_IGNORE_MONSTERSidpTr); 
    
get_tr2(pTrTR_vecEndPosvEndPos);
    
free_tr2(pTr)
    
    
hitend[0] = floatround(vEndPos[0])
    
hitend[1] = floatround(vEndPos[1])
    
hitend[2] = floatround(vEndPos[2])
    
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_TRACER)
    
write_coord(startorigin[0])
    
write_coord(startorigin[1])
    
write_coord(startorigin[2])
    
write_coord(hitend[0])
    
write_coord(hitend[1])
    
write_coord(hitend[2])
    
message_end()
    if(
HasExplode[id])
    {
        
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
        
write_byte(TE_EXPLOSION)
        
write_coord(hitend[0])
        
write_coord(hitend[1])
        
write_coord(hitend[2])
        
write_short(sprExplode)
        
write_byte(5)
        
write_byte(15)
        
write_byte(0)
        
message_end()
        for(new 
1maxplayersi++)
        {
            if(!
is_user_alive(i) || get_user_godmode(i) == || == id) continue
            static 
Float:origin2[3]
            
pev(ipev_originorigin2)
            static 
Float:distance_fdistance_f get_distance_f(vEndPosorigin2)
            static 
distancedistance floatround(distance_f)
            new 
Float:damage = (25.0 floatround(floatmul(float(25), floatdiv(float(distance), float(50)))))
            if(
distance <= 50)
            {
                
ExecuteHamB(Ham_TakeDamagei0iddamageDMG_SLASH)
                if(
get_user_team(i) != get_user_team(id)) damage_show(idifloatround(damage), 0)
            }
        }
        new 
ent = -1
        
while((ent find_ent_in_sphere(entvEndPos10.0)))
        {
            static 
ClassName[32]
            
pev(entpev_classnameClassNamecharsmax(ClassName))
            if(
equal(ClassName"func_breakable")) fakedamage(ent"grenade"25.0DMG_BLAST)
        }
    }


But sometimes it shows an error

Code:

SZ_GetSpace: overflow without FSB_ALLOWOVERFLOW set on Server Spectator Buffer
Please help

ConnorMcLeod 11-24-2013 05:40

Re: Crash server
 
For shots detections, try this method : https://forums.alliedmods.net/showth...05#post1725505

And for your messages, try MSV_PVS or MSG_PAS (don't forget to pass an origin in message).

_GamerX 11-24-2013 08:27

Re: Crash server
 
Your shots detections not work. And I also tried with MSV_PVS and MSG_PAS, but still shows the error.


All times are GMT -4. The time now is 23:15.

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