SA-MP Forums Archive
Vehicles Not Load this my problems :D - 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: Vehicles Not Load this my problems :D (/showthread.php?tid=566687)



Vehicles Not Load this my problems :D - sas10 - 07.03.2015

Hello Guys
My Problems My Vehicles Not Load idk why
please help +rep
Thanks
PHP код:
public OnPlayerConnect(playerid)
{
    if(
fexist(FolderVehicles(playerid)))
    {
        
inline loadvehicle(string:name[], string:value[])
        {
            
INI_Int("model"vInfo[playerid][model]);
            
INI_Int("world"vInfo[playerid][world]);
            
INI_Int("interior"vInfo[playerid][interior]);
            
INI_Float("pos:x"vInfo[playerid][x_]);
            
INI_Float("pos:y"vInfo[playerid][y_]);
            
INI_Float("pos:z"vInfo[playerid][z_]);
        }
        
INI_ParseFile(FolderVehicles(playerid), "loadvehicle");
        
vInfo[playerid][vehicle] = 1;
    }
    else if(!
fexist(FolderVehicles(playerid)))
    {
        
vInfo[playerid][vehicle] = 0;
    }
    return 
true;

PHP код:
public OnPlayerRequestSpawn(playerid)
{
    if(
vInfo[playerid][vehicle] != 0)
    {
        
vInfo[playerid][vehicle] = CreateVehicle(vInfo[playerid][model], vInfo[playerid][x_], vInfo[playerid][y_], vInfo[playerid][z_], 3random(126), random(126), (60*60));
        
SetVehicleVirtualWorld(vInfo[playerid][vehicle], vInfo[playerid][world]);
        
LinkVehicleToInterior(vInfo[playerid][vehicle], vInfo[playerid][interior]);
    }
    return 
true;




Respuesta: Vehicles Not Load this my problems :D - JuanStone - 07.03.2015

The code is well. What is the problem ?


Re: Respuesta: Vehicles Not Load this my problems :D - sas10 - 07.03.2015

Quote:
Originally Posted by JuanStone
Посмотреть сообщение
The code is well. What is the problem ?
idk why its not load The Vehicles :/
please any one help +rep please help


Re: Vehicles Not Load this my problems :D - TheSnaKe - 07.03.2015

Try to add ".txt" after the folder name in the code. "Foldername.txt"
Not sure, but give a try.


Re: Vehicles Not Load this my problems :D - sas10 - 07.03.2015

Quote:
Originally Posted by TheSnaKe
Посмотреть сообщение
Try to add ".txt" after the folder name in the code. "Foldername.txt"
Not sure, but give a try.
sorry i cant understand u
i still have this problems its not load the vehicles :/ please help +rep


Re: Vehicles Not Load this my problems :D - TheSnaKe - 07.03.2015

Quote:
Originally Posted by sas10
Посмотреть сообщение
sorry i cant understand u
i still have this problems its not load the vehicles :/ please help +rep
PHP код:
public OnPlayerConnect(playerid

    if(
fexist(FolderVehicles.txt(playerid))) 
    { 
        
inline loadvehicle(string:name[], string:value[]) 
        { 
            
INI_Int("model"vInfo[playerid][model]); 
            
INI_Int("world"vInfo[playerid][world]); 
            
INI_Int("interior"vInfo[playerid][interior]); 
            
INI_Float("pos:x"vInfo[playerid][x_]); 
            
INI_Float("pos:y"vInfo[playerid][y_]); 
            
INI_Float("pos:z"vInfo[playerid][z_]); 
        } 
        
INI_ParseFile(FolderVehicles(playerid), "loadvehicle"); 
        
vInfo[playerid][vehicle] = 1
    } 
    else if(!
fexist(FolderVehicles.txt(playerid))) 
    { 
        
vInfo[playerid][vehicle] = 0
    } 
    return 
true

If it doesn't works, are you sure that you have the "FolderVehicles" in your scriptfiles?


Re: Vehicles Not Load this my problems :D - sas10 - 07.03.2015

Quote:
Originally Posted by TheSnaKe
Посмотреть сообщение
PHP код:
public OnPlayerConnect(playerid

    if(
fexist(FolderVehicles.txt(playerid))) 
    { 
        
inline loadvehicle(string:name[], string:value[]) 
        { 
            
INI_Int("model"vInfo[playerid][model]); 
            
INI_Int("world"vInfo[playerid][world]); 
            
INI_Int("interior"vInfo[playerid][interior]); 
            
INI_Float("pos:x"vInfo[playerid][x_]); 
            
INI_Float("pos:y"vInfo[playerid][y_]); 
            
INI_Float("pos:z"vInfo[playerid][z_]); 
        } 
        
INI_ParseFile(FolderVehicles(playerid), "loadvehicle"); 
        
vInfo[playerid][vehicle] = 1
    } 
    else if(!
fexist(FolderVehicles.txt(playerid))) 
    { 
        
vInfo[playerid][vehicle] = 0
    } 
    return 
true

If it doesn't works, are you sure that you have the "FolderVehicles" in your scriptfiles?
PHP код:
scriptfiles\Vehicles 
and there in the folder my text with my name and in it the vehicles id and pos
and i try u code there in it error
guys still not fixed the problems please help me to load :/
its working only with saving but load now
see my saving its fine
PHP код:
public OnPlayerDisconnect(playeridreason)
{
    if(
vInfo[playerid][vehicle] != 0)
    {
        new 
Float:pos[3];
        
GetVehiclePos(vInfo[playerid][vehicle], pos[0], pos[1], pos[2]);
        
PutPlayerInVehicle(playeridvInfo[playerid][vehicle], 0);
        new 
INI:File INI_Open(FolderVehicles(playerid));
        
INI_SetTag(File"Info vehicle");
        
INI_WriteInt(File"model"vInfo[playerid][model]);
        
INI_WriteInt(File"world"GetVehicleVirtualWorld(vInfo[playerid][vehicle]));
        
INI_WriteInt(File"interior"GetPlayerInterior(playerid));
        
INI_WriteFloat(File"pos:x"pos[0]);
        
INI_WriteFloat(File"pos:y"pos[1]);
        
INI_WriteFloat(File"pos:z"pos[2]);
        
INI_Close(File);
        
//..
        
DestroyVehicle(vInfo[playerid][vehicle]);
    }
    return 
true;

what the problems why i cant load from frist code :/


Re: Vehicles Not Load this my problems :D - sas10 - 07.03.2015

guys any one please help me


Respuesta: Vehicles Not Load this my problems :D - JuanStone - 08.03.2015

The code is good, it could be that you don't have the folder "vehicles" created with crashdetect test and you will notice that there is no error, i tried the code and it worked correctly.


Re: Respuesta: Vehicles Not Load this my problems :D - sas10 - 08.03.2015

Quote:
Originally Posted by JuanStone
Посмотреть сообщение
The code is good, it could be that you don't have the folder "vehicles" created with crashdetect test and you will notice that there is no error, i tried the code and it worked correctly.
PHP код:
D:\MyOwn\scriptfiles\Vehicles 
i have it -_-
there the text in folder see
'astanalol' its name text
PHP код:
[Info vehicle]
model 521
world 
0
interior 
0
pos
:2280.796875
pos
:2411.673583
pos
:10.248614 
now the everythings in text |
its working fine to save but load no :/