Problem with PLAYER_STATE_DRIVER
#1

Hello,

i have a big problem with PLAYER_STATE_DRIVER.

When im testing it local, it would work perfectly. But when i test it on my root-linux server, it wont work. Why?
Did anybody have such a problem?

Here is a code for example, that works on my local server, but not on my root server (the first code under PLAYER_STATE_DRIVER works without problems):

Код:
	if(newstate == PLAYER_STATE_DRIVER) //buggy dont finnish
	{
		new newcar = GetPlayerVehicleID(playerid);
		if(IsARentableBike(newcar))
		{
	   		print("IsARentableBike");
			if(saveBikeCarID[playerid] != newcar)
			{
			   	GetVehicleParamsEx(newcar,engine,light,alarm,doors,bonnet,boot,objective2);
		  		SetVehicleParamsEx(newcar,VEHICLE_PARAMS_OFF,light,alarm,doors,bonnet,boot,objective2);
				canStartEngine[playerid] = 1;
				SendClientMessage(playerid,COLOR_YELLOW,"You can rent this bike, type /rentcar!");
				return 1;
			}
			else
			{
			   	GetVehicleParamsEx(newcar,engine,light,alarm,doors,bonnet,boot,objective2);
		  		SetVehicleParamsEx(newcar,VEHICLE_PARAMS_ON,light,alarm,doors,bonnet,boot,objective2);
			}
		}
		if(IsARentablePlane(newcar))
		{
	   		print("IsARentablePlane");
			if(saveCarCarID[playerid] != newcar)
			{
			   	GetVehicleParamsEx(newcar,engine,light,alarm,doors,bonnet,boot,objective2);
		  										SetVehicleParamsEx(newcar,VEHICLE_PARAMS_OFF,light,alarm,doors,bonnet,boot,objective2);
				canStartEngine[playerid] = 1;
				SendClientMessage(playerid,COLOR_YELLOW,"You can rent this plane, type /rentcar!");
				return 1;
			}
			else
			{
			   	GetVehicleParamsEx(newcar,engine,light,alarm,doors,bonnet,boot,objective2);
		  		SetVehicleParamsEx(newcar,VEHICLE_PARAMS_ON,light,alarm,doors,bonnet,boot,objective2);
			}
		}
	}
public IsARentableBike(carid) looks like:

Код:
public IsARentableBike(carid)
{
	for(new i = 0; i < sizeof(RentBikes); i++)
	{
	    if(carid == RentBikes[i]) return 1;
	}
	return 0;
}
Reply
#2

Did you upload the new script?
Reply
#3

What exactly doesn't work? And what do you mean by "the first code under PLAYER_STATE_DRIVER" ?
Reply
#4

Yes, i upload the newest one (amx).

Quote:

What exactly doesn't work? And what do you mean by "the first code under PLAYER_STATE_DRIVER" ?

The first code (the carshop) works fine, even if I put it as the last under if(newstate == PLAYER_STATE_DRIVER).

But the only problem is that the script does not recognize the "IsARentableBike(newcar)" (as I wrote it in the first post).

Local it works without any problems, on the root server it will not recognize. :S

Whats wrong with it? Thanks for your help! =) (and sorry for my bad english)
Reply
#5

public IsARentableBike(carid)



try

public IsaRentableBike(carid)



not a capital A
Reply
#6

ok, ill try it thanks. but i think it won't help... :S

more ideas so far? :S
Reply
#7

Show how you set the values of 'RentBikes' array.
Reply
#8

On the top as
Код:
new RentBikes[17];
under ongamemodeinit:

Код:
	//Los Santos
	RentBikes[0] = AddStaticVehicleEx(481,2883.59997559,-1785.30004883,13.19999981,0.00000000,33,1,1000); //BMX
	RentBikes[1] = AddStaticVehicleEx(462,2883.69995117,-1869.59997559,13.19999981,0.00000000,-1,-1,1000); //Faggio
	RentBikes[2] = AddStaticVehicleEx(462,2883.40002441,-1869.59997559,13.19999981,0.00000000,-1,-1,1000); //Faggio
	RentBikes[3] = AddStaticVehicleEx(462,2883.80004883,-1869.59997559,13.19999981,0.00000000,-1,-1,1000); //Faggio
	RentBikes[4] = AddStaticVehicleEx(462,2883.40002441,-1869.59997559,13.19999981,0.00000000,-1,-1,1000); //Faggio
	RentBikes[5] = AddStaticVehicleEx(481,2883.90002441,-1884.30004883,13.19999981,90.00000000,33,1,1000); //BMX
	RentBikes[6] = AddStaticVehicleEx(481,2883.90002441,-1882.09997559,13.19999981,90.00000000,33,1,1000); //BMX
	RentBikes[7] = AddStaticVehicleEx(481,2883.90002441,-1880.00000000,13.19999981,90.00000000,33,1,1000); //BMX
	RentBikes[8] = AddStaticVehicleEx(481,2883.90002441,-1877.69995117,13.19999981,90.00000000,33,1,1000); //BMX
	RentBikes[9] = AddStaticVehicleEx(481,2883.90002441,-1875.30004883,13.19999981,90.00000000,33,1,1000); //BMX
	//San Fierro
	RentBikes[10] = AddStaticVehicleEx(481,-2213.59997559,111.59999847,27.29999924,110.00000000,27,1,1000); //BMX
	RentBikes[11] = AddStaticVehicleEx(481,-2213.59997559,113.69999695,27.29999924,110.00000000,27,1,1000); //BMX
	RentBikes[12] = AddStaticVehicleEx(481,-2381.59997559,115.69999695,27.29999924,109.99511719,27,1,1000); //BMX
	RentBikes[13] = AddStaticVehicleEx(481,-2381.59997559,117.80000305,27.29999924,109.99511719,27,1,1000); //BMX
	RentBikes[14] = AddStaticVehicleEx(481,-2381.59997559,119.90000153,27.29999924,109.99511719,27,1,1000); //BMX
	RentBikes[15] = AddStaticVehicleEx(481,-2381.59997559,122.09999847,27.29999924,109.99511719,27,1,1000); //BMX
	RentBikes[16] = AddStaticVehicleEx(481,-2381.59997559,124.40000153,27.29999924,109.99511719,27,1,1000); //BMX
thanks for help
Reply
#9

24h push. :S I still need help :- (
Reply
#10

and another push.. i'm sorry but the bug stil exist.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)