Help Me in y_ini its not Saving :/
#1

Hello Guys
i Have Problems
When im Leave The Server its Write The Pos And Car Model And interior all this somthings
but when im login Again the Vehicles Model and pos and interior Be 0
idk what this problems please help me ?
+rep
PHP код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#define FILTERSCRIPT
#if defined FILTERSCRIPT
#include <a_samp>
#include <sscanf2>
#include <YSI\y_ini>
#include <YSI\y_inline>
#include <YSI\y_commands> // or zcmd
enum InfoVehicles
{
    
vehicle,
    
model,
    
world,
    
interior,
    
Float:angle,
    
Float:x_,
    
Float:y_,
    
Float:z_
};
new 
vInfo[MAX_PLAYERS][InfoVehicles];
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("angle"vInfo[playerid][angle]);
            
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] = 0vInfo[playerid][model] = 0vInfo[playerid][world] = 0;
        
vInfo[playerid][x_] = 0.00vInfo[playerid][y_] = 0.00vInfo[playerid][z_] = 0.00;
    }
    return 
true;
}
public 
OnPlayerDisconnect(playeridreason)
{
    if(
vInfo[playerid][vehicle] != 0)
    {
        new 
Float:pos[4];
        
GetVehicleZAngle(vInfo[playerid][vehicle], 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"angle"pos[3]);
        
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;
}
public 
OnPlayerRequestSpawn(playerid)
{
    if(
vInfo[playerid][vehicle] != 0)
    {
        
vInfo[playerid][vehicle] = CreateVehicle(vInfo[playerid][model], vInfo[playerid][x_], vInfo[playerid][y_], vInfo[playerid][z_], vInfo[playerid][angle], random(126), random(126), (60*60));
        
SetVehicleVirtualWorld(vInfo[playerid][vehicle], vInfo[playerid][world]);
        
LinkVehicleToInterior(vInfo[playerid][vehicle], vInfo[playerid][interior]);
    }
    return 
true;
}
FolderVehicles(playerid)
{
    new 
string[80], name[MAX_PLAYER_NAME];
    
GetPlayerName(playeridnamesizeof(name));
    
format(stringsizeof(string), "/vehicles/%s.ini"name);
    return 
string;
}
CMD:cars(playeridparams[])
{
    if(
sscanf(params"i"params[0]))
        return 
SendClientMessage(playerid, -1"usage: /cars [vehicle 1-7].");
    if(
vInfo[playerid][vehicle] != 0)
    {
        
DestroyVehicle(vInfo[playerid][vehicle]);
    }
    
//..
    
new Float:pos[4];
    
GetPlayerFacingAngle(playeridpos[3]);
    
GetPlayerPos(playeridpos[0], pos[1], pos[2]);
    
//..
    
switch(params[0])
    {
        case 
1:
        {
            if(
GetPlayerMoney(playerid) < 1200000)
                return 
SendClientMessage(playerid, -1"You don't have enough cash to buy this car!");
            
vInfo[playerid][vehicle] = CreateVehicle(541pos[0], pos[1], pos[2], pos[3], random(126), random(126), (60*60));
            
GivePlayerMoney(playerid, -1200000);
            
vInfo[playerid][model] = 541;
        }
        case 
2:
        {
            if(
GetPlayerMoney(playerid) < 1900000)
                return 
SendClientMessage(playerid, -1"You don't have enough cash to buy this car!");
            
vInfo[playerid][vehicle] = CreateVehicle(411pos[0], pos[1], pos[2], pos[3], random(126), random(126), (60*60));
            
GivePlayerMoney(playerid, -1900000);
            
vInfo[playerid][model] = 411;
        }
        case 
3:
        {
            if(
GetPlayerMoney(playerid) < 4000000)
                return 
SendClientMessage(playerid, -1"You don't have enough cash to buy this car!");
            
vInfo[playerid][vehicle] = CreateVehicle(494pos[0], pos[1], pos[2], pos[3], random(126), random(126), (60*60));
            
GivePlayerMoney(playerid, -4000000);
            
vInfo[playerid][model] = 494;
        }
        case 
4:
        {
            if(
GetPlayerMoney(playerid) < 22000)
                return 
SendClientMessage(playerid, -1"You don't have enough cash to buy this car!");
            
vInfo[playerid][vehicle] = CreateVehicle(409pos[0], pos[1], pos[2], pos[3], random(126), random(126), (60*60));
            
GivePlayerMoney(playerid, -22000);
            
vInfo[playerid][model] = 409;
        }
        case 
5:
        {
            if(
GetPlayerMoney(playerid) < 460000)
                return 
SendClientMessage(playerid, -1"You don't have enough cash to buy this car!");
            
vInfo[playerid][vehicle] = CreateVehicle(560pos[0], pos[1], pos[2], pos[3], random(126), random(126), (60*60));
            
GivePlayerMoney(playerid, -460000);
            
vInfo[playerid][model] = 560;
        }
        case 
6:
        {
            if(
GetPlayerMoney(playerid) < 600000)
                return 
SendClientMessage(playerid, -1"You don't have enough cash to buy this car!");
            
vInfo[playerid][vehicle] = CreateVehicle(506pos[0], pos[1], pos[2], pos[3], random(126), random(126), (60*60));
            
GivePlayerMoney(playerid, -600000);
            
vInfo[playerid][model] = 506;
        }
        case 
7:
        {
            if(
GetPlayerMoney(playerid) < 5000000)
                return 
SendClientMessage(playerid, -1"You don't have enough cash to buy this car!");
            
vInfo[playerid][vehicle] = CreateVehicle(521pos[0], pos[1], pos[2], pos[3], random(126), random(126), (60*60));
            
GivePlayerMoney(playerid, -5000000);
            
vInfo[playerid][model] = 521;
        }
    }
    
SetVehicleVirtualWorld(vInfo[playerid][vehicle], GetPlayerVirtualWorld(playerid));
    
LinkVehicleToInterior(vInfo[playerid][vehicle], GetPlayerInterior(playerid));
    
PutPlayerInVehicle(playeridvInfo[playerid][vehicle], 0);
    
//..
    
return true;
}
#endif 
Reply
#2

where all :/
Reply
#3

Please Help Guys??
When im Login i See The Saving Text 0 :/
idk why ?
its Working To Write My Pos + Vehicles + interior id
but when im login again its not Appear cuz the text be 0 :/
Quote:

[Info vehicle]
model = 411
world = 0
interior = 0
angle = 0.000000
pos = 0.000000
pos:y = 0.000000
pos:z = 0.000000

see its Rest All Somthings When im Login idk Whyyyyyyyyyy!!!! Help +rep
Reply
#4

Heeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeelp Pleaseeeeeeeeeeeeeeeeeee
Reply
#5

oh my god why no one help me :/
Reply
#6

help me why when im login its be 0
the pos and interior and angel help please ?
+rep
Reply
#7

Stop fukking spamming, just wait till you get a reply..
Reply
#8

Quote:
Originally Posted by ******
Посмотреть сообщение
You can't have spaces in tags.
i made this
PHP код:
        vInfo[playerid][vehicle] = 0vInfo[playerid][model] = 0vInfo[playerid][world] = 0;
        
vInfo[playerid][x_] = 0.00vInfo[playerid][y_] = 0.00vInfo[playerid][z_] = 0.00
to this
PHP код:
        vInfo[playerid][vehicle] =0vInfo[playerid][model] =0vInfo[playerid][world] =0;
        
vInfo[playerid][x_] =0.00vInfo[playerid][y_] =0.00vInfo[playerid][z_] =0.00
not there space in numbers this right ? or what u mean ?? The Space ? Please Help man
Reply
#9

Bumb!!!
Reply
#10

Bumb
healp please
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)