View Single Post
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 05-05-2010 , 17:12   Re: Phoenix ([FTW]-S.W.A.T / vittu)
Reply With Quote #19

You could use an unstuck feature. One I like is from the NS plugin:
Code:
 //Thank you from AMXX NS unstuck plugin
 stock UnStuck(id, bool:kill=true)
 {
	new hullsize = (pev(id, pev_flags) & FL_DUCKING) ? HULL_HEAD : HULL_HUMAN;
	if( !hullsize ) 
		return true;

	new Float:origin[3], Float:new_origin[3], distance, i;
	pev(id, pev_origin, origin);
	distance = 32;

	while( distance < 1000 ) {	// 1000 is just incase, should never get anywhere near that
		for( i = 0; i < 128; i++ ){
			new_origin[0] = random_float(origin[0]-distance,origin[0]+distance);
			new_origin[1] = random_float(origin[1]-distance,origin[1]+distance);
			new_origin[2] = random_float(origin[2]-distance,origin[2]+distance);

			if ( fm_trace_hull(new_origin, hullsize, id) == 0 ) {
				fm_entity_set_origin(id, new_origin);
				return true;
			}
		}
		distance += 32;
	}

	if( kill ){
		user_kill(id);
		client_print(id, print_chat, "Couldn't find a free spot to move you too.");
	}
	return false;
 }
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`