28.11.2010, 10:12
Hmm, so like this?
and in the racescript:
Like this?
pawn Код:
new Antiboost[MAX_PLAYERS]
public OnPlayerConnect(playerid)
{
Antiboost[playerid] = 0;
//Rest of my GM lines
OnPlayerKeyStateChange
{
new Keys,up,down;
GetPlayerKeys(playerid,Keys,up,down);
new Float:x,Float:y,Float:z;
if (PRESSED(KEY_CROUCH)){
{
if(Antiboost[playerid] == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z);SetVehicleVelocity(GetPlayerVehicleID(playerid),x ,y ,z+0.3);}}}
and in the racescript:
pawn Код:
CallRemoteFunction("Antiboost","ii",playerid,1); //On top of the script
//Startrace cmd
CMD:startrace(playerid, params[])
{
if(AutomaticRace == true) return SendClientMessage(playerid, RED, "<!> Not possible. Automatic race is enabled!");
if(BuildRace != 0) return SendClientMessage(playerid, RED, "<!> There's someone building a race!");
if(RaceBusy == 0x01 || RaceStarted == 1) return SendClientMessage(playerid, RED, "<!> There's a race currently. Wait first till race ends!");
if(isnull(params)) return SendClientMessage(playerid, RED, "<!> /startrace [racename]");
Antiboost[playerid] = 0;
LoadRace(playerid, params);
return 1;
}
Like this?