zazais
Специалист
Привет, как можно связать 2 команды в одну, Вот у меня магнитафон есть, хочу чтобы одной командой вставлялось, и убиралось
C++:
CMD:recorder(playerid, params[])
{
if(!GetPVarInt(playerid, "boomBox")) return SendClientMessage(playerid, -1, "У Вас нет магнитофона, купите его в 24/7");
if(GetPVarInt(playerid, "PlacedBB")) return SendClientMessage(playerid, -1, "Вы уже установили магнитофон.");
new Float:BBCoord[4];
GetPlayerPos(playerid, BBCoord[0], BBCoord[1], BBCoord[2]);
GetPlayerFacingAngle(playerid, BBCoord[3]);
SetPVarFloat(playerid, "BBX", BBCoord[0]);
SetPVarFloat(playerid, "BBY", BBCoord[1]);
SetPVarFloat(playerid, "BBZ", BBCoord[2]);
BBCoord[0] += (2 * floatsin(-BBCoord[3], degrees));
BBCoord[1] += (2 * floatcos(-BBCoord[3], degrees));
BBCoord[2] -= 1.0;
foreach(new i: Player)
{
if(!GetPVarType(i, "PlacedBB") || !IsPlayerInRangeOfPoint(playerid, 30.0, GetPVarFloat(i, "BBX"), GetPVarFloat(i, "BBY"), GetPVarFloat(i, "BBZ"))) continue;
return SendClientMessage(playerid, C_BLUE, "Магнитофон установлен на землю");
}
format(stringer1, sizeof(stringer1), "%s установил магнитофон", PlayerInfo[playerid][pNames]);
ProxDetector(playerid, 30.0, COLOR_PURPLE, stringer1);
SetPVarInt(playerid, "PlacedBB", CreateDynamicObject(2102, BBCoord[0], BBCoord[1], BBCoord[2], 0.0, 0.0, 0.0, .worldid = GetPlayerVirtualWorld(playerid), .interiorid = GetPlayerInterior(playerid)));
format(stringer, 128, "{ffd800}Магнитофон\n{ffffff}Установил: {41a5dd}%s[%i]", PlayerInfo[playerid][pNames], playerid);
SetPVarInt(playerid, "BBLabel", _:CreateDynamic3DTextLabel(stringer, -1, BBCoord[0], BBCoord[1], BBCoord[2]+0.6, 8, .worldid = GetPlayerVirtualWorld(playerid), .interiorid = GetPlayerInterior(playerid)));
SetPVarInt(playerid, "BBArea", CreateDynamicSphere(BBCoord[0], BBCoord[1], BBCoord[2], 15.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)));
SetPVarInt(playerid, "BBInt", GetPlayerInterior(playerid));
SetPVarInt(playerid, "BBVW", GetPlayerVirtualWorld(playerid));
FIXES_ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0);
FIXES_ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0);
return 1;
}
CMD:drecorder(playerid, params[])
{
if(!GetPVarInt(playerid, "PlacedBB")) return SendClientMessage(playerid, -1, "Вы не ставили магнитофон");
foreach(new i: Player)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea"))) StopStream(i);
}
DeletePVar(playerid, "BBArea");
DestroyDynamicObject(GetPVarInt(playerid, "PlacedBB"));
DestroyDynamic3DTextLabel(Text3D:GetPVarInt(playerid, "BBLabel"));
DeletePVar(playerid, "PlacedBB"); DeletePVar(playerid, "BBLabel");
DeletePVar(playerid, "BBX"); DeletePVar(playerid, "BBY"); DeletePVar(playerid, "BBZ");
DeletePVar(playerid, "BBInt");
DeletePVar(playerid, "BBVW");
DeletePVar(playerid, "BBStation");
SendClientMessage(playerid, -1, "Вы убрали магнитофон");
//DeletePVar(playerid,"boomBox");
return 1;
}
