Problem with my nitro code
#1

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
Reply
#2

nvm...
Reply
#3

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

If you no the problem reply.

Thanks
Reply
#4

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

Reply
#5

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..

Reply
#6

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)