SA-MP Forums Archive
Updatehouse pickup's,MapIcons and 3dtext - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Updatehouse pickup's,MapIcons and 3dtext (/showthread.php?tid=649812)



Updatehouse pickup's,MapIcons and 3dtext - EvgeniyHostel1992 - 15.02.2018

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;




Re: Updatehouse pickup's,MapIcons and 3dtext - EvgeniyHostel1992 - 16.02.2018

update


Re: Updatehouse pickup's,MapIcons and 3dtext - GTLS - 16.02.2018

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?


Re: Updatehouse pickup's,MapIcons and 3dtext - PepsiCola23 - 16.02.2018

show us the buy house command


Re: Updatehouse pickup's,MapIcons and 3dtext - EvgeniyHostel1992 - 16.02.2018

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;} 



Re: Updatehouse pickup's,MapIcons and 3dtext - GTLS - 17.02.2018

try not to use %2.f while saving.


Re: Updatehouse pickup's,MapIcons and 3dtext - EvgeniyHostel1992 - 18.02.2018

nothing changed