12.10.2016, 14:37
alguem tem o codigo do speed boost e car jump sem bug? pois, oque eu tenho tem um bug, a pessoa que ta de carona consegue fazer o carro voar e usar speed boost '-'
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
if(newkeys & KEY_FIRE && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(VehicleBoost[playerid])
{
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(newkeys & KEY_CROUCH && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new Float: x, Float: y, Float: z;
GetVehicleVelocity(GetPlayerVehicleID(playerid),x, y,z);
SetVehicleVelocity(GetPlayerVehicleID(playerid),x, y,z+0.3);
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && GetPlayerState(playerid) != PLAYER_STATE_PASSENGER)
{
if(newkeys & KEY_FIRE)
{
if(VehicleBoost[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.;
}
}
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
{
if (newkeys & KEY_CROUCH)
{
new Float, Float:y, Float:z;
GetVehicleVelocity(GetPlayerVehicleID(playerid),x, y,z);
SetVehicleVelocity(GetPlayerVehicleID(playerid),x, y,z+0.3);
}
}
}
return 1;
}
Nгo testei ve se pega ai!
PHP код:
|
deu error
C:\Users\SONNYBR\Desktop\edit\gamemodes\gm.pwn(461 ) : warning 203: symbol is never used: "creditos" C:\Users\SONNYBR\Desktop\edit\gamemodes\gm.pwn(511 ) : warning 225: unreachable code C:\Users\SONNYBR\Desktop\edit\gamemodes\gm.pwn(578 ) : warning 225: unreachable code C:\Users\SONNYBR\Desktop\edit\gamemodes\gm.pwn(661 ) : error 017: undefined symbol "VehicleBoost" C:\Users\SONNYBR\Desktop\edit\gamemodes\gm.pwn(661 ) : warning 215: expression has no effect C:\Users\SONNYBR\Desktop\edit\gamemodes\gm.pwn(661 ) : error 001: expected token: ";", but found "]" C:\Users\SONNYBR\Desktop\edit\gamemodes\gm.pwn(661 ) : error 029: invalid expression, assumed zero C:\Users\SONNYBR\Desktop\edit\gamemodes\gm.pwn(661 ) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. |
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && GetPlayerState(playerid) != PLAYER_STATE_PASSENGER)
{
if(newkeys & KEY_FIRE)
{
new Float:vx,Float:vy,Float:vz;
GetVehicleVelocity(GetPlayerVehicleID(playerid),vx ,vy,vz);
SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * 1.8, vy *1.8, vz * 1.0);
}
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
{
if (newkeys & KEY_CROUCH)
{
new Float:x, Float:y, Float:z;
GetVehicleVelocity(GetPlayerVehicleID(playerid),x, y,z);
SetVehicleVelocity(GetPlayerVehicleID(playerid),x, y,z+0.3);
}
}
}
return 1;
}