23.03.2013, 16:49
I have this little fs for vehicle speed boost and no matter what I changed, didnt make the boost to be default.
pawn Код:
#include <a_samp>
new bool: EnableBoost[MAX_PLAYERS];
public OnFilterScriptInit()
{
print(" Loaded successful.");
return 1;
}
public OnPlayerConnect(playerid)
{
EnableBoost[playerid] = true;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/Boost", true)==0)
{
if(EnableBoost[playerid]==true)
{
EnableBoost[playerid] = false;
SendClientMessage(playerid, 0x924161FF, "[ ! ] Boost Deactivated.");
}
else
{
EnableBoost[playerid] = true;
SendClientMessage(playerid, 0x924161FF, "[ ! ] Boost Activated.");
}
return 1;
}
return 0;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (IsPlayerInAnyVehicle(playerid) || GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(newkeys & KEY_FIRE)
{
if(EnableBoost[playerid] == true)
{
new Float:vx,Float:vy,Float:vz;
GetVehicleVelocity(GetPlayerVehicleID(playerid),vx,vy,vz);
SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * 1.3, vy *1.3, vz * 1.3);
}
}
}
return 0;
}