verteich
Умник
Имеется система бумбокса, хочу чтобы когда игрок поставиший бумбокс выходил из радиуса 30, бумбокс пропадал (как на аризоне):
unreal. делал вариант для этой системы но не могу найти её(
PHP:
CMD:bumbox(playerid,listitem, params[])
{
if(PI[playerid][pBumbox] <= 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "[Îøèáêà]{FFFFFF} Ó âàñ íåò áóìáîêñà, êóïèòå ó Ïðîäàâöà àêñåññóàðîâ!");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_LIGHTRED,"[Îøèáêà] {FFFFFF}Âû íå ìîæåòå ïîñòàâèòü áóìáîêñ â àâòîìîáèëå!");
if(bumboxx[playerid])
{
if(!IsPlayerInRangeOfPoint(playerid, 3.0, BumBoxPos[playerid][0], BumBoxPos[playerid][1], BumBoxPos[playerid][2])) return SendClientMessage(playerid, COLOR_LIGHTRED, "[Îøèáêà] {ffffff}Âû ñëèøêîì äàëåêî îò áóìáîêñà!");
DestroyDynamicObject(bumboxx[playerid]);
bumboxx[playerid] = 0;
RadioID[playerid] = 0;
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(playerid,30.0, BumBoxPos[playerid][0], BumBoxPos[playerid][1], BumBoxPos[playerid][2])) StopAudioStreamForPlayerFix(i);
}
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 1, 0, 0, 0, 1);
GiveItem(playerid,2226);
DestroyDynamic3DTextLabel(b_box3D[playerid]);
return SendClientMessage(playerid, COLOR_LIGHTRED, "[Ïîäñêàçêà] {ffffff}Âû çàáðàëè ñâîé áóìáîêñ!");
}
else
{
for(new k; k<MAX_PLAYERS; k++)
{
if(bumboxx[k] == 0) continue;
if(IsPlayerInRangeOfPoint(playerid,30.0, BumBoxPos[k][0], BumBoxPos[k][1], BumBoxPos[k][2]))
{
return SendClientMessage(playerid, COLOR_LIGHTRED, "[Îøèáêà] {ffffff}Êòî-òî ïî áëèçîñòè óæå ïîñòàâèë áóìáîêñ!");
}
}
GetPlayerPos(playerid, BumBoxPos[playerid][0], BumBoxPos[playerid][1], BumBoxPos[playerid][2]);
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 1, 0, 0, 0, 1);
SendClientMessage(playerid, COLOR_LIGHTRED, "[Ïîäñêàçêà] {ffffff}Íàæìèòå ALT{FFFFFF}, ÷òîáû âêëþ÷èòü áóìáîêñ!");
SendClientMessage(playerid, COLOR_LIGHTRED, "[Ïîäñêàçêà] {ffffff}Ââåäèòå: /bumbox ÷òîáû çàáðàòü áóìáîêñ!");
SetPlayerChatBubble(playerid, "Ïîëîæèë áóìáîêñ íà çåìëþ", COLOR_PURPLE, 10.0, 5000);
BumBoxPos[playerid][0] +=1.0;
BumBoxPos[playerid][1] +=1.0;
BumBoxPos[playerid][2] -=1.0;
bumboxx[playerid] = CreateDynamicObject(2226, BumBoxPos[playerid][0], BumBoxPos[playerid][1], BumBoxPos[playerid][2], 0.0, 0.0, 0.0);
new string[20+MAX_PLAYER_NAME],
named[MAX_PLAYER_NAME];
GetPlayerName(playerid, named, sizeof(named));
format(string,sizeof(string), "Ïîñòàâèë: {FFFFFF}%s",named);
b_box3D[playerid] = CreateDynamic3DTextLabel(string,COLOR_GREEN,BumBoxPos[playerid][0], BumBoxPos[playerid][1], BumBoxPos[playerid][2],8.0,INVALID_PLAYER_ID,INVALID_PLAYER_ID,0,-1,-1,-1,5.0);
RemovePlayerAttachedObject(playerid, 5);
}
return 1;
}
