from Franc1sco's Furien Mod (https://forums.alliedmods.net/showthread.php?t=189768). It should allow players to climb on the walls ( RegConsoleCmd("use", Trepando) ), but it doesnt work. Im not really familiar with CSGO and i cant figure it out what should be done to work. TY in advance!
I don't know if this works in CS:Go but it did in CSS.
I've wrote my own FuriesMod some years ago in CSS and here is my code for climbing:
Notes:
- Call this every game frame on all valid clients who are alive and should be allowed to climb
- One SetEntityRenderFx is set there, remove it if you don't need it there to be:
- I tried to add some comments for you
- It sets the default Gravity to 0.4
- the function needs a ClimbTolerance variable to work (we used 50.0)
Spoiler
PHP Code:
stock CalculateClimbVelocity(client, keys) { new bool:IsNearWall = false; new bool:IsNearCeiling = false;
new Handle:traceRay; new Float:testVector[3]; new Float:testPosition[3]; new Float:testEndPosition[3]; GetClientAbsOrigin(client, testPosition); testPosition[2] += 20.0; for (new i = 0; i < 360; i += 30) //360° = 0° so use < { /* ** the current section is interesting ** there are 2 different ways to check if a Solid point is in the near ** the first is, to use the raytype_endpoint and calculate vectors around the player. ** the second is, to use the raytype_infinite and calculate the distance to the found enpoint. ** because its easier to implement type 2 i've took this one. ** ** TODO: make a benchmark of the two ways! ** */
testVector[1] = float(i); //rotating around the y axis - the other (x & z) keeps zero. traceRay = TR_TraceRayFilterEx(testPosition, testVector, MASK_SOLID, RayType_Infinite, TraceEntityFilter:FilterOutPlayer, client); //fire trace ray all around the player if (TR_DidHit(traceRay)) //did the ray hit? { TR_GetEndPosition(testEndPosition, traceRay);
if (GetVectorDistance(testEndPosition, testPosition) <= ClimbTolerance) //is the hit in range? { #if defined DEBUG TE_SetupBeamPoints(testPosition, testEndPosition, g_BeamSprite, g_HaloSprite, 0, 40, 3.0, 2.0, 2.0, 25, 10.0, {255, 0, 255, 255}, 30); TE_SendToClient(client, 0.0); //draw the beam if in DEBUG state #endif IsNearWall = true; SetEntityRenderFx(client, RenderFx:RENDER_NORMAL); SetEntityGravity(client, 0.5 * GetEntityGravity(client)); CloseHandle(traceRay); break; } } CloseHandle(traceRay);
} if (!IsNearWall) //when no wall was in range check if a ceiling is... { GetClientEyePosition(client, testPosition); testVector = testPosition; testVector[2] += ClimbTolerance; traceRay = TR_TraceRayEx(testPosition, testVector, MASK_SOLID, RayType_EndPoint); if (TR_DidHit(traceRay)) { //now the first variant shows its potential, we dont need to calculate the distance IsNearCeiling = true; #if defined DEBUG TE_SetupBeamPoints(testPosition, testVector, g_BeamSprite, g_HaloSprite, 0, 40, 3.0, 2.0, 2.0, 25, 10.0, {255, 255, 0, 255}, 30); TE_SendToClient(client, 0.0); #endif }
CloseHandle(traceRay);
} if (IsNearWall || IsNearCeiling) //was a wall or ceiling in range? { //when yes, then the client should be able to move in it new Float:velocity[3]; new Float:eyeAngles[3]; //new Float:originPosition[3]; //GetClientAbsOrigin(client, originPosition); SetEntityMoveType(client, MOVETYPE_WALK); GetClientEyeAngles(client, eyeAngles); new bool:noTranslationMade = true; // Calculate moving directions (offsetvector) if (keys & IN_FORWARD) { velocity[0] += (200.0 * Cosine(DegToRad(eyeAngles[1]))); velocity[1] += (200.0 * Sine(DegToRad(eyeAngles[1]))); velocity[2] += -(200.0 * Sine(DegToRad(eyeAngles[0]))); noTranslationMade = false; } else if (keys & IN_BACK) { velocity[0] += -(200.0 * Cosine(DegToRad(eyeAngles[1]))); velocity[1] += -(200.0 * Sine(DegToRad(eyeAngles[1]))); velocity[2] += (200.0 * Sine(DegToRad(eyeAngles[0]))); noTranslationMade = false; } if (keys & IN_MOVERIGHT) { velocity[0] += (200.0 * Cosine(DegToRad(eyeAngles[1] - 90.0))); velocity[1] += (200.0 * Sine(DegToRad(eyeAngles[1] - 90.0))); //velocity[2] += 0.0; noTranslationMade = false; } else if (keys & IN_MOVELEFT) { velocity[0] += (200.0 * Cosine(DegToRad(eyeAngles[1] + 90))); velocity[1] += (200.0 * Sine(DegToRad(eyeAngles[1] + 90))); //velocity[2] = 0.0; noTranslationMade = false; } if (noTranslationMade) { SetEntityMoveType(client, MOVETYPE_NONE); //when not moved, then freeze him velocity[0] = velocity[1] = velocity[2] = 0.0; } SetEntityGravity(client, 1.5e-45); //when they are on a wall, they shouldnt move.. TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, velocity); //apply offsetvector } else //when there wasn't any wall or ceiling in range, then restore "normal walk" { SetEntityMoveType(client, MOVETYPE_WALK); SetEntityGravity(client, 0.4); } }
and some advises from me:
- cool items are absolutely nessecary (mines, rockets, laser and so on ^^)
- change sv_skyname to a darker sky - it's worth it ^^
- SetLightStyle to make your map darker - it's such a much cooler ambient in that way ^^
Ty for your answer Aeon, will try your code a little later. Add me on steam ( http://steamcommunity.com/id/alecs14/ ) if u want to, i would like to discuss more with you. Thank you again!