INI YSI loading of vehicle is not working
#1

I made a system to create and store vehicle in each file more'm having trouble operating the load it when you open the server.
This Part is working very good
Код:
CMD:buycar(playerid, params[])
{
	new Model;
    if (sscanf(params, "dd", Model))
    {
        SendClientMessage( playerid,-1,"{FFFFFF}/buycar [Model]");
    }
	new count = 0;
	while(count >= 0)
	{
	    new dir[56] = "/Orgs/OrgFBI/Cars/.ini";
	    new count_string[32];
	    valstr(count_string, count);
	    strins(dir, count_string, 20);
		if(!fexist(dir))
		{
		        new Float:x, Float:y, Float:z,Float:Angle;
			GetPlayerFacingAngle(playerid, Angle);
	     	        GetPlayerPos(playerid, x, y, z);
			new INI:ini = INI_Open(dir);
			INI_WriteFloat(ini,"Cordx",x);
			INI_WriteFloat(ini,"Cordy",y);
			INI_WriteFloat(ini,"Cordz",z);
			INI_WriteFloat(ini,"Angle",Angle);
			INI_WriteInt(ini, "Model", Model);
			INI_Close(ini);
			break;
		}
		count++;
	}
	return 1;
}
but here is not working.
Код:
#define MAX_CARORG (10)
forward LoadCars();

enum cInfoOrg
{
	CarModel,
	CarCordx,
	CarCordy,
	CarCordz,
	CarAnggle,
}
new CarInfoOrg[MAX_CARORG][cInfoOrg];
OnGameModeInit()
Код:
       
        LoadCars();
 	new count = 0;
	while(count >= 0)
	{
	    new dir[56] = "/Orgs/OrgFBI/Cars/.ini";
	    new count_string[32];
	    valstr(count_string, count);
	    strins(dir, count_string, 20);
		if(fexist(dir))
		{
			new INI:ini = INI_Open(dir);
   			CarInfoOrg[CarCordx] = INI_Float(ini,"Cordx");
			CarInfoOrg[CarCordy] =	INI_Float(ini,"Cordy");
			CarInfoOrg[CarCordz] =	INI_Float(ini,"Cordz");
			CarInfoOrg[CarAngle] =	INI_Float(ini,"Angle");
			CarInfoOrg[CarModel] =	INI_Int(ini, "Modelo");
			AddStaticVehicleEx(CarInfoOrg[dir][CarCordx],CarInfoOrg[dir][CarCordy],CarInfoOrg[dir][CarCordz],CarInfoOrg[dir][CarAngle],CarInfoOrg[dir][CarModel],60000);
			INI_Close(ini);
		}
		count++;
	}
Код:
public LoadCars();
{
	new count = 0;
	while(count >= 0)
	{
	    new dir[56] = "/Orgs/OrgFBI/Cars/.ini";
	    new count_string[32];
	    valstr(count_string, count);
	    strins(dir, count_string, 20);
	    INI_Load(dir);
		new INI:ini = INI_Open(dir);
   		CarInfoOrg[CarCordx] = INI_Float(ini,"Cordx");
		CarInfoOrg[CarCordy] = INI_Float(ini,"Cordy");
		CarInfoOrg[CarCordz] = INI_Float(ini,"Cordz");
		CarInfoOrg[CarAngle] = INI_Float(ini,"Angle");
		CarInfoOrg[CarModel] = INI_Int(ini, "Model");
		INI_Close(ini);
		count++;
	}
	return 1;
}
Reply
#2

Hello!

First you have forgot the Float:-Tag before CarCordx,CarCordy,CarCordz,CarAnggle.

It have to look like this:
PHP код:
#define MAX_CARORG (10)
forward LoadCars();
enum cInfoOrg
{
    
CarModel,
    
Float:CarCordx,
    
Float:CarCordy,
    
Float:CarCordz,
    
Float:CarAnggle
};
new 
CarInfoOrg[MAX_CARORG][cInfoOrg]; 
Mencent
Reply
#3

i change but i dont understand my compilator when i used all this functions is stopping work
Reply
#4

Perhaps you download the crashdetect Plugin. It could help us for help.
Try this!

Mencent
Reply
#5

But the compilator stop work when he is making the .amx
Reply
#6

my friend make the cmd and i changed for make a load of this. He has looked your tutorial.
when i tried to make the cmd I was confused when making the loop and i called my friend for help me .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)