[Consulta] Aumentar velocidad de nado. -
leaNN! - 17.02.2011
Hola gente!
Estoy haciendo un FS para un servidor, y estoy requiriendo de su ayuda...
Necesitaria aumentar la velocidad de los jugadores cuando nadan bajo el agua, y no se me ocurre una idea sobre como hacerlo.
Si alguien me pudiera dar una mano, o una idea, estaria mas que agradecido.
Re: [Consulta] Aumentar velocidad de nado. -
The_Moddler - 17.02.2011
Hay algunos skins que nadan mas rapidos que otros, cambiandole el skin seria tu solucion.. (otra no se.)
Respuesta: [Consulta] Aumentar velocidad de nado. -
leaNN! - 17.02.2011
Acabo de ver el SetPlayerVelocity, pero necesitaria saber como hacer que SetPlayerVelocity actue para adelante, creo que solo se puede para arriba, abajo, X e Y.
Re: [Consulta] Aumentar velocidad de nado. -
The_Moddler - 17.02.2011
A, si, puede ser, espera que hago algo.
Re: [Consulta] Aumentar velocidad de nado. -
admantis - 17.02.2011
X e Y son angulos horizontales. El que va hacia arriba es Z.
Re: [Consulta] Aumentar velocidad de nado. -
The_Moddler - 17.02.2011
pawn Код:
stock VelocidadNado(playerid, velocidad)
{
new Float: X, Float: Y, Float: Z, Float: ROT;
new Float: FX, Float: FY, Float: FZ;
GetPlayerVelocity(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, ROT);
FX = X+floatsin(-ROT, degrees)*velocidad;
FY = Y+floatcos(-ROT, degrees)*velocidad;
FZ = Z*velocidad;
SetPlayerVelocity(playerid, FX, FY, FZ);
return 1;
}
Funciona.
A velocidad ponele un nъmero, ya con 2 se acelera bastante, asi que usa decimales, por ejemplo, 0.8.
Respuesta: [Consulta] Aumentar velocidad de nado. -
leaNN! - 17.02.2011
Muchas gracias Moddler!
No se me hubiera ocurrido nunca.
Re: [Consulta] Aumentar velocidad de nado. -
MrDeath537 - 18.02.2011
Quote:
Originally Posted by The_Moddler
pawn Код:
stock VelocidadNado(playerid, velocidad) { new Float: X, Float: Y, Float: Z, Float: ROT; new Float: FX, Float: FY, Float: FZ; GetPlayerVelocity(playerid, X, Y, Z); GetPlayerFacingAngle(playerid, ROT); FX = X+floatsin(-ROT, degrees)*velocidad; FY = Y+floatcos(-ROT, degrees)*velocidad; FZ = Z*velocidad; SetPlayerVelocity(playerid, FX, FY, FZ); return 1; }
Funciona.
A velocidad ponele un nъmero, ya con 2 se acelera bastante, asi que usa decimales, por ejemplo, 0.8.
|
Los decimales darнan warning porque no pusiste "velocidad" como Float, agregale el tag
Respuesta: [Consulta] Aumentar velocidad de nado. -
leaNN! - 18.02.2011
Igual tengo un pequeсo problema.
Si quiero hacer que naden rapido para abajo, no lo hacen, probe varias cosas y no me funcionу.
Si me pudieran ayuadr con eso, agradeceria xD.
Re: [Consulta] Aumentar velocidad de nado. -
The_Moddler - 18.02.2011
Deberia funcionar..
pawn Код:
stock VelocidadNado(playerid, Float: velocidad)
{
new Float: X, Float: Y, Float: Z, Float: ROT;
new Float: FX, Float: FY, Float: FZ;
GetPlayerVelocity(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, ROT);
FX = X+floatsin(-ROT, degrees)*velocidad;
FY = Y+floatcos(-ROT, degrees)*velocidad;
FZ = (Z*velocidad)*2;
SetPlayerVelocity(playerid, FX, FY, FZ);
return 1;
}
Proba ahora, y gracias MrDeath por avisar.