[y_ini / saving / vehicles] my problems with saving y_ini
#1

Hello EveryOne
i Want Help / Y_ini Saving The Vehicles
this my code its working with out y_ini saving :/
PHP код:
CMD:cars(playeridparams[])
{
    if(
sscanf(params"i"params[0]))
        return 
SendClientMessage(playerid, -1"usage: /cars [id 1-7].");
    switch(
params[0])
    {
        case 
1:
        {
            if(
GetPlayerMoney(playerid) < 1200000)
                return 
SendClientMessage(playerid0"You don't have enough cash to buy this car!");
            
GivePlayerMoney(playerid, -1200000);
            new 
Float:p[4];
            
GetPlayerPos(playeridp[0], p[1], p[2]);
            
GetPlayerFacingAngle(playeridp[3]);
            
CreateVehicle(541p[0], p[1], p[2], p[3]+90, -1, -19999999);
        }
        case 
2:
        {
            if(
GetPlayerMoney(playerid) < 1900000)
                return 
SendClientMessage(playerid0"You don't have enough cash to buy this car!");
            
GivePlayerMoney(playerid, -1900000);
            new 
Float:p[4];
            
GetPlayerPos(playeridp[0], p[1], p[2]);
            
GetPlayerFacingAngle(playeridp[3]);
            
CreateVehicle(411p[0], p[1], p[2], p[3]+90, -1, -19999999);
        }
        case 
3:
        {
            if(
GetPlayerMoney(playerid) < 4000000)
                return 
SendClientMessage(playerid0"You don't have enough cash to buy this car!");
            
GivePlayerMoney(playerid, -4000000);
            new 
Float:p[4];
            
GetPlayerPos(playeridp[0], p[1], p[2]);
            
GetPlayerFacingAngle(playeridp[3]);
            
CreateVehicle(494p[0], p[1], p[2], p[3]+90, -1, -19999999);
        }
        case 
4:
        {
            if(
GetPlayerMoney(playerid) < 22000)
                return 
SendClientMessage(playerid0"You don't have enough cash to buy this car!");
            
GivePlayerMoney(playerid, -22000);
            new 
Float:p[4];
            
GetPlayerPos(playeridp[0], p[1], p[2]);
            
GetPlayerFacingAngle(playeridp[3]);
            
CreateVehicle(409p[0], p[1], p[2], p[3]+90, -1, -19999999);
        }
        case 
5:
        {
            if(
GetPlayerMoney(playerid) < 460000)
                return 
SendClientMessage(playerid0"You don't have enough cash to buy this car!");
            
GivePlayerMoney(playerid, -460000);
            new 
Float:p[4];
            
GetPlayerPos(playeridp[0], p[1], p[2]);
            
GetPlayerFacingAngle(playeridp[3]);
            
CreateVehicle(560p[0], p[1], p[2], p[3]+90, -1, -19999999);
        }
        case 
6:
        {
            if(
GetPlayerMoney(playerid) < 600000)
                return 
SendClientMessage(playerid0"You don't have enough cash to buy this car!");
            
GivePlayerMoney(playerid, -600000);
            new 
Float:p[4];
            
GetPlayerPos(playeridp[0], p[1], p[2]);
            
GetPlayerFacingAngle(playeridp[3]);
            
CreateVehicle(506p[0], p[1], p[2], p[3]+90, -1, -19999999);
        }
        case 
7:
        {
            if(
GetPlayerMoney(playerid) < 5000000)
                return 
SendClientMessage(playerid0"You don't have enough cash to buy this car!");
            
GivePlayerMoney(playerid, -5000000);
            new 
Float:p[4];
            
GetPlayerPos(playeridp[0], p[1], p[2]);
            
GetPlayerFacingAngle(playeridp[3]);
            
CreateVehicle(521p[0], p[1], p[2], p[3]+90, -1, -19999999);
        }
    }
    return 
true;

now i want it saving with y_ini
PHP код:
#define CarPath "Cars/%s.ini"
enum PlayercInfo
{
     
PlayerName[20],
     
Car1Model,
     
Float:CarX1,
     
Float:CarY1,
     
Float:CarZ1,
     
Float:CarA1,
     
Car2Model,
     
Float:CarX2,
     
Float:CarY2,
     
Float:CarZ2,
     
Float:CarA2,
     
Car3Model,
     
Float:CarX3,
     
Float:CarY3,
     
Float:CarZ3,
     
Float:CarA3,
}
new 
cInfo[MAX_PLAYERS][PlayercInfo]; 
PHP код:
stock Path(playerid//Will create a new stock so we can easily use it later to load/save user's data in user's path
{
    new 
str[128],name[MAX_PLAYER_NAME];
    
GetPlayerName(playerid,name,sizeof(name));
    
format(str,sizeof(str),CarPath,name);
    return 
str;

can somone help me with complete the saving float car and vehicles id please ?
+rep
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 6 Guest(s)