CreateExplosionForPlayer

warning

This function was added in SA-MP 0.3z R2-2 and will not work in earlier versions!

Description

Creates an explosion that is only visible to a single player. This can be used to isolate explosions from other players or to make them only appear in specific virtual worlds.

NameDescription
playeridThe ID of the player to create the explosion for.
Float:XThe X coordinate of the explosion.
Float:YThe Y coordinate of the explosion.
Float:ZThe Z coordinate of the explosion.
typeThe explosion type.
Float:RadiusThe radius of the explosion.

Returns

This function always returns 1, even if the function failed to excute (player doesn't exist, invalid radius, or invalid explosion type).

Examples

if (strcmp(cmdtext, "/burnme", true) == 0)
{
new Float: playerPos[3];
GetPlayerPos(playerid, playerPos[0], playerPos[1], playerPos[2]);
CreateExplosionForPlayer(playerid, playerPos[0], playerPos[1], playerPos[2], 1, 10.0);
return 1;
}

Notes

tip

There is a limit as to how many explosions can be seen at once by a player. This is roughly 10.

Related Functions