[Pedido] Speed boost + car jump
#1

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 '-'
Reply
#2

Vocк consegue corrigir isso usando
PHP код:
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER
Reply
#3

Quote:
Originally Posted by RiqueP
Посмотреть сообщение
Vocк consegue corrigir isso usando
PHP код:
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER
ta dando error man
Reply
#4

Quote:
Originally Posted by iName
Посмотреть сообщение
ta dando error man
Mostre como vocк tentou, qual й erro?
Reply
#5

Quote:
Originally Posted by Ever_SH
Посмотреть сообщение
Mostre como vocк tentou, qual й erro?
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
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;
}
Reply
#6

poste os erros e as linhas dos erros
PHP код:
if(newkeys KEY_FIRE && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
     if(
VehicleBoost[playerid])
     {
        new 
Floatvx,Floatvy,Floatvz;

        
GetVehicleVelocity(GetPlayerVehicleID(playerid),vx ,vy,vz);
        
SetVehicleVelocity(GetPlayerVehicleID(playerid), vx 1.8vy *1.8vz 1.8);
    }
}
if(
newkeys KEY_CROUCH && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
    new 
FloatxFloatyFloatz;

    
GetVehicleVelocity(GetPlayerVehicleID(playerid),xy,z);
    
SetVehicleVelocity(GetPlayerVehicleID(playerid),xy,z+0.3);

Reply
#7

Nгo testei ve se pega ai!
PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
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.8vy *1.8vz 1.;
        }
    }
    if(
GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
    {
        if (
newkeys KEY_CROUCH)
        {
            new 
FloatFloat:yFloat:z;
            
GetVehicleVelocity(GetPlayerVehicleID(playerid),xy,z);
            
SetVehicleVelocity(GetPlayerVehicleID(playerid),xy,z+0.3);
        }
    }
}
return 
1;

Reply
#8

Quote:
Originally Posted by RedMF
Посмотреть сообщение
Nгo testei ve se pega ai!
PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
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.8vy *1.8vz 1.;
        }
    }
    if(
GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
    {
        if (
newkeys KEY_CROUCH)
        {
            new 
FloatFloat:yFloat:z;
            
GetVehicleVelocity(GetPlayerVehicleID(playerid),xy,z);
            
SetVehicleVelocity(GetPlayerVehicleID(playerid),xy,z+0.3);
        }
    }
}
return 
1;

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.
Reply
#9

Quote:
Originally Posted by iName
Посмотреть сообщение
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.
Esse erro ai nгo sгo do sistema de speed bost e outra coisa cara
so o VehicleBoost que й
Reply
#10

Desculpe duble post
Mais acho que tu nгo definiu isso usa assim

PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
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.8vy *1.8vz 1.0);
    }
    if(
GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
    {
        if (
newkeys KEY_CROUCH)
        {
            new 
Float:xFloat:yFloat:z;
            
GetVehicleVelocity(GetPlayerVehicleID(playerid),xy,z);
            
SetVehicleVelocity(GetPlayerVehicleID(playerid),xy,z+0.3);
        }
    }
}
return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)