pawn Код:
stock CagePlayer(playerid)
{
if(IsPlayerConnected(playerid))
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
cage[playerid][0] = CreateDynamicObject(985, X, Y+4, Z, 0.0, 0.0, 0.0);
cage[playerid][1] = CreateDynamicObject(985, X+4, Y, Z, 0.0, 0.0, 90.0);
cage[playerid][2] = CreateDynamicObject(985, X-4, Y, Z, 0.0, 0.0, 270.0);
cage[playerid][3] = CreateDynamicObject(985, X, Y-4, Z, 0.0, 0.0, 180.0);
caged[playerid] = 1; // Use this in a /cage command to prevent being caged twice and causing the cage to be unremovable.
PlayerPlaySound(playerid, 1137, X, Y, Z);
}
}
stock UnCagePlayer(playerid)
{
cage[playerid][0] = DestroyDynamicObject(cage[playerid][0]);
cage[playerid][1] = DestroyDynamicObject(cage[playerid][1]);
cage[playerid][2] = DestroyDynamicObject(cage[playerid][2]);
cage[playerid][3] = DestroyDynamicObject(cage[playerid][3]);
caged[playerid] = 0;
}