Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Playerkills??? (https://forums.graalonline.com/forums/showthread.php?t=63177)

Angel_Light 01-03-2006 08:49 PM

Playerkills???
 
Hello,

okay, i've search the old upfated commands for GS1 and then the WIKI nothing, Is therea command when the playerkills a opponet, e.g. another player or a attcking NPC??? :\

Yen 01-03-2006 09:05 PM

No, closest thing you have is 'playerdies.'

Which isn't very helpful, since the person who killed you isn't communicated. :/

Angel_Light 01-03-2006 09:08 PM

I know T_T, Well they should create a command for that for GS2. Like

playerslays();

and side the paranthses should be the type of enemy or just they any.

Yen 01-03-2006 09:12 PM

That would be a really good idea.

PHP Code:

function onPlayerKills(killedtype,killedaccount) {
  
player.chat "I just killed" SPC killedaccount;


Also, a variable holding the last person to hit you would be nice. Or the last person you hit.

Angel_Light 01-03-2006 09:14 PM

yea and just leave it blank if ya dont want nothing there, that's a really good idea ^^

talkingnoodle 01-03-2006 10:03 PM

What I would do is put a flag in the client (client.lasthitby) and if the player is hit 1 more time then the person who hit them last would get credit for the kill, I put this in the projectile

Yen 01-03-2006 10:08 PM

There's no way to tell who hit you last, unless it's with a projectile.

xAndrewx 01-03-2006 10:11 PM

Quote:

Originally Posted by Yen
There's no way to tell who hit you last, unless it's with a projectile.

That's how Era does it. :p

Hm, not too sure but isn't 'if (wash*t)' fully functional?

talkingnoodle 01-03-2006 10:33 PM

here ill help you (this is the projectile part)

NPC Code:


if (actionprojectile){
if (strequals(#p(0),<projectile_name>))){
setstring client.lasthitby,#p(1);
}
}


Yen 01-03-2006 10:45 PM

... You make me frown.

We're talking about regular hearts. Arrows, explosions, swords, NPCs doing damage. Not projectiles.

talkingnoodle 01-03-2006 10:54 PM

o_o oh..

XD

Angel_Light 01-04-2006 01:53 AM

lol, well, hopefully stefan will make that command

ApothiX 01-04-2006 06:38 AM

just handle the s key, and send a triggeraction at playerx+2*vecx(playerdir), playery+2*vecy(playerdir) with the account name as a parameter.

Lance 01-04-2006 07:53 AM

Quote:

Originally Posted by ApothiX
just handle the s key, and send a triggeraction at playerx+2*vecx(playerdir), playery+2*vecy(playerdir) with the account name as a parameter.

Why not just keep track of that with washit, and then act on that when the player dies?

There is probably a better way to go about doing this, but it hardly makes sense to make it more complicated with triggeractions.

ApothiX 01-04-2006 11:25 AM

Quote:

Originally Posted by Lance
Why not just keep track of that with washit, and then act on that when the player dies?

There is probably a better way to go about doing this, but it hardly makes sense to make it more complicated with triggeractions.

Ah, I wasn't aware that washit stored the account of the player that hit you. My bad.

Lance 01-04-2006 12:02 PM

Quote:

Originally Posted by ApothiX
Ah, I wasn't aware that washit stored the account of the player that hit you. My bad.

I'm not sure if washit alone does (;)), but I am 99% certain that the client stores the information about who killed them somewhere - whether this is available to scripts or not, I can't say.

Angel_Light 01-04-2006 10:51 PM

Or, Why don't they just add a playerslays() command? XD Much simpler.

Yen 01-05-2006 01:19 AM

Quote:

Originally Posted by Lance
I'm not sure if washit alone does (;)), but I am 99% certain that the client stores the information about who killed them somewhere - whether this is available to scripts or not, I can't say.

washit can't read who it was hit by, and I'm very sure that who the last person to hit/kill you isn't accessable by scripts.

The range of places your sword can hit is too wide, so a triggeraction isn't very safe. It could trigger on someone you didn't hit, or the person could lag and they might not catch the trigger due to the knockback.

The closest thing I was able to get was a for() loop which checks for a nearby players with the 'sword' gani.

Angel_Light 01-05-2006 02:57 AM

But, what if they slay a NPC or players with bombs arrows Etc (custom weapons)

ApothiX 01-05-2006 03:19 AM

Quote:

Originally Posted by Angel_Light
But, what if they slay a NPC or players with bombs arrows Etc (custom weapons)

then I guess you're S.O.L.

The best solution would probably be to write your own battle system :cool:

Angel_Light 01-05-2006 04:40 AM

I'm not that good of a scripter to do that T-T

ZeLpH_MyStiK 01-05-2006 07:07 AM

Quote:

Originally Posted by Yen
and I'm very sure that who the last person to hit/kill you isn't accessable by scripts.

GScript does contain many secret...[ominous mood arises]...

ApothiX 01-05-2006 08:03 PM

Quote:

Originally Posted by ZeLpH_MyStiK
GScript does contain many secret...[ominous mood arises]...

Care to share?

Yen 01-05-2006 09:53 PM

z-z Naw, a few people looked into it with a memory viewer. These people found a list of functions, default GUI controls, ect.
They didn't find anything about hit peoples. :(

Angel_Light 01-05-2006 11:35 PM

Ii sent a forum pm to stefan about this

Angel_Light 01-09-2006 04:07 AM

Yet, He seems not to reply. WHAA, Stefan doesn't like me. T-T :P :D

ApothiX 01-09-2006 06:01 AM

Quote:

Originally Posted by Angel_Light
Yet, He seems not to reply. WHAA, Stefan doesn't like me. T-T :P :D

Or perhaps he's busy. The coder of graal being busy.. what a concept.

Angel_Light 01-11-2006 03:56 AM

No, he hate's me. :P


All times are GMT +2. The time now is 04:44 AM.

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