3DTextLabel problem
#1

i have a buyable store system the problem is when u buy store your name will be on 3DTextLabel but after buy store if u reload store your name will be null.
sorry for my english.
PHP код:
Function OnStoreLoad()
{
    new 
        
0,
        
i,
        
s[64]
    ;
    for(new 
xx cache_get_row_count(); xxx++)
    {
        
Iter_Free(Stores);
        
Store[i][StoreID] = cache_get_field_content_int(x"id");
        
Store[i][StoreX] = cache_get_field_content_float(x"x");
        
Store[i][StoreY] = cache_get_field_content_float(x"y");
        
Store[i][StoreZ] = cache_get_field_content_float(x"z");
        
Store[i][StoreA] = cache_get_field_content_float(x"angle");
        
Store[i][StoreInteriorID] = cache_get_field_content_int(x"interiorid");
        
cache_get_field_content(x"name"s);
        
format(Store[i][StoreName], 64"%s"s);
        
Store[i][StoreMoney] = cache_get_field_content_int(x"money");
        
Store[i][StoreMoneyPerDay] = cache_get_field_content_int(x"mpd");
        
Store[i][StorePrice] = cache_get_field_content_int(x"price");
        
Store[i][StoreLevel] = cache_get_field_content_int(x"level");
        
Store[i][StoreIconID] = cache_get_field_content_int(x"mapicon");
        
Store[i][StoreOwner] = cache_get_field_content_int(x"owner");
        
Store[i][StoreIcon] = CreateDynamicMapIcon(Store[i][StoreX], Store[i][StoreY], Store[i][StoreZ], Store[i][StoreIconID], -100, .style MAPICON_GLOBAL);
        
Store[i][StoreEnterPickup] = CreateDynamicPickup(13181Store[i][StoreX], Store[i][StoreY], Store[i][StoreZ], 00, -135.0);
        new 
intid IsInteriorExist(Store[i][StoreInteriorID]), label[256];
        
cache_get_field_content(x"username"s);
        if(
Store[i][StorePrice] == 1337)
            
format(label256"{FF0000}[%s]\n{FFFFFF}{FFFF66}ID: {FFFFFF}%d\n{FFFF66}Owner: {FFFFFF}The Government"Store[i][StoreName], Store[i][StoreID]);
        else if(
Store[i][StoreOwner] == 0)
            
format(label256"{FF0000}[%s]\n{FFFFFF}{FFFF66}ID: {FFFFFF}%d\n{FFFF66}Owner: {FFFFFF}Unowned\n{FFFF66}Price: {FFFFFF}$%m\n{FFFF66}Level: {FFFFFF}%d\n{FFFF66}$%m per gameday"Store[i][StoreName], Store[i][StoreID], Store[i][StorePrice], Store[i][StoreLevel], Store[i][StoreMoneyPerDay]);
        else
            
format(label256"{FF0000}[%s]\n{FFFFFF}{FFFF66}ID: {FFFFFF}%d\n{FFFF66}Owner: {FFFFFF}%s\n{FFFF66}Price: {FFFFFF}$%m\n{FFFF66}Level: {FFFFFF}%d\n{FFFF66}$%m per gameday"Store[i][StoreName], Store[i][StoreID], sStore[i][StorePrice], Store[i][StoreLevel], Store[i][StoreMoneyPerDay]);
        
Store[i][StoreStatus] = STORE_IDLE;
        
Store[i][StoreSafe] = CreateSafe(Interior[intid][InteriorSafeID], Store[i][StoreID]);
        
Store[i][StoreExitCP] = CreateDynamicCP(Interior[intid][InteriorX], Interior[intid][InteriorY], Interior[intid][InteriorZ], 1.0Store[i][StoreID], Interior[intid][InteriorIntID]);
        
Store[i][StoreEnterLabel] = CreateDynamic3DTextLabel(label, -1Store[i][StoreX], Store[i][StoreY], Store[i][StoreZ], 10.0, .worldid 0, .interiorid 0);
        
UpdateDynamic3DTextLabelText(Store[i][StoreEnterLabel], -1label);
        
Store[i][StoreRobberyCP] = CreateSafeCP(Interior[intid][InteriorSafeID], Store[i][StoreID]);
        
Store[i][StoreRobberyLabel] = CreateRobberyLabel(Interior[intid][InteriorSafeID], Store[i][StoreID]);
        
Store[i][StoreActor] = CreateActor(Interior[intid][InteriorActorSkin], Interior[intid][InteriorActorX], Interior[intid][InteriorActorY], Interior[intid][InteriorActorZ], Interior[intid][InteriorActorA]);
        switch(
random(4))
        {
            case 
0:
                
ApplyActorAnimation(Store[i][StoreActor], "PED""roadcross"4.111110);
            case 
1:
                
ApplyActorAnimation(Store[i][StoreActor], "PED""roadcross_female"4.111110);
            case 
2:
                
ApplyActorAnimation(Store[i][StoreActor], "PED","roadcross_gang"4.111110);
            case 
3:
                
ApplyActorAnimation(Store[i][StoreActor], "PED","roadcross_old"4.111110);
        }
        
SetActorVirtualWorld(Store[i][StoreActor], Store[i][StoreID]);
        
Iter_Add(Storesi);
    }
    return;
}
ReloadStore()
{
    foreach(new 
Stores)
    {
        
DestroyDynamicMapIcon(Store[i][StoreIcon]);
        
DeleteSafe(Store[i][StoreSafe]);
        
DestroyDynamicCP(Store[i][StoreExitCP]);
        
DestroyDynamicCP(Store[i][StoreRobberyCP]);
        
DestroyDynamic3DTextLabel(Store[i][StoreRobberyLabel]);
        
DestroyDynamic3DTextLabel(Store[i][StoreEnterLabel]);
        
DestroyDynamicPickup(Store[i][StoreEnterPickup]);
        
DestroyActor(Store[i][StoreActor]);
    }
    
Iter_Clear(Stores);
    
mysql_tquery(connectionHandle"SELECT * FROM `store`""OnStoreLoad");

Reply


Messages In This Thread
3DTextLabel problem - by sams90 - 04.03.2017, 02:14
Re: 3DTextLabel problem - by noxno0609 - 04.03.2017, 03:12
Re: 3DTextLabel problem - by sams90 - 04.03.2017, 04:04
Re: 3DTextLabel problem - by sams90 - 05.03.2017, 01:16
Re: 3DTextLabel problem - by JessThompson - 05.03.2017, 01:40

Forum Jump:


Users browsing this thread: 2 Guest(s)