All pastes #497132 Raw Edit

Anonymous

public php v1 · immutable
·published 2007-05-19 17:26 UTC
rendered paste body
/*#define bitC4Detector 4#define bitAdrenaline 8#define bitParachute 16#define bitCellphone 32#define bitDiveTicket 64#define bitWeed 128#define bitAmphetamine 256#define bitEcstasy 512#define bitLSD 1024#define bitCocaine 2048#define bitHeroin 4096*/// cop side#define psSentPoCmd 1// suspect/criminal side#define psGotPoCmd 2enum enum_po{	poOtherID,	// id of the cop if we're in susp. array or of susp. if we're in the cops array	poState, 	// state 0 is no state. see consts prefixed with ps*	poLastTick, // tick when state changed last	Float:poSpeed	}new po[MAX_PLAYERS][enum_po];OnCopPullOverCmd(pid, nick[]){	#if incl_debug	printf("   OnCopPullOverCmd(pid:%d nick:'%s') (%s)", pid, nick, names[pid]);	#endif	new i,		criminal = INVALID_PLAYER_ID,		Float:pos,		Float:dis,		Float:p[6],		custommax,		msg[MAX_STR];	if (nick[0] != 0)	{		if (GetPlayerID(pid, nick, criminal) != 1) return 1;		custommax = criminal+1;	}	else	{		custommax = maxplayers;	}	dis = 9999.9;	// pos from who we calculate	GetPos(pid, p[0], p[1], p[2]);	for (i=criminal; i<custommax; i++) // note. i doesn't start at zero and custommax is used	{	    #if incl_debug		print("   Checking %d:%d", i custommax); // temp, remove	    #endif	    if (i != pid)	    {   			if (pclass[i] == cCop && !wntdlvl[i]) continue; // continue if the player being checked is cop and not wanted			GetPos(i, p[3], p[4], p[5]); // get pos for this player			pos = floatsqroot(floatpower(floatabs(floatsub(p[3],p[0])),2)+ // get distance to this player					floatpower(floatabs(floatsub(p[4],p[1])),2)+				  	floatpower(floatabs(floatsub(p[5],p[2])),2));			if (pos < dis) // distance less than previously found?			{				criminal = i; // this user is now considered closest				dis = pos; // update shortest distance			}		}	}	if (criminal == INVALID_PLAYER_ID || pos > VisualDistance)	return withmsg(pid, C_RED, "No valid suspect close enough or invalid nick.");	if (GetPlayerState(criminal) == PLAYER_STATE_DRIVER)	{		po[criminal][poSpeed] = pp[i][3]; // remember speed of criminal in criminal array		msg = "bla bla pull over car";	}	else	{	    msg = "Stop, or res arr...onfoot";	}	po[pid][poOtherID] = criminal;	po[criminal][poOtherID] = pid;	po[pid][poState] = psSentPoCmd;	po[criminal][poState] = psGotPoCmd;	/*	po[pid][*.	*. msg	fillstruct	timer	*/	return 1;}