Jump to content

Home

Can I get Tchouky's model scaling code all set for JA?


Vruki Salet

Recommended Posts

here is my code from my yet-unnamed mod

 

	else if(!Q_stricmp (cmd, "scale")){
	int TargetNum = 0, TheScale = 0;
	char arg1[MAX_STRING_CHARS];
	gentity_t *TheEnt;
	if(!CheckAdminCmd( ent, CMD_SCALE )) return;
	if(trap_Argc() <= 1 || trap_Argc() > 2){
		trap_SendServerCommand( clientNum, "print \"USAGE: \'/scale <player> <scale>\', If no player is specified, it performs the scale on you.\n\"");
		return;
	}
	trap_Argv(1, arg1, sizeof(arg1));
	if(trap_Argc() == 2){
		TargetNum = ent->client->ps.clientNum;
		TheScale = atoi(arg1);
	}
	else{
		//trap_Argv(1, arg1, sizeof(arg1));
		TargetNum = atoi(arg1);
		trap_Argv(2, arg1, sizeof(arg1));
		TheScale = atoi(arg1);
	}
	if(TargetNum > MAX_CLIENTS || TargetNum < 0){
		trap_SendServerCommand( clientNum, "print \"Invalid client number\n\"");
		return;
	}
	if(TheScale > 1023 || TheScale < 0){
		trap_SendServerCommand( clientNum, "print \"Invalid model scale\n\"");
		return;	
	}
	TheEnt = &g_entities[TargetNum];

	//ohh, icarus model scaling stuff
	//static void Q3_SetScale(int entID, float float_data)
	//good ol' icarus will allways show the way

	if(!TheEnt->client){
		trap_SendServerCommand( clientNum, "print \"Invalid player (player not active?)\n\"");
		return;	
	}
	TheEnt->client->ps.iModelScale = TheScale;
	//TheEnt->s.iModelScale = TheScale;
	//TheEnt->modelScale = TheScale;
}

 

if you want any code samples from the mod I'm working on, go to bwap.pipobona.com, as I rarely visit these forums. I think pipo has it set so you need to be registered to view the c++ area where I post the code.

I allready posted a /place command very much like the one used in lugormod there if your interested

 

-robo85045 (Tree2.0)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...