Update housepickup_mapicon
#1

When you move the house, the pickup and the icon (on the map) are transferred, but the pickup and icon on the old positions remain. Help me decide.

PHP код:
DestroyDynamicMapIcon(hl[idx][hM]);
    
DestroyDynamicPickup(hl[idx][hP]); 
The pickup and icon change position during further transfers, but the initial position of pickups and icons (which is indicated at loading (houses / gamemode) - is not deleted.

Ongamemodeinit :
PHP код:
hl[idx][hP] = AddStaticPickup(hl[idx][hPickup], 0hl[idx][hEnterx], hl[idx][hEntery], hl[idx][hEnterz]);
        
hl[idx][hM] = CreateDynamicMapIcon(hl[idx][hEnterx],hl[idx][hEntery],hl[idx][hEnterz],hl[idx][hMapIcon],-1,-1,-1,-1,200.0); 
Reply
#2

You use AddStaticPickup to create pickup and use DestroyDynamicPickup to destroy it, you can't do it like that. Use CreateDynamicPickup and DestroyDynamicPickup or CreatePickup and DestroyPickup.

By the way, with streamer better than delete -> create is simply change position with function Streamer_SetFloatData

Код:
SetPickupPos(pickupid, Float:lX, Float:lY, Float:lZ)
{
	Streamer_SetFloatData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_X, lX);
	Streamer_SetFloatData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_Y, lY);
	Streamer_SetFloatData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_Z, lZ);
}
Reply
#3

delete
Reply
#4

if you leave the game and go in then everything is fine
Reply
#5

i dicided

PHP код:
LOADhouse:

hl[idx][hP] = CreateDynamicPickup(hl[idx][hPickup], 1hl[idx][hEnterx], hl[idx][hEntery], hl[idx][hEnterz],-1,-1,-1,30.0,-1,0);
        
hl[idx][hM] = CreateDynamicMapIcon(hl[idx][hEnterx],hl[idx][hEntery],hl[idx][hEnterz],hl[idx][hMapIcon],-1,-1,-1,-1,200.0); 
changehousepos :

PHP код:
DestroyDynamicPickup(hl[idx][hP]);
    
hl[idx][hP] = CreateDynamicPickup(hl[idx][hPickup], 1hl[idx][hEnterx], hl[idx][hEntery], hl[idx][hEnterz],-1,-1,-1,30.0,-1,0);
    
DestroyDynamicMapIcon(hl[idx][hM]);
    
hl[idx][hM] = CreateDynamicMapIcon(hl[idx][hEnterx], hl[idx][hEntery], hl[idx][hEnterz],hl[idx][hMapIcon],-1,-1,-1,-1,200.0); 
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)