Update housepickup_mapicon -
EvgeniyHostel1992 - 04.03.2018
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], 0, hl[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);
Re: Update housepickup_mapicon -
ball - 04.03.2018
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);
}
Re: Update housepickup_mapicon -
EvgeniyHostel1992 - 04.03.2018
delete
Re: Update housepickup_mapicon -
EvgeniyHostel1992 - 04.03.2018
if you leave the game and go in then everything is fine
Re: Update housepickup_mapicon -
EvgeniyHostel1992 - 04.03.2018
i dicided
PHP код:
LOADhouse:
hl[idx][hP] = CreateDynamicPickup(hl[idx][hPickup], 1, hl[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], 1, hl[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);