Archived copy of war3source.com, the War3Source forum (2009–2020), rebuilt from the Internet Archive by wc3mods.net. This page was captured on 2012-10-25 (original capture). Forum · All archived topics · Wiki · Bug tracker · Blog
Chat

War3:Source
October 24, 2012, 07:20:40 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Download: http://war3source.com/index.php?board=9.0
What is War3Source?: http://war3source.com/index.php?topic=200.0
Sample Stats: http://war3source.com/war3stats
Steam Community Group: http://steamcommunity.com/groups/war3source
War3Source SVN Checkout: http://ownageclan.com/svn/war3source/
War3Source servers: http://www.game-monitor.com/search.php?vars=war3_version=
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [Russian]Помогите разобраться.  (Read 582 times)
alex0310
Full Member
***
Posts: 170



View Profile
« on: November 22, 2011, 11:21:34 AM »

Помогите разобраться, почему не работает данный код.
Code:
new m_vecBaseVelocity;
public OnPluginStart()
{

HookEvent("bomb_begindefuse",Bomb_Begindefuse);
m_vecBaseVelocity = FindSendPropOffs("CBasePlayer","m_vecBaseVelocity");

}

public Bomb_Begindefuse(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if(bIsActive[client])
{
new Float:velocity[3];
velocity[2]=200.0;
SetEntDataVector(client,m_vecBaseVelocity,velocity,true);
PrintHintText(client,"%T", "You can not defuse",client);
}
}
В результате выдает только сообщение, что бомбу разряжать не можешь, а процесс продолжается.. без всяких последствий.
Logged
Schmarotzer
Full Member
***
Posts: 189


Ich schmarotze dich!

258631507
View Profile WWW
« Reply #1 on: November 22, 2011, 02:30:32 PM »

Code:
public Bomb_Begindefuse(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if(bIsActive[client])
{
new Float:DefuserPos[3];
GetClientAbsOrigin(client,DefuserPos);
DefuserPos[2]+=60.0;
TeleportEntity(client,NULL_VECTOR,NULL_VECTOR,DefuserPos);
PrintHintText(client,"%T", "You can not defuse",client);
}
}
Logged

Welcome to my server
Frenzzy
Moderator
Full Member
*****
Posts: 217


337905984 frenzzy@live.ru
View Profile WWW
« Reply #2 on: November 22, 2011, 09:45:59 PM »

Quote
public Bomb_Begindefuse(Handle:event, const String:name[], bool:dontBroadcast)
{
   new client = GetClientOfUserId(GetEventInt(event, "userid"));
   if (bIsActive[client])
   {
      decl Float:origin[3], Float:velocity[3];
      GetClientAbsOrigin(client, origin);
      GetEntPropVector(client, Prop_Data, "m_vecAbsVelocity", velocity);
      origin[2] += 1.0; // Поднимаем игрока на один юнит над землей
      velocity[2] = 200.0; // И дает ему ускорение для полета в космос :o)
      TeleportEntity(client, origin, NULL_VECTOR, velocity);
      PrintHintText(client, "%t", "You can not defuse");
   }
}
Logged

O_o
nvn
Full Member
***
Posts: 133


View Profile
« Reply #3 on: November 22, 2011, 10:08:46 PM »

return Plugin_Handled; не решит задачу?
Logged

alex0310
Full Member
***
Posts: 170



View Profile
« Reply #4 on: November 23, 2011, 07:02:18 AM »

Спасибо, все варианты рабочие.
Но всё-таки на будущее, хочу понять как работает:
SetEntDataVector(client,m_vecBaseVelocity,velocity,true);
Logged
Frenzzy
Moderator
Full Member
*****
Posts: 217


337905984 frenzzy@live.ru
View Profile WWW
« Reply #5 on: November 23, 2011, 10:36:39 PM »

https://developer.valvesoftware.com/wiki/Velocity

SetEntDataVector()
Logged

O_o
alex0310
Full Member
***
Posts: 170



View Profile
« Reply #6 on: November 24, 2011, 11:13:50 AM »

Спасибо.
Logged
Arturius
Moderator
Full Member
*****
Posts: 155



View Profile Email
« Reply #7 on: December 17, 2011, 07:27:06 AM »

Чтобы не плодить кучу тем, решил спросить здесь. Не подскажите, как можно установить высоту взгляда? Суть, играя расой headcrab, выглядит весьма странно, когда смотришь с высоты нормального игрока. Кроме изменения углов взгляда, я что-то больше ничего не смог найти.
Logged
Schmarotzer
Full Member
***
Posts: 189


Ich schmarotze dich!

258631507
View Profile WWW
« Reply #8 on: December 17, 2011, 02:03:19 PM »

Чтобы не плодить кучу тем, решил спросить здесь. Не подскажите, как можно установить высоту взгляда? Суть, играя расой headcrab, выглядит весьма странно, когда смотришь с высоты нормального игрока. Кроме изменения углов взгляда, я что-то больше ничего не смог найти.
Больше чем уверен, что так сделать нельзя... Увы
Logged

Welcome to my server
Divix
Sr. Member
****
Posts: 280


View Profile Email
« Reply #9 on: December 19, 2011, 04:28:09 AM »

Чтобы не плодить кучу тем, решил спросить здесь. Не подскажите, как можно установить высоту взгляда? Суть, играя расой headcrab, выглядит весьма странно, когда смотришь с высоты нормального игрока. Кроме изменения углов взгляда, я что-то больше ничего не смог найти.
Больше чем уверен, что так сделать нельзя... Увы

На eventscript видел плагин: бросает шарик и при написании команды переводит на нее камеру, т.е. ты смотришь от лица шарика - или давно у меня, у краба иногда было как раз так как надо
Logged
Schmarotzer
Full Member
***
Posts: 189


Ich schmarotze dich!

258631507
View Profile WWW
« Reply #10 on: December 25, 2011, 03:56:27 PM »

ну так плагин в студию, а там посмотрим...
Logged

Welcome to my server
Divix
Sr. Member
****
Posts: 280


View Profile Email
« Reply #11 on: December 26, 2011, 09:49:13 AM »

ну так плагин в студию, а там посмотрим...

Могу и не найти плагин, но вот к примеру fun карты, на которых садишься и камера уходит не понятно куда ( mg_aircraftcarrier_v1).
Недавно проверил хедкраба с моделькой: если прыгнуть и приземлится на корточках, то камера спущена вниз и все очень хорошо (но до тех пор, пока не попробуешь присесть или прыгнуть еще раз). И разве у камеры нету значения parent или чего-то на подобие ?
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!