Raised This Month: $ Target: $400
 0% 

Solved [L4D] SDKCall crashes the server/game


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 12-27-2017 , 11:48   [L4D] SDKCall crashes the server/game
Reply With Quote #1

Hey guys, here's the code I use with the SDKCall:

PHP Code:
public Action tAutoTimerBileSpeedrunners(Handle timerany data)
{
    
float flcount;
    
float flDistance[MAXPLAYERS 1];
    
float flOtherOrigin[3] = {0.00.00.0};
    
float flOverLimit[MAXPLAYERS 1];
    
float flOwnOrigin[3] = {0.00.00.0};
    for(
int iSurvivor 1iSurvivor <= MaxClientsiSurvivor++)
        if((
bIsValidClient(iSurvivor) && !cvBileCountBots.BoolValue) || (bIsSurvivor(iSurvivor) && cvBileCountBots.BoolValue))
            
flcount++;
    if(!
cvBileTankAlive.BoolValue)
        
vCountTanks();
    if(!
cvEnablePlugin.BoolValue || !cvBileEnable.BoolValue || !cvBileAutoMode.BoolValue || flcount && !cvBileCountBots.BoolValue || flcount && cvBileCountBots.BoolValue || cvBileDistanceLimit.IntValue == 0.0 || iTankAmount || !bIsSystemValid())
        return 
Plugin_Continue;
    for(
int iPlayer 1iPlayer <= MaxClientsiPlayer++)
    {
        if(
cvBileDistanceWarning.IntValue == 0.0)
            return 
Plugin_Continue;
        if(((
bIsValidClient(iPlayer) && !cvBileCountBots.BoolValue) || (bIsSurvivor(iPlayer) && cvBileCountBots.BoolValue)))
        {
            
GetClientAbsOrigin(iPlayerflOwnOrigin);
            for(
int iDestination 1iDestination <= MaxClientsiDestination++)
            {
                if(((
bIsValidClient(iDestination) && !cvBileCountBots.BoolValue) || (bIsSurvivor(iDestination) && cvBileCountBots.BoolValue)) && iDestination != iPlayer)
                {
                    
GetClientAbsOrigin(iDestinationflOtherOrigin);
                    
flDistance[iPlayer] += GetVectorDistance(flOwnOriginflOtherOrigin);
                    if(
GetVectorDistance(flOwnOriginflOtherOrigin) > cvBileDistanceLimit.IntValue)
                        
flOverLimit[iPlayer]++;
                }
            }
        }

        for(
int iAdmin 1iAdmin <= MaxClientsiAdmin++)
        {
            
flDistance[iPlayer] = FloatDiv(flDistance[iPlayer], (flcount 1));
            if(
flDistance[iPlayer] > cvBileDistanceLimit.IntValue && flOverLimit[iPlayer] > && (!cvBileAdminImmunity.BoolValue || (cvBileAdminImmunity.BoolValue && !bIsAdminAllowed(iPlayer))))
            {
                
vBilePlayer(iPlayeriAdmin);
                return 
Plugin_Continue;
            }

            else if(
flDistance[iPlayer] > cvBileDistanceWarning.IntValue && bIsValidClient(iPlayer))
            {
                if(
iTranslate)
                    
PrintHintText(iPlayer"[ASS] %t""BileWarn");
                else
                    
PrintHintText(iPlayer"[ASS] A Boomer ninja is watching you...");
            }
        }
    }

    return 
Plugin_Continue;
}

void vBilePlayer(int targetint client)
{
    if((
bIsSurvivor(target) && cvBileCountBots.BoolValue) || (bIsValidClient(target) && !cvBileCountBots.BoolValue) && (!cvBileAdminImmunity.BoolValue || (cvBileAdminImmunity.BoolValue && !bIsAdminAllowed(target))))
    {
        
SDKCall(hSDKBileSurvivortargetclienttrue);
        if(
iTranslate)
        {
            
PrintToChat(target"\x04[ASS]\x01 %t""BileInform");
            
PrintToChatAll("\x04[ASS]\x01 %t""BileAnnounce"target);
        }

        else
        {
            
PrintToChat(target"\x04[ASS]\x01 A\x05 Boomer ninja\x01 puked on\x03 you\x01!");
            
PrintToChatAll("\x04[ASS]\x01 A\x05 Boomer ninja\x01 puked on\x03 %N\x01!"target);
        }
    }

For some reason, it works just fine on L4D2, but on L4D the server/game crashes when the SDKCall function is called.

No errors nor messages in the logs either.
__________________

Last edited by Psyk0tik; 12-27-2017 at 14:01.
Psyk0tik is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 12-27-2017 , 13:43   Re: [L4D] SDKCall crashes the server/game
Reply With Quote #2

SDK Calls are game specific. You can't expect two libraries to have the same signatures for the functions. It is possible in some cases, but it is rare.

Here are the CTerrorPlayer::OnVomitedUpon signatures for L4D1 that you requested.


Linux

PHP Code:
_ZN13CTerrorPlayer13OnVomitedUponEPS_bb 
Windows

PHP Code:
\x83\xEC\x14\x53\x55\x56\x57\x8B\xF1\xE8\x2A\x2A\x2A\x2A 
__________________
Spirit_12 is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 12-27-2017 , 14:01   Re: [L4D] SDKCall crashes the server/game
Reply With Quote #3

Thanks Spirit! That Windows signature is different from the one I was using and now I'm no longer crashing.
__________________
Psyk0tik is offline
Reply


Thread Tools
Display Modes

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 04:12.


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