Half-Life и Adrenaline Gamer форум http://aghl.ru/forum/ |
|
set weapon ammo icon ? http://aghl.ru/forum/viewtopic.php?f=12&t=2517 |
Страница 2 из 3 |
Автор: | abdobiskra [ 17 авг 2016, 01:33 ] |
Заголовок сообщения: | Re: set weapon ammo icon ? |
i found this : Код: stock create_death_msg(id,victim,headshot,weapon_name[])and this : Код: public plugin_init()ant this : https://forums.alliedmods.net/showpost. ... ostcount=7 idk what is the true one can any one explaind this pleas ? |
Автор: | Lev [ 17 авг 2016, 02:43 ] |
Заголовок сообщения: | Re: set weapon ammo icon ? |
All of this basically correct. There is a DeathMsg message. Game dll sends it to client dll so client can show the death list in on the screen (right upper corner by default). Weapon name is a stripped version, i.e. instead of "weapon_crowbar" the string will contain just "crowbar". The game dll on the client will prepend "d_" before it and lookup for the death sprite in .txt files in sprites folder (hud.txt in common and weapon specific file in BugfixedHL). You can simulate this - send message on your own wish (first code). Intercept game dll sent message and change it as you wish (second code and the link). In HL btw, there is no "headshot" data in this message. So it consist of:
arg(2) - byte - victim arg(3) - string - weapon name |
Автор: | abdobiskra [ 18 авг 2016, 00:22 ] |
Заголовок сообщения: | Re: set weapon ammo icon ? |
I did not understand how to replace icon to other icon ex: rpg_rocket icon to ==> corwbar icon |
Автор: | Lev [ 18 авг 2016, 02:06 ] |
Заголовок сообщения: | Re: set weapon ammo icon ? |
Capture DeathMsg and change 3 argument (string) from "rpg" to "crowbar". |
Автор: | abdobiskra [ 18 авг 2016, 13:52 ] |
Заголовок сообщения: | Re: set weapon ammo icon ? |
Код: public plugin_init() typ 2 : Код: public plugin_init() no one worked ! typ 3 : worket but 2 Msg ? Код: public plugin_init() { Вложение: Capture.JPG [ 9.03 КБ | Просмотров: 1986 ] |
Автор: | Lev [ 18 авг 2016, 19:05 ] |
Заголовок сообщения: | Re: set weapon ammo icon ? |
You did a lot of errors, this is why they don't work. 1: Код: static szTruncatedWeapon[33], iAttacker, iVictimfirst you get a weapon correctly Код: new szWeapon[10];then you try to read it in a wrong way so it will not work so. 2: Код: new weapon = get_msg_arg_int(3)3 argument is a string, not an integer (int). Код: if(get_msg_arg_string(18, szMessage, 32 - 1) )argument number 18??? you will get nothing here Код: if(equal(szMessage, "rpg") )//rpg_rocket i think ?then compare nothing to "rpg". No, it is not "rpg". Код: set_msg_arg_int(3, get_msg_argtype(3), weapon);Again: argument 3 is a string! Код: set_msg_arg_string(3, "crowbar")this is right. Use debug printing while developing, you are badly need to check your code. |
Автор: | abdobiskra [ 19 авг 2016, 16:17 ] |
Заголовок сообщения: | Re: set weapon ammo icon ? |
Lev писал(а): Код: new szWeapon[10];then you try to read it in a wrong way so it will not work so. can u give me true way please ? bcz i trayed like that Код: public Message_DeathMsg( ) { but see also icon crowbar when player ( died using kill cmd OR falled ) saw icon crowbar ? .... door and trigger i dont tested also in my last code detect player only when get weapon crowbar ... so if player shot and change weapon the icon changed . |
Автор: | Lev [ 19 авг 2016, 21:25 ] |
Заголовок сообщения: | Re: set weapon ammo icon ? |
abdobiskra писал(а): can u give me true way please ? abdobiskra писал(а): ***Do not give me a fish, but taught me how to hunt*** I gave you the correct way. But you have to walk it.Код: if(is_user_alive( iAttacker )Why you require attacker to be alive? what if I throw a grenade and will kill someone with it, but will be dead already? Код: get_user_weapon(iAttacker) == HLW_CROWBARThe same, why you check what I am holding right now in the hand? This is wrong. You can get 3 argument and what weapon it specify. And then replace if you need to. |
Автор: | abdobiskra [ 21 авг 2016, 01:50 ] |
Заголовок сообщения: | Re: set weapon ammo icon ? |
Lev писал(а): You can get 3 argument and what weapon it specify Код: if(get_msg_arg_string(3, "crowbar", 7)) {? |
Автор: | Lev [ 21 авг 2016, 03:03 ] |
Заголовок сообщения: | Re: set weapon ammo icon ? |
Not sure whats so hard Код: static sWeapon[20] |
Страница 2 из 3 | Часовой пояс: UTC + 5 часов [ Летнее время ] |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |