DisableRemoteVehicleCollisions

From SA-MP Wiki

Jump to: navigation, search

DisableRemoteVehicleCollisions was added in SA-MP 0.3.7 This function was added in SA-MP 0.3.7 and will not work in earlier versions!


Description:

Disables collisions between occupied vehicles for a player.


Parameters:
(playerid, disable)
playeridThe ID of the player for whom you want to disable collisions.
disable1 to disable collisions, 0 to enable collisions.


Return Values:

  • 1: The function executed successfully.
  • 0: The function failed to execute. The player specified does not exist.


Example Usage:

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/collision", true))
    {
    	new string[64];
 
    	format(string, sizeof(string), "Vehicle collision for you is now '%s'", (GetPVarInt(playerid, "vehCollision") != 1) ? ("Disabled") : ("Enabled"));
    	SendClientMessage(playerid, 0xFFFFFFFF, string);
 
    	SetPVarInt(playerid, "vehCollision", !GetPVarInt(playerid, "vehCollision"));
 
    	DisableRemoteVehicleCollisions(playerid, GetPVarInt(playerid, "vehCollision"));
    	return 1;
    }
    return 0;
}
Personal tools
Navigation
Toolbox