Preskoči na sadržaj
Ista raja. Nova runda.
GAMERZ.ba — REBORN
Diskusija Zaključana

[TuT] Brzina igrača i vozila ( funkcija )

137 pregleda · 0 odgovora · otvorena 15.05.2013. u 18:32

4 funkcije su napravljene tako da ubrzavaju igraca ili vozilo, naprijed ili nazad.

stock BrzinaVozilaNazad(vid, Float:dis = -0.1)
{
new Float:T[4];
GetVehicleVelocity(vid, T[0], T[1], T[2]);
GetVehicleZAngle(vid, T[3]);
SetVehicleVelocity(vid,floatadd(T[0],floatmul(dis,floatsin(-T[3],degrees))), floatadd(T[1],floatmul(dis,floatcos(-T[3],degrees))), T[2]);
return 1;
}
stock BrzinaVozilaNaprijed(vid, Float:dis = 0.1)
{
new Float:T[4];
GetVehicleVelocity(vid, T[0], T[1], T[2]);
GetVehicleZAngle(vid, T[3]);
SetVehicleVelocity(vid,floatadd(T[0],floatmul(dis,floatsin(-T[3],degrees))), floatadd(T[1],floatmul(dis,floatcos(-T[3],degrees))), T[2]);
return 1;
}
stock BrzinaIgracaNazad(playerid, Float:dis = -0.4)
{
new Float:T[4];
GetPlayerVelocity(playerid, T[0], T[1], T[2]);
GetPlayerFacingAngle(playerid, T[3]);
SetPlayerVelocity(playerid,floatadd(T[0],floatmul(dis,floatsin(-T[3],degrees))), floatadd(T[1],floatmul(dis,floatcos(-T[3],degrees))), T[2]);
return 1;
}
stock BrzinaIgracaNaprijed(playerid, Float:dis = 0.4)
{
new Float:T[4];
GetPlayerVelocity(playerid, T[0], T[1], T[2]);
GetPlayerFacingAngle(playerid, T[3]);
SetPlayerVelocity(playerid,floatadd(T[0],floatmul(dis,floatsin(-T[3],degrees))), floatadd(T[1],floatmul(dis,floatcos(-T[3],degrees))), T[2]);
return 1;

Prijavi se da bi odgovorio/la na ovu temu.