Raised This Month: $51 Target: $400
 12% 

CS:GO -> MOHAA Freeze-Tag


Post New Thread Reply   
 
Thread Tools Display Modes
SOBgaming
Senior Member
Join Date: Jul 2015
Old 03-23-2019 , 11:26   Re: CS:GO -> MOHAA Freeze-Tag
Reply With Quote #11

Quote:
Originally Posted by Mathias. View Post
I've started to work on a prototype, doesn't look too bad so far.




if anyone has a clue of good sounds that I can use that are included in csgo already. (when unfreezing, clock ticking etc.) would be greatly appreciated.
Is it on github?
__________________
SOBgaming is offline
Mathias.
Veteran Member
Join Date: Aug 2010
Location: Canada is my city
Old 03-23-2019 , 13:48   Re: CS:GO -> MOHAA Freeze-Tag
Reply With Quote #12

Quote:
Originally Posted by SOBgaming View Post
Is it on github?
No but I can give the source, I don't really have time to work on it atm if you wish to finish it.

PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#pragma newdecls required

char g_sSprites[] = "sprites/purplelaser1.vmt";
int g_iBeamModelIndex;

enum struct IFreezeBeam {
    
int entity;
    
int color[4];
    
float position[3];
}

IFreezeBeam gFreezeBeams[MAXPLAYERS 1][3];

public 
Plugin myinfo = {
    
name "Freezetag",
    
author "Mathias",
    
description "this meme is not dead",
    
version "0.0.1",
    
url "https://www.youtube.com/watch?v=2wGCqNZM7eA"
};

public 
void OnPluginStart() {
    
RegConsoleCmd("beam_test"BeamTest"");

    
HookEvent("player_death"OnPlayerDeath);
}

public 
void OnPlayerDeath(Event event, const char[] namebool dontBroadcast) {
    
int userid event.GetInt("userid");
    
int client GetClientOfUserId(userid);

    
/*TE_SetupBeamPoints(position, end, g_iBeamModelIndex, 0, 0, 0, 2.0, 20.0, 20.0, 0, 0.0, color, 0);
    TE_SendToAll(0.0);*/

    
CreateFakePlayer(client);
    
CreateFreezeBeams(client);

    
RequestFrame(RemoveRagdolluserid);
}

void CreateFakePlayer(int client) {
    
char model[256];
    
GetClientModel(clientmodel256);

    
float position[3], angle[3];
    
GetClientAbsOrigin(clientposition);
    
GetClientAbsAngles(clientangle);
    
position[2] -= 65.0;

    
int entity CreateEntityByName("prop_dynamic");
    
DispatchKeyValue(entity"model",      model);
    
DispatchKeyValue(entity"solid",      "0");
    
SetEntityModel(entitymodel);
    
TeleportEntity(entitypositionangleNULL_VECTOR);
    
DispatchSpawn(entity);
}

void CreateFreezeBeams(int client) {
    
CreateFreezeBeam(client0);
    
CreateFreezeBeam(client1);
    
CreateFreezeBeam(client2);
}

