speedboost with class problem... -
niels44 - 17.02.2012
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
pawn Код:
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i) && !IsPlayerNPC(i))
{
SpeedBoostMultiplier[i] = 3.0;
}
}
onplayerconnect:
pawn Код:
if(Teams[ playerid ] == FREEROAM)
{
SpeedBoostMultiplier[playerid] = 2.0;
}
under onplayerkeystatechange:
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;
}
}
can anyone tell me whats wrong with this?
greets niels
Re: speedboost with class problem... -
niels44 - 19.02.2012
come on no one? pls can anyone help?!
Re: speedboost with class problem... -
aRoach - 19.02.2012
Under OnGameModeInit:
pawn Код:
for( new slots = GetMaxPlayers( ), i; i < slots; i ++ )
{
if( IsPlayerConnected( i ) && !IsPlayerNPC( i ) )
{
SpeedBoostMultiplier[ i ] = 3.0;
}
}
Under OnPlayerKeyStateChange:
pawn Код:
if( newkeys & KEY_FIRE )
{
new Float:vx, Float:vy, Float:vz;
if( Teams[ playerid ] != FREEROAM ) break;
if( !IsPlayerInAnyVehicle( playerid ) ) break;
if( GetPlayerState( playerid ) != PLAYER_STATE_DRIVER ) break;
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;
}
Re: speedboost with class problem... -
niels44 - 19.02.2012
?? this errors:
pawn Код:
D:\Program Files\[0.3d]my own drifting gamemode\gamemodes\TorettoRacing1.pwn(16501) : error 024: "break" or "continue" is out of context
D:\Program Files\[0.3d]my own drifting gamemode\gamemodes\TorettoRacing1.pwn(16502) : error 024: "break" or "continue" is out of context
D:\Program Files\[0.3d]my own drifting gamemode\gamemodes\TorettoRacing1.pwn(16503) : error 024: "break" or "continue" is out of context
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
3 Errors.
Re: speedboost with class problem... -
aRoach - 19.02.2012
Change break to '
return 0;'
Re: speedboost with class problem... -
niels44 - 19.02.2012
okay
yeah no errors
now testing
EDIT:
not working the speedboost is still not working... i dont get any boost
pls help and now also the vehicle jump doesnt works anymore?
EDIT: wait i found the old one XD i discovered i didnt removed the old one XD wait retrying....
EDIT: nopes still NOT working
anyone knows how to fix this?
Re: speedboost with class problem... -
niels44 - 20.02.2012
lol somehow i changed some things now XD but it works! anyways thnx