need help understanding this.
i am trying to make a pluging so when you kill yourself like 4 times in one round, the server kicks you. It works but im trying to make it so when a new round starts, it resets everything. That is what im having trouble with. Which event would i use for a new round? I wasn't sure so i made it call 3 differen't events.. but when a new round starts, nothing is printed on the screen like i wanted it to. Any clue?
Code:
#include <amxmodx> |
Re: need help understanding this.
I would do something like :
Code:
|
Re: need help understanding this.
Alright im not the best with coding so can you explain this?
What is this new iKiller = read_data( 1 ); i have never seen read_data. This i also don't get static sWeapon[6]; read_data( 4, sWeapon, sizeof sWeapon - 1 ); what does the read_data do on that part. |
Re: need help understanding this.
read_data reads the data returned by the message DeathMsg. read_data(1) will return the killer, and read_data(2) is the id of who died
Basically read_data does as it says For more information: http://www.amxmodx.org/funcwiki.php?go=func&id=132 |
Re: need help understanding this.
Sorry I'm not good with explanations. -_-
Also DeathMsg event is called when a player is dead : http://wiki.alliedmods.net/Half-Life...vents#DeathMsg |
Re: need help understanding this.
The code does not work for some reason i changed this to see if the onDeath function is even called... and it doesn't seem like it is.
public onDeath() { client_print( 0, print_chat, "Testing yo"); new iKiller = read_data( 1 ); new iVictim = read_data( 2 ); static sWeapon[6]; It never prints out testing yo when anyone dies. so idk why this isn't working. |
Re: need help understanding this.
You need to hook the actual DeathMsg. Put this in your plugin_init()
PHP Code:
|
Re: need help understanding this.
I already have that, i was just posting part of the code.
Code:
#include <amxmodx> |
Re: need help understanding this.
It's working for me, mate ...
Make sure you have latest .amxx file in your plugins directory and server restarted. |
Re: need help understanding this.
Do you think it could be because im using this plugin for a mod called zombie panic?
|
| All times are GMT -4. The time now is 01:20. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.