CLEO Police Detector 0.3.7

_=Gigant=_

Well-Known Member
Joined
Mar 21, 2017
Messages
382
Likes
8
Points
23
#1
this mod will help you to know when some police car is near you so you can for example slow down if you drive fast on roleplay servers, its very useful for RP, it will also draw text on your player skin "Police is near" to help you react faster, on police cars it will show it distance from you 

here you can see https://s33.postimg.cc/46xs6sgv3/sa-mp-181.png

[attachment=5571]

type  /copdetect  for on&off
 

Attachments

monday

Well-Known Member
Joined
Jun 23, 2014
Messages
921
Likes
4
Points
68
#3
nice one, I made similar thing for skins (army/police), it had text drawing functions from mgfunctions plugin so it won't work but you could check it out if you planned to update this mod with skins/etc

[attachment=5582]

it has functions like this: 
0665: get_actor [email protected] model_to [email protected]
if 0AB1: call_scm_func @police_skin_check 1 skin [email protected]
if 0AB1: call_scm_func @army_skin_check 1 skin [email protected]
 

Attachments

OP
OP
_=Gigant=_

_=Gigant=_

Well-Known Member
Joined
Mar 21, 2017
Messages
382
Likes
8
Points
23
#4
monday said:
nice one, I made similar thing for skins (army/police), it had text drawing functions from mgfunctions plugin so it won't work but you could check it out if you planned to update this mod with skins/etc



it has functions like this: 
0665: get_actor [email protected] model_to [email protected]
if 0AB1: call_scm_func @police_skin_check 1 skin [email protected]
if 0AB1: call_scm_func @army_skin_check 1 skin [email protected]
nice, i've already made something similar draw line to players with police skins 

Code:
    if 
    [email protected] == 1 
        then           
        for [email protected] = 0 to 1000 /// samp max players             
            if 0B20: samp [email protected] = actor_handle_by_samp_player_id [email protected]
                then   
                00A0: store_actor [email protected] position_to [email protected] [email protected] [email protected]
                if 00C2:   sphere_onscreen [email protected] [email protected] [email protected]  radius 0.0
                    then
                    0B37: samp [email protected] = get_player_color [email protected]
                    0665: get_actor [email protected] model_to [email protected]
                    if or 
                    [email protected] == 280 
                    [email protected] == 306
                    [email protected] == 282
                    [email protected] == 283
                    [email protected] == 304
                    [email protected] == 285
                    [email protected] == 309
                    [email protected] == 265
                    then
                    Actor.StorePos($PLAYER_ACTOR, [email protected], [email protected], [email protected])
                    0B55: convert_3D_coords [email protected] [email protected] [email protected] to_screen [email protected] [email protected]
                    0B55: convert_3D_coords [email protected] [email protected] [email protected] to_screen [email protected] [email protected]                                        
                    0B68: render draw_line_point1 [email protected] [email protected] point2 [email protected] [email protected] width 2 color [email protected]                                                                                        
                end   
            end
        end
    end 
end
 

0x32789

Well-Known Member
Joined
May 26, 2014
Messages
762
Likes
1
Points
68
Location
teknickal suprot
#5
this 1k loop would cause little little freezes / lag wouldnt it?
how about just use ForAll Peds by opcode.exe and samp.getplayeridbyactorhandle thing?
This would be better and you wont have to loop through 1k id's and works for streamed only..
 

supahdupahnubah

Well-Known Member
Joined
Dec 31, 2015
Messages
679
Likes
3
Points
33
#6
0x32789 said:
this 1k loop would cause little little freezes / lag wouldnt it?
how about just use ForAll Peds by opcode.exe and samp.getplayeridbyactorhandle thing?
This would be better and you wont have to loop through 1k id's and works for streamed only..
but samp.getplayeridbyactorhandle is a 1k loop already... 
 

keek21

Well-Known Member
Joined
Feb 27, 2016
Messages
47
Likes
0
Points
21
#8
never seen anything like this before, but this is epic.

Now I can go to them and trying to pull them :x
 
OP
OP
_=Gigant=_

_=Gigant=_

Well-Known Member
Joined
Mar 21, 2017
Messages
382
Likes
8
Points
23
#13
Garret said:
this is epic, alexa, play despacito
Code:
void renderPoliceDetector()
{

	traceLastFunc("renderPoliceDetector()");

	if (gta_menu_active())
		return;

	if (cheat_state->_generic.cheat_panic_enabled)
		return;

	// Exit this function and enable samp nametags, if panic key


	if (!g_dwSAMP_Addr || !g_SAMP || !g_Players)
		return;


	// don't run if the CGameSA doesn't exist
	if (!pGameInterface)
		return;

	// don't run if we don't exist
	if (isBadPtr_GTA_pPed(pPedSelf))
		return;

	for (int i = 0; i < SAMP_MAX_VEHICLES; i++)
	{
		actor_info * playerr = actor_info_get(ACTOR_SELF, NULL);
		vehicle_info *vehicle = getGTAVehicleFromSAMPVehicleID(i);

		if (!vehicle)
			continue;

		D3DXVECTOR3 vehicle_pos, player_pos, screenposs, vscreenposs;

		CVector mySpinePoss, Vec;

		CPed *pPedSelf = pGameInterface->GetPools()->GetPed((DWORD*)playerr);

		CVehicle *pVeh = pGameInterface->GetPools()->GetVehicle((DWORD*)vehicle);

		pPedSelf->GetBonePosition(BONE_SPINE1, &mySpinePoss);

		Vec.fX = vehicle->base.matrix[12];
		Vec.fY = vehicle->base.matrix[13];
		Vec.fZ = vehicle->base.matrix[14];

		float * f_pos = &playerr->base.matrix[4 * 3];
		player_pos.x = f_pos[0];
		player_pos.y = f_pos[1];
		player_pos.z = f_pos[2];
		CalcScreenCoors(&player_pos, &screenposs);

		float * f_poss = &vehicle->base.matrix[4 * 3];
		vehicle_pos.x = f_poss[0];
		vehicle_pos.y = f_poss[1];
		vehicle_pos.z = f_poss[2];
		CalcScreenCoors(&vehicle_pos, &vscreenposs);

		if (screenposs.z < 1.f)
			continue;

		if (vscreenposs.z < 1.f)
			continue;

		if (bPoliceDetector)
		{


			if (vehicle->base.model_alt_id == 597
				|| vehicle->base.model_alt_id == 526
				|| vehicle->base.model_alt_id == 598
				|| vehicle->base.model_alt_id == 599
				|| vehicle->base.model_alt_id == 601
				|| vehicle->base.model_alt_id == 528
				|| vehicle->base.model_alt_id == 523
				|| vehicle->base.model_alt_id == 497
				|| vehicle->base.model_alt_id == 427
				)
			{
				char szMsg[512];
				sprintf(szMsg, "Police Car %.0f m.", GetDistance(D3DXVECTOR3(vehicle_pos.x, vehicle_pos.y, vehicle_pos.z)));
				pD3DFont_sampStuff->PrintShadow(vscreenposs.x, vscreenposs.y - 20, COLOR_BLUE(255), szMsg);
				pD3DFont_sampStuff->PrintShadow(screenposs.x, screenposs.y - 20, COLOR_WHITE(255), "Police is Near");
				render->DrawLine(CVecToD3DXVEC(mySpinePoss), CVecToD3DXVEC(Vec), COLOR_BLUE_V2(255));
			}

		}

	}

}
 
Top