SA-MP Forums Archive
Problem with my nitro code - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem with my nitro code (/showthread.php?tid=156554)



Problem with my nitro code - Jay. - 23.06.2010

I've got some problems with my code it complies fine but doesn't work.

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(GetPlayerVehicleID(playerid) != 522)
{

}
else

if(IsPlayerInAnyVehicle(playerid))
{

if(newkeys & KEY_FIRE)
{
	//Car Jump//
	if(IsPlayerInAnyVehicle(playerid))
	AddVehicleComponent(GetPlayerVehicleID(playerid), 1010); // Nitro
	

}
return 1;
}

}
Its ment to stop the vehicle from installing nitro if its a bike.


But it doesn't even install nitro in the alowed vehicles no why?

Please reply,.

Thanks

Xtreme


Re: Problem with my nitro code - Kar - 23.06.2010

nvm...


Re: Problem with my nitro code - Jay. - 23.06.2010

Quote:
Originally Posted by Kar
nvm...
What, Why are you bumping my topic?

If you no the problem reply.

Thanks


Re: Problem with my nitro code - Kar - 23.06.2010

no i posted something but that would fail so i edited it




Re: Problem with my nitro code - Jay. - 23.06.2010

Quote:
Originally Posted by Kar
no i posted something but that would fail so i edited it

by i believe its R8 ever since i downloaded it when i do /acar it doesnt add my nitro:\
Umm ye..

I'm using 2.0x..




Re: Problem with my nitro code - (SF)Noobanatior - 23.06.2010

try this
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys){
	if(!IsPlayerInCar(playerid){
		if(newkeys & KEY_FIRE){
			AddVehicleComponent(GetPlayerVehicleID(playerid), 1010); // Nitro
		}
	}
	return 1;
}



stock IsPlayerInCar(playerid) {
	switch(GetVehicleModel(GetPlayerVehicleID(playerid))){
		case 	400,401,402,404,405,410,411,412,415,418,419,420,421,422,424,426,429,434,436,
				438,439,442,445,451,458,466,467,470,474,475,477,478,480,489,490,
				491,492,494,496,500,501,502,503,504,505,506,507,516,517,518,526,527,529,533,
				534,535,536,540,541,542,543,545,546,547,549,550,551,555,558,559,560,561,562,
				565,566,567,575,576,580,585,587,589,596,597,598,600,602,603,604,605:return 1;
	}
	return 0;
}