Updatehouse pickup's,MapIcons and 3dtext
#1

When moving the house (FIRST time) - the pickup is not transferred, (it is transferred SECOND TIME, created in a new place and DOES NOT disintegrate on the old one).
The house icon at the time of purchase is deleted immediately and transferred to a new location, but it is not always updated when purchasing, remains old.
3dTEXT is not deleted in the old place and is not created in a new place.
i from ukraine, bad writing in english
code >
PHP код:
stock UpdateHouse(idx)
{
    
DestroyDynamicMapIcon(hl[idx][hMapIcon]);
    
DestroyPickup(hl[idx][hPickup]);
    
DestroyDynamic3DTextLabel(htext[idx]);
    if(
hl[idx][hOwned]==0)
    {
        
hl[idx][hMapIcon] = CreateDynamicMapIcon(hl[idx][hEnterx], hl[idx][hEntery], hl[idx][hEnterz], 310,-1,-1,-1,200.0);
        
hl[idx][hPickup] = CreatePickup(12730hl[idx][hEnterx], hl[idx][hEntery], hl[idx][hEnterz]);
        
format(hstr2,sizeof(hstr2),"ID: %d - %s\nLevel:%d\nHouseName:%d $",hl[idx][hID],hl[idx][hOwner],hl[idx][hLevel],hl[idx][hPrice]);
        
Update3DTextLabelText(htext[idx],COLOR_BLUE,hstr2);
    }
    else
    {
        
hl[idx][hMapIcon] = CreateDynamicMapIcon(hl[idx][hEnterx], hl[idx][hEntery], hl[idx][hEnterz], 320,-1,-1,-1,200.0);
        
hl[idx][hPickup] = CreatePickup(195220hl[idx][hEnterx], hl[idx][hEntery], hl[idx][hEnterz]);
        
format(hstr2,sizeof(hstr2),"ID: %d\nHouseName:%s",hl[idx][hID],hl[idx][hOwner]);
        
Update3DTextLabelText(htext[idx],COLOR_LIGHTRED,hstr2);
    }
    return 
true;

Reply
#2

update
Reply
#3

Didnt actually get the actual problem? Does it not update or what? and if it does updated, then when and how?

Also, you sure the coordinates are updated before you update?
Reply
#4

show us the buy house command
Reply
#5

PHP код:
CMD:changehpos(playeridparams[]){
    new 
idx;
    if(
sscanf(params,"d"idx))return send(playeridCOLOR_GRAD1"USAGE: /changehpos house");
    new 
Float:X,Float:Y,Float:Z;
    
GetPlayerPos(playerid,X,Y,Z);
    
send(playerid,COLOR_GRAD1,"Äîì ïåðåíåñ¸í íà íîâóþ ïîçèöèþ");
    
hl[idx][hEnterx] = X;
    
hl[idx][hEntery] = Y;
    
hl[idx][hEnterz] = Z;
    
format(query1sizeof(query1), "UPDATE `house` SET `Enterx` = '%2.f', `Entery` = '%2.f', `Enterz` = '%2.f' WHERE `hID` = '%d'"hl[idx][hEnterx],hl[idx][hEntery],hl[idx][hEnterz],hl[idx][hID]);
    
mysql_function_query(mysql_connect_IDquery1false"""");
    
UpdateHouse(idx);
    return 
true;} 
Reply
#6

try not to use %2.f while saving.
Reply
#7

nothing changed
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)