public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if(newkeys == KEY_SUBMISSION) { if(IsPlayerInAnyVehicle(playerid)) { { } } } if(newkeys & KEY_FIRE && IsPlayerInAnyVehicle(playerid)) { if(!IsNosVehicle(GetPlayerVehicleID(playerid))) return SendClientMessage(playerid, 0xFF0000AA, "You can't add Nitrous to this vehicle"); AddVehicleComponent(GetPlayerVehicleID(playerid), 1010); PlayerPlaySound(playerid, 1133 ,0, 0, 0); GameTextForPlayer(playerid,"~y~Nitro",4000,1); } // Check if the player is in any vehicle and is the driver if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
C:\Documents and Settings\Juan & Miguel\Desktop\Stunt Paradise 0.3a\gamemodes\SP.pwn(2318) : warning 217: loose indentation C:\Documents and Settings\Juan & Miguel\Desktop\Stunt Paradise 0.3a\gamemodes\SP.pwn(2326) : warning 217: loose indentation
if(IsPlayerInAnyVehicle(playerid)) { { } } }
#pragma tabsize 0
Originally Posted by Juanxz
Hey guys thanks for helping, Jeff's method worked.
|
Originally Posted by Juanxz
Are there any negative side effects from using #pragma?
|
} return 0; } #pragma tabsize 0 public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if(newkeys == KEY_SUBMISSION) { if(IsPlayerInAnyVehicle(playerid)) { { } } } if(newkeys & KEY_FIRE && IsPlayerInAnyVehicle(playerid)) { if(!IsNosVehicle(GetPlayerVehicleID(playerid))) return SendClientMessage(playerid, 0xFF0000AA, "You can't add Nitrous to this vehicle"); AddVehicleComponent(GetPlayerVehicleID(playerid), 1010); PlayerPlaySound(playerid, 1133 ,0, 0, 0); GameTextForPlayer(playerid,"~y~Nitro",4000,1); } // Check if the player is in any vehicle and is the driver if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { // Check for the HORN key (Crouch key is the same as the horn key) if (newkeys & KEY_CROUCH) { // Create variables new Float:vx, Float:vy, Float:vz; // Get the vehicles velocity GetVehicleVelocity(GetPlayerVehicleID(playerid), vx, vy, vz); // Check the values are not too high already if (floatabs(vx) < 3 && floatabs(vy) < 3 && floatabs(vz) < 3) { // Boost the vehicle speed SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * SpeedBoostMultiplier[playerid], vy * SpeedBoostMultiplier[playerid], vz * SpeedBoostMultiplier[playerid]); } // Exit here return 1; } } return 1; }