Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

e_wheel source code
#3

how can i fix it with sourcemod :?

matrix function didn't included in sourcemod :roll:

here is my code:
Code:
if(Build_RegisterEntityOwner(Client, wheelIndex)) {
    new Float:hitPos[3];
    new Float:hitNormal[3];
    TR_GetEndPosition(hitPos, trace);
    TR_GetPlaneNormal(trace, hitNormal);
                    
    GetArrayString(g_hWheelModelPathArray, IndexInArray, szModelPath, sizeof(szModelPath));
                    
    if(!IsModelPrecached(szModelPath))
        PrecacheModel(szModelPath);
                    
    DispatchKeyValue(wheelIndex, "model", szModelPath);
    DispatchKeyValue(wheelIndex, "spawnflags", "256");
    DispatchKeyValueFloat(wheelIndex, "physdamagescale", 0.0);
    DispatchKeyValueFloat(wheelIndex, "ExplodeDamage", 0.0);
    DispatchKeyValueFloat(wheelIndex, "ExplodeRadius", 0.0);
                    
    DispatchSpawn(wheelIndex);
    ActivateEntity(wheelIndex);
                    
    new Float:surfaceAng[3];                    
    GetVectorAngles(hitNormal, surfaceAng);
                    
    new Float:wheelCenter[3]; // Should be calculating the width of the model for this.
    new Float:vecToAdd[3];
                    
    vecToAdd[0] = hitNormal[0];
    vecToAdd[1] = hitNormal[1];
    vecToAdd[2] = hitNormal[2];
                    
    switch(StringToInt(szWheelName)) {
        case 1:
            ScaleVector(vecToAdd, 5.0);
        case 2:
            ScaleVector(vecToAdd, 10.0);
        case 3:
            ScaleVector(vecToAdd, 7.5);
        case 4:
            ScaleVector(vecToAdd, 12.5);
        case 5:
            ScaleVector(vecToAdd, 11.0);
        case 6:
            ScaleVector(vecToAdd, 40.0);
        case 7:
            ScaleVector(vecToAdd, 40.0);
    }
    
    AddVectors(hitPos, vecToAdd, wheelCenter);
    TeleportEntity(wheelIndex, wheelCenter, surfaceAng, NULL_VECTOR);
                    
    Phys_CreateHingeConstraint(entIndex, wheelIndex, INVALID_HANDLE, hitPos, hitNormal);
    Build_PrintToChat(Client, "Added wheel to target");
}
Reply


Messages In This Thread
e_wheel source code - by Naruto - Jun 23, 2011, 05:55 AM
e_wheel source code - by Drunken F00l - Jun 23, 2011, 10:28 AM
e_wheel source code - by Naruto - Jun 24, 2011, 12:25 AM
e_wheel source code - by Drunken F00l - Jun 24, 2011, 12:35 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)