if((newkeys & 2048) && !(oldkeys & 2048)) //thats the special/turret up button, for motorbike bunnyhop
{
new vehicleid = GetPlayerVehicleID(playerid);
new modelid = GetVehicleModel(vehicleid);
if((modelid == 521) || (modelid == 522) || (modelid == 448) || (modelid == 523) || (modelid == 586) || (modelid == 581) || (modelid == 468) || (modelid == 463) || (modelid == 432) || (modelid == 431) || (modelid == 462))
{
new Float:posx, Float:posy, Float:posz;
GetPlayerPos(playerid,posx,posy,posz);
new Float:debugZ = MapAndreas_FindZ_For2DCoord(posx,posy,posz);//debug
printf("Current Pos: %f X, %f Y, %f Z",posx,posy,posz);//debug
printf("Map andreas co ord: %f Z",debugZ);//debug
if(MapAndreas_FindZ_For2DCoord(posx,posy,posz) == posz)
{
new Float:x, Float:y, Float:z;
GetVehicleVelocity(vehicleid,x,y,z);
SetVehicleVelocity(vehicleid,x,y,z+0.2);
return 1;
}
return 1;
}
}
public OnPlayerSpawn(playerid) { SetPlayerColor(playerid, 0xC9C9C9); return 1; }
new Float:debugZ = MapAndreas_FindZ_For2DCoord(posx,posy,posz);
new Float:debugZ;
MapAndreas_FindZ_For2DCoord(posx, posy, debugZ);
if((newkeys & 2048) && !(oldkeys & 2048)) //thats the special/turret up button, for motorbike bunnyhop
{
new vehicleid = GetPlayerVehicleID(playerid),
modelid = GetVehicleModel(vehicleid);
if((modelid == 521) || (modelid == 522) || (modelid == 448) || (modelid == 523) || (modelid == 586) || (modelid == 581) || (modelid == 468) || (modelid == 463) || (modelid == 432) || (modelid == 431) || (modelid == 462))
{
new Float:posx, Float:posy, Float:posz, Float:debugZ;
GetPlayerPos(playerid, posx, posy, posz);
MapAndreas_FindZ_For2DCoord(posx, posy, debugZ);//debug
printf("posx = %f posy = %f, posz = %f, debugZ = %f", posx, posy, posz, debugZ);//debug
if(floatround(debugZ) == floatround(posz))
{
GetVehicleVelocity(vehicleid, posx, posy, posz);
SetVehicleVelocity(vehicleid, posx, posy, (posz + 0.2));
}
return 1;
}
}
Originally Posted by Rattertouille
I see that you've fixed this but if it does happen again try:
Код:
public OnPlayerSpawn(playerid) { SetPlayerColor(playerid, 0xC9C9C9); return 1; } |