Loading [REP+++++]
#1

Why this won't load
Under OnGameModInt
PHP код:
    new str[40];
    for(new 
0sizeof(BusinessInfo);x++)
    {
    
format(str,sizeof(str),BPATHx);
    
INI_ParseFile(str"loadbiz_%s", .bExtra true, .extra x);
    
BusinessInfo[x][bOutSideIcon] = CreateDynamicPickup(12721BusinessInfo[x][bEntranceX], BusinessInfo[x][bEntranceY], BusinessInfo[x][bEntranceZ], BusinessInfo[x][bWorld]);
    
BusinessInfo[x][bInsideIcon] = CreateDynamicPickup(12721BusinessInfo[x][bExitX], BusinessInfo[x][bExitY], BusinessInfo[x][bExitZ], BusinessInfo[x][bInsideWorld]);
    } 
PHP код:
public SaveBusiness(id)
{
    new 
file4[40];
    
format(file4,sizeof(file4),BPATHid);
    new 
INI:File INI_Open(file4);
    
INI_SetTag(File,"Data");
    
INI_WriteInt(File,"bOwned",BusinessInfo[id][bOwned]);
    
INI_WriteInt(File,"bPrice",BusinessInfo[id][bPrice]);
    
INI_WriteString(File,"bOwner",BusinessInfo[id][bOwner]);
    
INI_WriteInt(File,"bType",BusinessInfo[id][bType]);
    
INI_WriteInt(File,"bLocked",BusinessInfo[id][bLocked]);
    
INI_WriteInt(File,"bMoney",BusinessInfo[id][bMoney]);
    
INI_WriteFloat(File,"bEntranceX",BusinessInfo[id][bEntranceX]);
    
INI_WriteFloat(File,"bEntranceY",BusinessInfo[id][bEntranceY]);
    
INI_WriteFloat(File,"bEntranceZ",BusinessInfo[id][bEntranceZ]);
    
INI_WriteFloat(File,"bEntranceA",BusinessInfo[id][bEntranceA]);
    
INI_WriteFloat(File,"bExitX",BusinessInfo[id][bExitX]);
    
INI_WriteFloat(File,"bExitY",BusinessInfo[id][bExitY]);
    
INI_WriteFloat(File,"bExitZ",BusinessInfo[id][bExitZ]);
    
INI_WriteFloat(File,"bExitA",BusinessInfo[id][bExitA]);
    
INI_WriteInt(File,"bInt",BusinessInfo[id][bInt]);
    
INI_WriteInt(File,"bWorld",BusinessInfo[id][bWorld]);
    
INI_WriteInt(File,"bInsideInt",BusinessInfo[id][bInsideInt]);
    
INI_WriteInt(File,"bInsideWorld",BusinessInfo[id][bInsideWorld]);
    
INI_WriteInt(File,"bInsideIcon",BusinessInfo[id][bInsideIcon]);
    
INI_WriteInt(File,"bOutSideIcon",BusinessInfo[id][bOutSideIcon]);
    
INI_WriteString(File,"bName",BusinessInfo[id][bName]);
    
INI_Close(File);
    return 
1;
}
public 
loadbiz_data(idxname[], value[])
{
    
INI_Int("bOwned",BusinessInfo[idx][bOwned]);
    
INI_String("bOwner",BusinessInfo[idx][bOwner],24);
    
INI_Int("bPrice",BusinessInfo[idx][bPrice]);
    
INI_Int("bType",BusinessInfo[idx][bType]);
    
INI_Int("bLocked",BusinessInfo[idx][bLocked]);
    
INI_Int("bMoney",BusinessInfo[idx][bMoney]);
    
INI_Float("bEntranceX",BusinessInfo[idx][bEntranceX]);
    
INI_Float("bEntranceY",BusinessInfo[idx][bEntranceY]);
    
INI_Float("bEntranceZ",BusinessInfo[idx][bEntranceZ]);
    
INI_Float("bEntranceA",BusinessInfo[idx][bEntranceA]);
    
INI_Float("bExitX",BusinessInfo[idx][bExitX]);
    
INI_Float("bExitY",BusinessInfo[idx][bExitY]);
    
INI_Float("bExitZ",BusinessInfo[idx][bExitZ]);
    
INI_Float("bExitA",BusinessInfo[idx][bExitA]);
    
INI_Int("bInt",BusinessInfo[idx][bInt]);
    
INI_Int("bWorld",BusinessInfo[idx][bWorld]);
    
INI_Int("bInsideInt",BusinessInfo[idx][bInsideInt]);
    
INI_Int("bInsideInt",BusinessInfo[idx][bInsideInt]);
    
INI_Int("bInsideWorld",BusinessInfo[idx][bInsideWorld]);
    
INI_Int("bInsideIcon",BusinessInfo[idx][bInsideIcon]);
    
INI_Int("bOutSideIcon",BusinessInfo[idx][bOutSideIcon]);
    
INI_String("bName",BusinessInfo[idx][bName],128);
    return 
1;

PHP код:
CMD:createbiz(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playeridCOLOR_RED"Command not found on the server! /help");
    new 
pricelevelidintworldstring[128], Float:XiFloat:YiFloat:Ziinti;
    if(
sscanf(params,"dd",price,level)) return SendClientMessage(playeridCOLOR_RED"Make a business: /createbiz [Price] [Type]");
    if(
level || level 8) return SendClientMessage(playeridCOLOR_RED"Type can't be below than 0 or more than 8");
    if(
price 100000) return SendClientMessage(playeridCOLOR_RED"Price can't be below than $100,000");
    new 
Float:xFloat:yFloat:z;
    new 
Float:a;
    
GetPlayerPos(playeridxyz);
    
GetPlayerFacingAngle(playerida);
    
BusinessInfo[id][bOwned] = 0;
    
BusinessInfo[id][bPrice] = price;
    
BusinessInfo[id][bType] = level;
    
BusinessInfo[id][bEntranceX] = x;
    
BusinessInfo[id][bEntranceY] = y;
    
BusinessInfo[id][bEntranceZ] = z;
    
BusinessInfo[id][bEntranceA] = a;
    if(
level == 1// 24/7
    
{
        new 
rand random(3);
        if(
rand == 1)
        {
            
BusinessInfo[id][bExitX] = -25.884498;
            
BusinessInfo[id][bExitY] = -185.868988;
            
BusinessInfo[id][bExitZ] = 1003.546875;
            
BusinessInfo[id][bInsideInt] = 17;
            
BusinessInfo[id][bInsideWorld] = 2;
        }
        else if(
rand == 2)
        {
            
BusinessInfo[id][bExitX] = 6.091179;
            
BusinessInfo[id][bExitY] = -29.271898;
            
BusinessInfo[id][bExitZ] = 1003.549438;
            
BusinessInfo[id][bInsideInt] = 10;
            
BusinessInfo[id][bInsideWorld] = 2;
        }
        else if(
rand == 3)
        {
            
BusinessInfo[id][bExitX] = -30.946699;
            
BusinessInfo[id][bExitY] = -89.609596;
            
BusinessInfo[id][bExitZ] = 1003.546875;
            
BusinessInfo[id][bInsideInt] = 18;
            
BusinessInfo[id][bInsideWorld] = 2;
        }
    }
    else if(
level == 2// Ammo-Nation
    
{
        new 
rand random(3);
        if(
rand == 1)
        {
              
BusinessInfo[id][bExitX] = 286.148986;
            
BusinessInfo[id][bExitY] = -40.644397;
            
BusinessInfo[id][bExitZ] = 1001.515625;
            
BusinessInfo[id][bInsideInt] = 1;
            
BusinessInfo[id][bInsideWorld] = 2;
        }
        else if(
rand == 2)
        {
            
BusinessInfo[id][bExitX] = 296.919982;
            
BusinessInfo[id][bExitY] = -108.071998;
            
BusinessInfo[id][bExitZ] = 1001.515625;
            
BusinessInfo[id][bInsideInt] = 6;
            
BusinessInfo[id][bInsideWorld] = 2;
        }
        else if(
rand == 3)
        {
            
BusinessInfo[id][bExitX] = 314.820983;
            
BusinessInfo[id][bExitY] = -141.431991;
            
BusinessInfo[id][bExitZ] = 999.601562;
            
BusinessInfo[id][bInsideInt] = 7;
            
BusinessInfo[id][bInsideWorld] = 2;
        }
    }
    else if(
level == 3// Clothes
    
{
        new 
rand random(3);
        if(
rand == 1)
        {
               
BusinessInfo[id][bExitX] = 207.737991;
            
BusinessInfo[id][bExitY] = -109.019996;
            
BusinessInfo[id][bExitZ] = 1005.132812;
            
BusinessInfo[id][bInsideInt] = 15;
            
BusinessInfo[id][bInsideWorld] = 2;
        }
        if(
rand == 2)
        {
               
BusinessInfo[id][bExitX] = 204.332992;
            
BusinessInfo[id][bExitY] = -166.694992;
            
BusinessInfo[id][bExitZ] = 1000.523437;
            
BusinessInfo[id][bInsideInt] = 14;
            
BusinessInfo[id][bInsideWorld] = 2;
        }
        if(
rand == 3)
        {
            
BusinessInfo[id][bExitX] = 207.054992;
            
BusinessInfo[id][bExitY] = -138.804992;
            
BusinessInfo[id][bExitZ] = 1003.507812;
            
BusinessInfo[id][bInsideInt] = 3;
            
BusinessInfo[id][bInsideWorld] = 2;
        }
    }
    else if(
level == 4//pizza
    
{
        
BusinessInfo[id][bExitX] = 373.825653;
        
BusinessInfo[id][bExitY] = -117.270904;
        
BusinessInfo[id][bExitZ] = 1001.499511;
        
BusinessInfo[id][bInsideInt] = 5;
        
BusinessInfo[id][bInsideWorld] = 2;
    }
    else if(
level == 5//Burger
    
{
        
BusinessInfo[id][bExitX] = 375.962463;
        
BusinessInfo[id][bExitY] = -65.816848;
        
BusinessInfo[id][bExitZ] = 1001.507812;
        
BusinessInfo[id][bInsideInt] = 10;
        
BusinessInfo[id][bInsideWorld] = 2;
    }
    else if(
level == 6//Cluckin'bell
    
{
        
BusinessInfo[id][bExitX] = 369.579528;
        
BusinessInfo[id][bExitY] = -4.487294;
        
BusinessInfo[id][bExitZ] = 1001.858886;
        
BusinessInfo[id][bInsideInt] = 9;
        
BusinessInfo[id][bInsideWorld] = 2;
    }
    else if(
level == 7//Barber
    
{
        
BusinessInfo[id][bExitX] = 411.625976;
        
BusinessInfo[id][bExitY] = -21.433298;
        
BusinessInfo[id][bExitZ] = 1001.804687;
        
BusinessInfo[id][bInsideInt] = 2;
        
BusinessInfo[id][bInsideWorld] = 2;
    }
    else if(
level == 8//Tatoo
    
{
        
BusinessInfo[id][bExitX] = -204.439987;
        
BusinessInfo[id][bExitY] = -26.453998;
        
BusinessInfo[id][bExitZ] = 1002.273437;
        
BusinessInfo[id][bInsideInt] = 16;
        
BusinessInfo[id][bInsideWorld] = 2;
    }
    
BusinessInfo[id][bOutSideIcon] = CreateDynamicPickup(1272,1,BusinessInfo[id][bEntranceX],BusinessInfo[id][bEntranceY],BusinessInfo[id][bEntranceZ],-1);
    
BusinessInfo[id][bInsideIcon] = CreateDynamicPickup(1272,1,BusinessInfo[id][bExitX],BusinessInfo[id][bExitY],BusinessInfo[id][bExitZ],BusinessInfo[id][bInsideWorld]);
    new 
file4[40];
    
format(file4,sizeof(file4),BPATHid);
    new 
INI:File INI_Open(file4);
    
INI_SetTag(File,"Data");
    
INI_WriteInt(File,"bOwned",BusinessInfo[id][bOwned]);
    
INI_WriteInt(File,"bPrice",BusinessInfo[id][bPrice]);
    
INI_WriteString(File,"bOwner",BusinessInfo[id][bOwner]);
    
INI_WriteInt(File,"bType",BusinessInfo[id][bType]);
    
INI_WriteInt(File,"bLocked",BusinessInfo[id][bLocked]);
    
INI_WriteInt(File,"bMoney",BusinessInfo[id][bMoney]);
    
INI_WriteFloat(File,"bEntranceX",BusinessInfo[id][bEntranceX]);
    
INI_WriteFloat(File,"bEntranceY",BusinessInfo[id][bEntranceY]);
    
INI_WriteFloat(File,"bEntranceZ",BusinessInfo[id][bEntranceZ]);
    
INI_WriteFloat(File,"bEntranceA",BusinessInfo[id][bEntranceA]);
    
INI_WriteFloat(File,"bExitX",BusinessInfo[id][bExitX]);
    
INI_WriteFloat(File,"bExitY",BusinessInfo[id][bExitY]);
    
INI_WriteFloat(File,"bExitZ",BusinessInfo[id][bExitZ]);
    
INI_WriteFloat(File,"bExitA",BusinessInfo[id][bExitA]);
    
INI_WriteInt(File,"bInt",BusinessInfo[id][bInt]);
    
INI_WriteInt(File,"bWorld",BusinessInfo[id][bWorld]);
    
INI_WriteInt(File,"bInsideInt",BusinessInfo[id][bInsideInt]);
    
INI_WriteInt(File,"bInsideWorld",BusinessInfo[id][bInsideWorld]);
    
INI_WriteInt(File,"bInsideIcon",BusinessInfo[id][bInsideIcon]);
    
INI_WriteInt(File,"bOutSideIcon",BusinessInfo[id][bOutSideIcon]);
    
INI_WriteString(File,"bName",BusinessInfo[id][bName]);
    
INI_Close(File);
    return 
1;

When i restart the server the pickups doesn't load
REP++
Reply
#2

try this
pawn Код:
INI_ParseFile(str, "loadbiz_data", .bExtra = true, .extra = x);
instead of this:
pawn Код:
INI_ParseFile(str, "loadbiz_%s", .bExtra = true, .extra = x);
Reply
#3

Thank u aother qeustion
It made one file only so when i made a biz it remove the last one and add this and issue ?
Reply
#4

Quote:
Originally Posted by nezo2001
Посмотреть сообщение
Thank u aother qeustion
It made one file only so when i made a biz it remove the last one and add this and issue ?
What u mean can u explain it ?
Reply
#5

When i make a business it make a file in a folder in my scriptfiles good,
Then when i make another business it remove all the info of the first business and replace it with the new one and so on.
So, it is only one file.
Then, I can't save ecxept one business.....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)