Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   onPlayerKilled (https://forums.graalonline.com/forums/showthread.php?t=134259317)

Cubical 05-26-2010 09:57 PM

onPlayerKilled
 
I posted in the gserver update thread about this but I figured it would be more useful to make a thread that people can refer to for future reference.

I cannot seem to get onPlayerKilled to work at all
PHP Code:

function onPlayerKilled(){
  echo(
params[0SPC params[1]);


That is server side and I have never attempted to use onPlayerKilled before but I assume that is how it works. I already know the parameters but I couldn't seem to get it to call the event when a player gets killed. Any ideas on what's wrong?

TSAdmin 05-27-2010 12:20 PM

Are you trying it on a "default" Classic-Style server? If you're trying to do it on Era, I doubt it will work. Era has a custom HP system, so I may or may not be wrong but if I remember right, it also has a custom death system and would not be affected by Classic-Style "PlayerKilled" function.

Cubical 05-27-2010 06:44 PM

Quote:

Originally Posted by TSAdmin (Post 1578913)
Are you trying it on a "default" Classic-Style server? If you're trying to do it on Era, I doubt it will work. Era has a custom HP system, so I may or may not be wrong but if I remember right, it also has a custom death system and would not be affected by Classic-Style "PlayerKilled" function.

Nope, I'm aware it wont work on era. I have been trying to use it on testbed.

Cubical 05-28-2010 01:44 AM

Still cannot get this to work and have no clue why. Apparently Bell has restarted the server so it should be updated and I know I'm not doing anything wrong. Has anyone successfully gotten this to work?

xAndrewx 05-28-2010 08:18 AM

I have not, I made up a clientside detection though

HTML Code:

function onPlayerHurt() { 
  if (player.hearts <= 0) {
    this.doDeath();
  }
}

Maybe that'll help for now? :s

Cubical 05-28-2010 10:01 AM

Quote:

Originally Posted by xAndrewx (Post 1579104)
I have not, I made up a clientside detection though

HTML Code:

function onPlayerHurt() { 
  if (player.hearts <= 0) {
    this.doDeath();
  }
}

Maybe that'll help for now? :s

I was using it to check who killed whom but I can't seem to get it to work on testbed. Luca said it works on UN so I'm guessing that it is just a matter of updating testbeds gserver. I felt like I had the IQ of a dead squirrel for about 2 days because I couldn't figure it out.

WhiteDragon 05-28-2010 10:30 AM

Quote:

Originally Posted by Cubical (Post 1579122)
I was using it to check who killed whom but I can't seem to get it to work on testbed. Luca said it works on UN so I'm guessing that it is just a matter of updating testbeds gserver. I felt like I had the IQ of a dead squirrel for about 2 days because I couldn't figure it out.

In Stefan's post it seems like he had already updated all the GServers/NPC-Servers and they just required a restart... it would be odd if only Testbed was missed.

xAndrewx 05-28-2010 05:48 PM

Doesn't work on bravo, so I used that alternative :[

DustyPorViva 05-28-2010 07:47 PM

Well I've definitely used it on UN. I don't remember for what exactly, but I remember having it sent to my F2 window for a little. I don't have access to that anymore, though.

xAndrewx 05-28-2010 09:05 PM

It's just this second started working on Bravo =] (Noticed alot of spam in RC)

DustyPorViva 05-28-2010 09:11 PM

PHP Code:

function onPlayerKilled(vic,kill) {
  
findplayer("DustyPorViva").sendrpgmessage(vic SPC "was killed by" SPC kill);


Worked fine for me on Testbed:

Nogross was killed by DustyPorViva

Cubical 05-29-2010 05:27 AM

Yeah, it's fixed now. I guess that testbed just needed a restart.


All times are GMT +2. The time now is 01:27 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.