SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 01/04/2009, 01:04 AM   #1
CJ101
High-roller
 
CJ101's Avatar
 
Join Date: Jan 2008
Location: RevolutionX
Posts: 1,758
Reputation: 162
Default nos wont come out of the cars ass

Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if ((newkeys & (KEY_JUMP)) == (KEY_SPRINT))
	{
	new vehid = GetVehicleModel(playerid);
	if (!IsPlayerInInvalidNosVehicle(playerid,vehid))
		{
 		AddVehicleComponent(GetPlayerVehicleID(playerid),1010);
		}
	}

	return 1;
}
it wont add nos to the vehicle.
__________________
I have left SA-MP. Thanks for a great ten years.
CJ101 is offline  
Old 01/04/2009, 01:07 AM   #2
Kinetic
Huge Clucker
 
Join Date: Dec 2007
Posts: 264
Reputation: 0
Default Re: nos wont come out of the cars ass

im pretty sure your problem is this line

pawn Code:
if ((newkeys & (KEY_JUMP)) == (KEY_SPRINT))
Kinetic is offline  
Old 01/04/2009, 01:08 AM   #3
ReV.
Huge Clucker
 
ReV.'s Avatar
 
Join Date: Oct 2008
Posts: 385
Reputation: 26
Default Re: nos wont come out of the cars ass

Use one key either KEY_SUBMISSION or KEY_FIRE..
__________________
ReV. is offline  
Old 01/04/2009, 01:09 AM   #4
CJ101
High-roller
 
CJ101's Avatar
 
Join Date: Jan 2008
Location: RevolutionX
Posts: 1,758
Reputation: 162
Default Re: nos wont come out of the cars ass

+
__________________
I have left SA-MP. Thanks for a great ten years.
CJ101 is offline  
Old 01/04/2009, 01:36 AM   #5
CJ101
High-roller
 
CJ101's Avatar
 
Join Date: Jan 2008
Location: RevolutionX
Posts: 1,758
Reputation: 162
Default Re: nos wont come out of the cars ass

EDIIt:

Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  if (newkeys & KEY_FIRE)
	{
		new vehid = GetVehicleModel(playerid);
		if (!IsPlayerInInvalidNosVehicle(playerid,vehid))
		{
		AddVehicleComponent(vehid,1010);
		}

	}

	return 1;
}
still nothing
__________________
I have left SA-MP. Thanks for a great ten years.
CJ101 is offline  
Old 01/04/2009, 01:40 AM   #6
Pyrokid
Huge Clucker
 
Join Date: May 2006
Posts: 482
Reputation: 0
Default Re: nos wont come out of the cars ass

You're using GetVehicleModel when you're supposed to be using GetPlayerVehicleID.
Pyrokid is offline  
Old 01/04/2009, 02:22 AM   #7
Daren_Jacobson
Huge Clucker
 
Join Date: Jun 2008
Posts: 424
Reputation: 6
Default Re: nos wont come out of the cars ass


pawn Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  if (newkeys & KEY_FIRE)
    {
        new vehid = GetVehicleModel(playerid);
        if (!IsPlayerInInvalidNosVehicle(playerid,vehid))
        {
        AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
        }

    }

    return 1;
}
__________________
Daren_Jacobson is offline  
Old 01/04/2009, 02:41 AM   #8
Mikep
High-roller
 
Join Date: Apr 2008
Posts: 1,042
Reputation: 10
Default Re: nos wont come out of the cars ass

Ever heard of indentation?

pawn Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  if (newkeys & KEY_FIRE)
  {
    if(!IsPlayerInInvalidNosVehicle(playerid)) AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
  }
  return 1;
}
Mikep is offline  
Old 01/04/2009, 02:43 AM   #9
yezizhu
Gangsta
 
yezizhu's Avatar
 
Join Date: Nov 2007
Location: Shenzhen,China
Posts: 640
Reputation: 2
Default Re: nos wont come out of the cars ass

edit
new vehid = GetVehicleModel(playerid)
to
new vehid = GetPlayerVehicleID(playerid)

Notice it..Someone had shown the error^^
yezizhu is offline  
Old 01/04/2009, 02:45 AM   #10
Mikep
High-roller
 
Join Date: Apr 2008
Posts: 1,042
Reputation: 10
Default Re: nos wont come out of the cars ass

vehid isn't used so you can remove it and IsPlayerInInvalidNosVehicle only has a playerid param.

pawn Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  if (newkeys & KEY_FIRE)
  {
    if(!IsPlayerInInvalidNosVehicle(playerid)) AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
  }
  return 1;
}
Mikep is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tuned cars --after respawn--> normal cars Edna Krabapel Help Archive 8 31/01/2010 06:52 PM
Mapping Problem, Cars wont save? Rickzor14 Help Archive 4 10/12/2009 09:56 AM
Give all cars in OnGameModeInit Components (Tune all cars) RyDeR` Help Archive 4 05/10/2009 04:37 PM
LARP: Cars.cfg adding cars problem... Typhome Help Archive 7 06/07/2009 12:46 PM
my dealership cars cant be bought cause it says there cop cars... killar456 Help Archive 2 12/03/2009 03:26 PM


All times are GMT. The time now is 04:24 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.