void CreateFreezeBeam(int clientint index) {
    
//int color[4] = { 0, 255, 255, 255 };

    
int team GetClientTeam(client);

    
float start[3], end[3];
    
GetClientAbsOrigin(clientstart);

    if (
index == 0) {
        
start[0] += 25.0;
        
start[1] -= 15.0;
    } else if (
index == 1) {
        
start[0] -= 15.0;
        
start[1] += 25.0;
    } else {
        
start[0] -= 25.0;
        
start[1] -= 25.0;
    }
    
    
// set the heigh to the floor
    
start[2] -= 70.0;

    
end[0] = start[0];
    
end[1] = start[1];
    
end[2] = start[2] + 105.0;

    

    
int tar CreateEntityByName("env_sprite"); 
    
DispatchSpawn(tar);
    
TeleportEntity(tarendNULL_VECTORNULL_VECTOR);

    
int beam CreateEntityByName("env_beam");
    
SetEntityModel(beamg_sSprites);
    
DispatchKeyValue(beam"renderamt""100");
    
DispatchKeyValue(beam"rendermode""0");
    if (
team == 3) {
        
DispatchKeyValue(beam"rendercolor""0, 102, 255");
    } else if (
team == 2) {
        
DispatchKeyValue(beam"rendercolor""204, 51, 0");
    }
    
DispatchKeyValue(beam"life""0");
    
TeleportEntity(beamstartNULL_VECTORNULL_VECTOR); 

    
DispatchSpawn(beam);
    
SetEntPropEnt(beamProp_Send"m_hAttachEntity"EntIndexToEntRef(beam));
    
SetEntPropEnt(beamProp_Send"m_hAttachEntity"EntIndexToEntRef(tar), 1);
    
SetEntProp(beamProp_Send"m_nNumBeamEnts"2);
    
SetEntProp(beamProp_Send"m_nBeamType"2);
    
    
SetEntPropFloat(beamProp_Data"m_fWidth"20.0);
    
SetEntPropFloat(beamProp_Data"m_fEndWidth"20.0);
    
AcceptEntityInput(beam"TurnOn");
}

public 
void RemoveRagdoll(int userid) {
    
int client GetClientOfUserId(userid);
    if (!
client) return;

    
int ragdoll GetEntPropEnt(clientProp_Send"m_hRagdoll");
    if (
ragdoll 0) {
        
PrintToServer("Couldn't find the ragdoll of %N."client);
        return;
    }

    
AcceptEntityInput(ragdoll"kill");
}

public 
Action OnPlayerRunCmd(int clientintbuttonsintimpulsefloat vel[3], float angles[3], intweaponintsubtypeintcmdnuminttickcountintseedint mouse[2])
{
    if(
buttons IN_USE)
    {
        
TraceTest(client);
    }
    
    return 
Plugin_Continue;
}

void TraceTest(int client) {
    
float pos[3], angles[3]; 
    
GetClientEyePosition(clientpos); 
    
GetClientEyeAngles(clientangles); 

    
Handle trace TR_TraceRayFilterEx(posanglesMASK_ALLRayType_InfiniteTraceFilterclient);
    

    
int target TR_GetEntityIndex(trace);
    if( 
target >= 
    { 
        
char model[128];
        
GetEntPropString(targetProp_Data"m_ModelName"model128);
        
PrintHintText(client"You have are looking at %s"model);
    } 
    else 
    { 
        
PrintHintText(client"You have are looking at nothing");
    }  
}

bool TraceFilter(int entityint contentsMaskint client) {
    if (
entity == client) return false;

    return 
true;
}

public 
Action BeamTest(int clientint args) {
    
float start[3] = { -1168.0, -812.0160.0 };
    
float end[3] = { -1168.0, -812.0220.0 };
    
int color[4] = { 0255255255 };
    
TE_SetupBeamPoints(startendg_iBeamModelIndex0002.020.020.000.0color0);
    
TE_SendToAll(0.0);
    return 
Plugin_Handled;
}

public 
void OnMapStart() {
    
g_iBeamModelIndex PrecacheModel(g_sSprites);

The entities are not attach to a variable atm you will need to destroy them when needed, my struct is not really used and you need to store 2 entities for the beams, not just one + the fake player. The trace ray is not working on none solid entities so that why I recommend to do the unfeeze from an AOE for the moment until someone find a solution for it.

BeamTest can be deleted is not used anymore, TE doesn't allow you enough controls.

EDIT: credits to this snippet to help me with creating the beam properly https://forums.alliedmods.net/showthread.php?t=237402.

Last edited by Mathias.; 03-23-2019 at 13:52.
Mathias. is offline
SOBgaming
Senior Member
Join Date: Jul 2015
Old 06-08-2019 , 07:01   Re: CS:GO -> MOHAA Freeze-Tag
Reply With Quote #13

@bwjulian did you keep the project up or did it die?
__________________
SOBgaming 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 06:19.


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