View Single Post
psychonic

BAFFLED
Join Date: May 2008
Old 08-03-2009 , 19:37   Re: [L4D] SM Respawn command plugin (SDK call)
Reply With Quote #39

PHP Code:
    //*********************************************************************************************************************************************
    
new OS;
    
StartPrepSDKCall(SDKCall_Player);
    if (!
PrepSDKCall_SetSignature(SDKLibrary_Server"\xA1****\x83***\x57\x8B\xF9\x0F*****\x8B***\x56\x51\xE8****\x8B\xF0\x83\xC4\x04"34)) 
    {
        
OS 2// LINUX
        
PrepSDKCall_SetSignature(SDKLibrary_Server"@_ZN13CTerrorPlayer10AddUpgradeE19SurvivorUpgradeType"0);
    }
    else
    {
        
OS 1// WINDOWS
    
}
    
PrepSDKCall_AddParameter(SDKType_PlainOldDataSDKPass_ByValue);
    new 
Handle:AddUpgrade EndPrepSDKCall();
    
CloseHandle(AddUpgrade); // Its just a dummy function to determine server OS
    //**********************************************************************************************************************************************
    
    
StartPrepSDKCall(SDKCall_Player);
    if (
OS==1PrepSDKCall_SetVirtual(488);
    if (
OS==2PrepSDKCall_SetVirtual(489);
    
hRoundRespawn EndPrepSDKCall(); 
How ridiculous that is just to avoid the use of a gamedata file. Not only is extra work done, but now the plugin will even break if a function it does not even directly need gets moved (the add upgrade sig) in addition to if the offset it actually does use changes.
psychonic is offline