Jump to content

remove client side blip created with mp.game.ui.addBlipForRadius


Recommended Posts

Posted

Nothing here I have a function set server-side to remove it but when the player disconnects the function isn't getting called

Posted (edited)

Server side OnPlayerDisconnected event

NAPI.ClientEvent.TriggerClientEvent(player, "DestroyTurfs"); This is under 
  
  

ClientSide : 

mp.events.add("DestroyTurfs",clearBlips);


function clearBlips() {
    mp.events.callRemote("TestEvent");
    mp.game.invoke("0xB98236CAAECEF897", true);
    let last_blip = mp.game.invoke("0x1BEDE233E6CD2A1F", 5);
    while (mp.game.invoke("0xA6DB27D19ECBB7DA", last_blip)) {
        mp.game.ui.removeBlip(last_blip)
        last_blip = mp.game.invoke("0x14F96AA50D6FBEA7", 5);
    }
    DestroyTurfs();
	mp.game.wait(50)
}


function DestroyTurfs() //Setting the zone to an invesible blip
{
    for(var i = 0; i<zones.length; i++)
    mp.game.invoke("0xDF735600A4696DAF", zones[i], 3)
}

The clearBlips function is found on this thread ,i did not make it 

The function is never called when the player disconnects actually but i tried putting it under OnPlayerConencted and it worked and got called

Edited by hash_

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...