Results 1 to 4 of 4

Thread: e_wheel source code

  1. #1
    Naruto's Avatar



    Join Date
    Jun 26, 2010
    Last Online
    Feb 12, 2012
    Posts
    9
    Threads
    4



    e_wheel source code


    Hi Drunken_F00l, can you post fix angles process on "models/props_wasteland/wheel02a.mdl" in e_wheel source code?

    i want fix that angles, but i dont know how to do.

  2. #2
    Drunken F00l's Avatar



    Join Date
    Dec 11, 2004
    Last Online
    Jun 11, 2019
    Posts
    5,874
    Threads
    182
    Reputation
    SourceOP Thread


        
    Steam: 76561197968459473 
    Steam join date: Aug 23, 2004
    Steam Level: 56
    Profile Status: Public



  3. #3
    Naruto's Avatar



    Join Date
    Jun 26, 2010
    Last Online
    Feb 12, 2012
    Posts
    9
    Threads
    4




    how can i fix it with sourcemod

    matrix function didn't included in sourcemod

    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");
    }

  4. #4
    Drunken F00l's Avatar



    Join Date
    Dec 11, 2004
    Last Online
    Jun 11, 2019
    Posts
    5,874
    Threads
    182
    Reputation
    SourceOP Thread


        
    Steam: 76561197968459473 
    Steam join date: Aug 23, 2004
    Steam Level: 56
    Profile Status: Public



    Oh, I don't know if sourcemod has matrix math functions. You'll have to check with them. If not, you could write your own by converting the ones you need from the SDK.