17.02.2012, 14:23
hey guys,
i have downloaded this speedboost script and putted it in my gm so i can make it that it only works for the freeroam class but now i have a problem and i cant get it fixed.... i tried everything! but cant get it fixed...
when a player is freeroam class and is in a car and he presses LMB then he should get a boost but it isnt working...
this are my codes can pls someone help me?:
under ongamemodeinit
onplayerconnect:
under onplayerkeystatechange:
can anyone tell me whats wrong with this?
greets niels
i have downloaded this speedboost script and putted it in my gm so i can make it that it only works for the freeroam class but now i have a problem and i cant get it fixed.... i tried everything! but cant get it fixed...
when a player is freeroam class and is in a car and he presses LMB then he should get a boost but it isnt working...
this are my codes can pls someone help me?:
under ongamemodeinit
pawn Код:
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i) && !IsPlayerNPC(i))
{
SpeedBoostMultiplier[i] = 3.0;
}
}
pawn Код:
if(Teams[ playerid ] == FREEROAM)
{
SpeedBoostMultiplier[playerid] = 2.0;
}
pawn Код:
if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && (Teams[ playerid ] == FREEROAM))
{
if (newkeys & KEY_FIRE)
{
new Float:vx, Float:vy, Float:vz;
GetVehicleVelocity(GetPlayerVehicleID(playerid), vx, vy, vz);
if (floatabs(vx) < 3 && floatabs(vy) < 3 && floatabs(vz) < 3)
{
SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * SpeedBoostMultiplier[playerid], vy * SpeedBoostMultiplier[playerid], vz * SpeedBoostMultiplier[playerid]);
}
return 1;
}
}
greets niels