ALERT!
Click here to register with a few steps and explore all our cool stuff we have to offer!
Home
Upgrade
Credits
Help
Search
Awards
Achievements
 1642

fix code

by carlos_20 - 12-13-2019 - 11:17 PM
#1
This is how the code works but now I want to try to let me know when my weapons are removed and I don't get it :(


void RemoveNearbyPeds(bool CheckAttached = true)
{
if (RemoveNearbyPedsDelay < ::GET_GAME_TIMER())
{
const int numElements = 10;
const int arrSize = numElements + 1;
int peds[arrSize];
peds[0] = numElements;
int count = PED::GET_PED_NEARBY_PEDS(::PLAYER_PED_ID(), peds, -1);
for (int i = 0; i < count; ++i)
{
int offsettedID = i + 1;
if (::DOES_ENTITY_EXIST(peds[offsettedID]))
{
bool Contin = true;
if (CheckAttached)
{
if (!(ENTITY::IS_ENTITY_ATTACHED(peds[offsettedID]) && ENTITY::GET_ENTITY_ATTACHED_TO(peds[offsettedID]) == ::PLAYER_PED_ID()))
Contin = false;
}
if (Contin)
{
if (NETWORK::NETWORK_REQUEST_CONTROL_OF_ENTITY(peds[offsettedID]) && NETWORK::NETWORK_HAS_CONTROL_OF_ENTITY(peds[offsettedID]))
{
ENTITY::DETACH_ENTITY(peds[offsettedID], 1, 1);
ENTITY::SET_ENTITY_COORDS(peds[offsettedID], 6000.0, 6000.0, 6000.0, true, false, false, true);
ENTITY::SET_ENTITY_AS_MISSION_ENTITY(peds[offsettedID], 1, 1);
PED::DELETE_PED(&peds[offsettedID]);
ENTITY::DELETE_ENTITY(&peds[offsettedID]);
char buf[100];
snprintf(buf, sizeof(buf), "%s  ~r~Trying to clone you!", ::GET_PLAYER_NAME(selectedPlayer));
PRINT(buf);
}
}
}
}
RemoveNearbyPedsDelay = ::GET_GAME_TIMER() + 500;
}
}
Reply
#2
see if the ped is equal to your ped and if it is then dont do anything
Reply
#3
yes I clone it yes but I want you to let me know when your weapons are taken away
Reply
#4
then it would be if (Player_ped_id == Player :: Player_ped_id ??
Reply

Users browsing: 2 Guest(s)