newskeys problem - 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)
+--- Thread: newskeys problem (
/showthread.php?tid=584299)
newskeys problem -
Karolukas123 - 03.08.2015
hey, i have some problem when i press N it dont work
}
if(newkeys & KEY_NO)
{
new Float: V_Pos[3]; GetVehiclePos(vehicleid, V_Pos[0], V_Pos[1], V_Pos[2]);
if(vehicleid != INVALID_VEHICLE_ID && IsPlayerInRangeOfPoint(playerid, 3.0, V_Pos[0], V_Pos[1], V_Pos[2]))
{
if(vehicleid >= kasecar[0] && vehicleid <= kasecar[4])
{
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
if(playerDB[playerid][Test] == 1)
{
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
RemovePlayerAttachedObject(playerid, 0);
SendClientMessage(playerid, -1, "Test");
playerDB[playerid][Test] = 0;
Re: newskeys problem -
b3nz - 03.08.2015
Show us how do you store the vehicleid variable.
Re: newskeys problem -
Marricio - 03.08.2015
Do some debugging in your code to find out where the problem is.
Re: newskeys problem -
Crayder - 03.08.2015
pawn Код:
if(newkeys & KEY_NO)
{
print("someone pressed n");
new Float: V_Pos[3]; GetVehiclePos(vehicleid, V_Pos[0], V_Pos[1], V_Pos[2]);
if(vehicleid != INVALID_VEHICLE_ID && IsPlayerInRangeOfPoint(playerid, 3.0, V_Pos[0], V_Pos[1], V_Pos[2]))
{
if(vehicleid >= kasecar[0] && vehicleid <= kasecar[4])
{
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
if(playerDB[playerid][Test] == 1)
{
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
RemovePlayerAttachedObject(playerid, 0);
SendClientMessage(playerid, -1, "Test");
playerDB[playerid][Test] = 0;
If "someone pressed n" is never printed to the console then whatever comes before your code is breaking it.