PDA

View Full Version : OnPlayerKeyStateChange


JimmyNeonHD
22/03/2013, 11:00 AM
This problem i can't fix it

error 017: undefined symbol "newstate"

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)

{

if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{

if(newkeys & KEY_FIRE)
{



if(EnableBoast[playerid] == 1)
{
new Float:vx,Float:vy,Float:vz;
GetVehicleVelocity(GetPlayerVehicleID(playerid),vx ,vy,vz);
SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * 1.8, vy *1.8, vz * 1.8);
}
}
}


if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if (newkeys & KEY_CROUCH)
{

if(EnableBoast[playerid] == 1)
{
new Float:x, Float:y, Float:z;
GetVehicleVelocity(GetPlayerVehicleID(playerid),x, y,z);
SetVehicleVelocity(GetPlayerVehicleID(playerid),x, y,z+0.3);
}
}
}
return 1;
}

Scrillex
22/03/2013, 11:01 AM
new newstate; + show please line!

Anak
22/03/2013, 11:58 AM
Newstate undefined can you please show us line which contains errors?

Threshold
22/03/2013, 01:39 PM
You're confusing OnPlayerKeyStateChange with OnPlayerStateChange, just change the 'newstate' variable to 'newkeys' under the OnPlayerKeyStateChange callback.

Gamer_007
22/03/2013, 02:37 PM
newstate is in OnPlayerStateChange(playerid) and newkeys is in OnPlayerKeyStateChange.Dont be confused.Btw i dint find any newstate in ur code.On which line is the error showing?