One of the problems is here (and it's in every IsPlayerOn-vehicle function):
pawn Код:
stock IsPlayerOnBike(playerid)
{
if(!IsPlayerInAnyVehicle(playerid)) return false;
new
Bikes[12]=
{ 581,509,481,421,462,510,463,522,461,448,586,468 },
vehicleid=GetPlayerVehicleID(playerid);
for(new i = 0; i < 12; i++)
{
if(GetVehicleModel(vehicleid) == Bikes[i])
{ return true; } else return false;
}
}
It will only check if the player model is equal to the first model in the array, then it quits the function. Please, don't release stuff you haven't tested. It bothers me a lot when people do this. Someone could be struggling for days to find out why his script doesn't work, until he discovers out it's your script that is the actual problem. That's very annoying! That guy trusted you to delivered functions that actually work!
Also, in addition to what Pottus suggested, this would even be better:
pawn Код:
stock IsPlayerOnBike(playerid)
{
new veh = GetPlayerVehicleID(playerid);
if (veh)
{
switch (GetVehicleModel(veh))
{
case 581, 509, 481, 421, 462, 510, 463, 522, 461, 448, 586, 468: return true;
}
}
return false;
}
This way you only call two functions, instead of three in Pottus' version. Besides that, it looks much cleaner and avoids repetitive code.