Problem with the car system
#1

I built a Car Ownership System on my RP mode and while I compile the mode no error
but while I enter the game I got crash on the start

this is the system

Top of the mode
Код:
enum ocInfo
{
	ocOwner[64],
	ocVeh,
	Float:ocPosX,
	Float:ocPosY,
	Float:ocPosZ,
	Float:ocPosA,
	ocColor1,
	ocColor2,
	ocKey,
};
new OCarInfo[5][ocInfo];
new public
Код:
public LoadCars()
{
	new arrCoords[19][64];
	new strFromFile2[256];
	new File: file = fopen("OwnCars.cfg", io_read);
	if(file)
	{
		new idx;
		while (idx < sizeof(OCarInfo))
		{
			fread(file, strFromFile2);
			split(strFromFile2, arrCoords, '|');
			OCarInfo[idx][ocKey] = strval(arrCoords[0]);
			strmid(OCarInfo[idx][ocOwner], arrCoords[1], 0, strlen(arrCoords[1]), 255);
			OCarInfo[idx][ocVeh] = strval(arrCoords[2]);
			OCarInfo[idx][ocPosX] = floatstr(arrCoords[3]);
			OCarInfo[idx][ocPosY] = floatstr(arrCoords[4]);
			OCarInfo[idx][ocPosZ] = floatstr(arrCoords[5]);
			OCarInfo[idx][ocPosA] = floatstr(arrCoords[6]);
			OCarInfo[idx][ocColor1] = strval(arrCoords[7]);
			OCarInfo[idx][ocColor2] = strval(arrCoords[8]);
			idx++;
		}
		fclose(file);
	}
	return 1;
}
On the public "OnPlayerStateChange"
Код:
	if(newstate==PLAYER_STATE_DRIVER)
	{
		new PlayerName[100]; GetPlayerName(playerid,PlayerName,30);
		if(OCarInfo[vehicle][ocOwner] == 1)
		{
			format(string,sizeof(string),"[ Vehicle Owner: %s ]", OCarInfo[vehicle][ocOwner] );
 		 	SendClientMessage(playerid,0x7E5F2FFF,string);
		}
 	}
	if(newstate==PLAYER_STATE_PASSENGER)
	{
		if(OCarInfo[vehicle][ocOwner] == 1)
		{
		format(string,sizeof(string),"[ Vehicle Owner: %s ]", OCarInfo[vehicle][ocOwner] );
	  SendClientMessage(playerid,0x7E5F2FFF,string);
		}
	}
on "OnGameModeInit"
Код:
	for(new o =0; o<sizeof(OCarInfo); o++)
	{
		CreateVehicle(OCarInfo[o][ocVeh],OCarInfo[o][ocPosX],OCarInfo[o][ocPosY],OCarInfo[o][ocPosZ],OCarInfo[o][ocPosA],-1,-1,-1);
	}
Sorry about my English
Reply


Messages In This Thread
Problem with the car system - by Ro[X]y - 02.07.2009, 23:15
Re: Problem with the car system - by yezizhu - 03.07.2009, 00:14
Re: Problem with the car system - by Ro[X]y - 03.07.2009, 00:22
Re: Problem with the car system - by yezizhu - 03.07.2009, 00:31
Re: Problem with the car system - by Ro[X]y - 03.07.2009, 00:39
Re: Problem with the car system - by yezizhu - 03.07.2009, 00:54
Re: Problem with the car system - by Ro[X]y - 03.07.2009, 00:55
Re: Problem with the car system - by yezizhu - 03.07.2009, 01:04
Re: Problem with the car system - by Ro[X]y - 03.07.2009, 01:09
Re: Problem with the car system - by yezizhu - 03.07.2009, 02:05

Forum Jump:


Users browsing this thread: 2 Guest(s)