Raised This Month: $ Target: $400
 0% 

[CS:GO] [Fireworks] Core (v1.0, 24-dec-17)


Post New Thread Reply   
 
Thread Tools Display Modes
bLacK-bLooD
AlliedModders Donor
Join Date: Jun 2008
Old 10-02-2021 , 04:09   Re: [CS:GO] [Fireworks] Core (v1.0, 24-dec-17)
Reply With Quote #11

Can this be modified to automatically start the fireworks at round end? I hooked the roundend hook and tried to use GetClientAbsOrigin and GetClientAbsAngles of the players alive at round end and start the fireworks, however the fireworks model seems to spawn in random places.

Code:

PHP Code:
public Action:RoundEnded(Handleevent , const Stringname[] , booldontBroadcast)
{
    for(new 
client 1client <= MAXPLAYERSclient++)
    {
        if (
IsClientInGame(client) && !IsFakeClient(client) && IsPlayerAlive(client))
        {
            if ( 
Fireworks_IsFireworkExists(FIREWORK_NAME) ) {
                
decl Float:vOrigin[3], Float:vAngles[3];
                if ( 
GetClientViewOriginAndAngles(clientvOriginvAngles) ) {
                    
Fireworks_SpawnFirework(FIREWORK_NAMEvOriginvAngles);
                }
                else {
                    
PrintToChat(client"Surface not found");
                }
            }
            else {
                
PrintToChat(client"Firework with name \"%s\" doesn't exists"FIREWORK_NAME);
            }
        }
    }
    return 
Plugin_Continue;

And the function to get the origin and angles:

PHP Code:
bool:GetClientViewOriginAndAngles(const iClientFloat:vOrigin[3], Float:vAngles[3])
{
    
// get client eye position and angles
    
GetClientAbsOrigin(iClientvOrigin);
    
GetClientAbsAngles(iClientvAngles);
    
    
// start trace ray
    
TR_TraceRayFilter(vOriginvAnglesMASK_SOLIDRayType_InfiniteTR_DontHitSelfiClient);
    
// if hit something
    
if ( TR_DidHit(INVALID_HANDLE) )
    {
        
// get collusion origin
        
TR_GetEndPosition(vOriginINVALID_HANDLE);
        
// get angles 
        // TR_GetPlaneNormal(INVALID_HANDLE, vAngles);
        // find projection
        // GetVectorAngles(vAngles, vAngles);
        // vAngles[0] += 90.0;
        
        // return true
        
return true;
    }
    
    
// return false
    
return false;

__________________
We all live under the same sky but we have different horizons.
bLacK-bLooD 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 03:32.


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