13.03.2012, 20:44
pawn Код:
#include <a_samp>
#include <zcmd>
new speed[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
speed[playerid] = 0;
return 1;
}
public OnPlayerDisconnect(playerid)
{
speed[playerid] = 0;
return 1;
}
CMD:speedboost(playerid, params[])
{
if(speed[playerid] == 0) {
speed[playerid] = 1;
}
else
{
speed[playerid] = 0;
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(newkeys && KEY_SUBMISSION) {
if(speed[playerid] == 1) {
new Float:vx,Float:vy,Float:vz;
GetVehicleVelocity(GetPlayerVehicleID(playerid), vx, vy, vz);
SetVehicleVelocity(vehicleid, vx * 2, vy * 2, vz * 2);
return 1;
}
}
}
return 1;
}