Help About something important
#1

hello Folks i added a systeme but i dont know why it making me this bug check

CODE
Код:
    else if(newkeys == KEY_SECONDARY_ATTACK)
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            if(gEngine[playerid] == 0 && engineOn[newcar] == 0)
            {
				RemovePlayerFromVehicle(playerid);
				TogglePlayerControllable(playerid, 1);
				return 1;
            }
            else if(NoFuel[playerid] == 1)
			{
			    TogglePlayerControllable(playerid, 1);
				RemovePlayerFromVehicle(playerid);
				NoFuel[playerid] = 0;
				return 1;
			}
        }
    }
    return 1;
}
    if (newkeys == KEY_FIRE && GetPlayerWeapon(playerid) == 41)
	{
		SetTimerEx("OnPlayerSpray",2000,0,"d",playerid);
	}
	return 0;
}
Screen
Reply
#2

Because you return twice in the same declaration. Delete the " } " and return 1; above

if (newkeys == KEY_FIRE && GetPlayerWeapon(playerid) == 41)
Reply
#3

Try a bitwise check on the variable "keys" otherwise if you press multiple buttons, so the check will fail.

pawn Код:
if(keys & KEY_SECONDARY_ATTACK)
{
//...
}
Reply
#4

Oh yea didnt saw it fixed The first bug but the 2snt one arnt fixed you Look the Code

stock PlayerToPoint(playerid,Float:radi, Floatx, Floaty, Floatz)
{
if(IsPlayerConnected(playerid))
{
new Float, Float:y, Float:z;
new Floatx, Floaty, Floatz;
GetPlayerPos(playerid, ox, oy, oz);
x = (ox -px);
y = (oy -py);
z = (oz -pz);
if (((x < radi) && (x > -radi)) && ((y < radi) && (y > -radi)) && ((z < radi) && (z > -radi))) return 1;
}
return 0;
}

Bug Screen

Reply
#5

PlayerToPlayer function is already called somewhere. It might be the same as you show us here. Just try to remove or comment " /* and */ " the function then re-compile.
Reply
#6

PlayerToPoint is already defined.
Check all of your forwards/publics

By the way there are already function for this check
pawn Код:
IsPlayerInRangeOfPoint(playerid, Float:range, Float:X, Float:Y, Float:Z)
or if you need the range especially
pawn Код:
GetPlayerDistanceFromPoint(playerid, Float:X, Float:Y, Float:Z)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)