Graal Forums

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

Kumada 01-06-2002 08:37 PM

(playerkillsplayer)
 
I was wondering if there was something that can check if the player kills another player..
I would use ap but a flag would be much easier.
:)

joseyisleet 01-06-2002 11:22 PM

I think there is. How else could Stefan make the AP thing? I don't know what the code would be though. Try different variables for the server kills data. Then you could put it on a timeout to use it.
- shrugs. Other then that I have no idea.

zell12 01-06-2002 11:53 PM

I saw that command on some NPC scripting site, never paid attention to it though

Goboom 01-07-2002 01:20 AM

You could do it if you had it in a system npc and used triggeraction i do belive....

Kumada 01-07-2002 02:32 AM

Joey...
You can see if a player kills another player by using client.strings or this.strings Like this.
NPC Code:

if (playerenters){
toweapons -Kill;
timeout=.05;
this.ap = playerap;
}

if (timeout&&isweapon){
testap();
timeout=.05;
}

function testap();
{
if (playerap=<this.ap){
this.ap = playerap;
setplayerprop #c, U ARE HEV SINNED GY;
}
}



Something like this.. I know the
NPC Code:
 if (playerap=<this.ap) 

Probably will not work.. but ohwhell im just supposed to be showing you how its done.. damn im tired :asleep:

WHIPENIE4 01-07-2002 04:23 AM

[screen_name says:]

there are problems with that script, but it is in the right direction

Quote:

Originally posted by Kumada
Joey...
You can see if a player kills another player by using client.strings or this.strings Like this.
NPC Code:

if (playerenters){
toweapons -Kill;
timeout=.05;
this.ap = playerap;
}

if (timeout&&isweapon){
testap();
timeout=.05;
}

function testap();
{
if (playerap=<this.ap){
this.ap = playerap;
setplayerprop #c, U ARE HEV SINNED GY;
}
}



Something like this.. I know the
NPC Code:
 if (playerap=<this.ap) 

Probably will not work.. but ohwhell im just supposed to be showing you how its done.. damn im tired :asleep:


TDO2000 01-07-2002 04:24 AM

Um but if u have 0 AP or the guy u kiled had? wouldn't really work ;)

there is no scripting command counting the kills or death u can use... um no command I knew ;)

Shard_IceFire 01-07-2002 04:36 AM

Hmm. Couldn't it be done somehow with the (playerdies) command?

TDO2000 01-07-2002 04:44 AM

Quote:

Originally posted by Shard_IceFire
Hmm. Couldn't it be done somehow with the (playerdies) command?
If u are doing something like a 2 players-arena sure (P2P) but if there are more then 2 players in a level I don't think it relly possible to do it a good way...

Saga2001 01-07-2002 06:35 AM

you could use theplayerdies and playertouchsother, possibly, but the playerdies command is only active for the current player, meaning it would only register on the player that dies, it would be too complicated...i guess you could just do some sory of playercount thing...its possible, but it would take a lot of workarounds...A LOT! you could do a variation of the other guy's thing...
like:
NPC Code:

// Just include this in the system...
if (created)
{
plap = playerap;
playerz = playerscount;
}
if (timeout) {
if (plap<playerap||playerz<playerscount) {
if (playertouchsother) plkills++;
plap = playerap;
playerz = playerscount;
}
}


not exactly, but a lot like that.

TDO2000 01-07-2002 09:04 PM

Quote:

Originally posted by Saga2001
you could use theplayerdies and playertouchsother, possibly, but the playerdies command is only active for the current player, meaning it would only register on the player that dies, it would be too complicated...i guess you could just do some sory of playercount thing...its possible, but it would take a lot of workarounds...A LOT! you could do a variation of the other guy's thing...
like:
NPC Code:

// Just include this in the system...
if (created)
{
plap = playerap;
playerz = playerscount;
}
if (timeout) {
if (plap<playerap||playerz<playerscount) {
if (playertouchsother) plkills++;
plap = playerap;
playerz = playerscount;
}
}


not exactly, but a lot like that.

Um wouldn't work...

Kumada 01-07-2002 09:55 PM

Quote:

Originally posted by TDO2000
Um but if u have 0 AP or the guy u kiled had? wouldn't really work ;)

there is no scripting command counting the kills or death u can use... um no command I knew ;)

0 AP lasts for 5 seconds.

Saga2001 01-07-2002 10:19 PM

Quote:

Originally posted by TDO2000


Um wouldn't work...

yeah i know, its not like that was final, but it would be a lot like that.

btedji 01-07-2002 11:37 PM

it can be done, you would have to use testplayer, and indexes, and maybe triggeraction, it would be very difficult, i am trying to make one, but if you wanted to use ap, you would have to set the ap at 100 all the time, and if it lowered you would know the player killed someone, but then you could not longer use ap

TDO2000 01-08-2002 04:59 AM

Quote:

Originally posted by btedji
it can be done, you would have to use testplayer, and indexes, and maybe triggeraction, it would be very difficult, i am trying to make one, but if you wanted to use ap, you would have to set the ap at 100 all the time, and if it lowered you would know the player killed someone, but then you could not longer use ap
It's possible, that 2 or more players are at the same position so testplayer wouldn't really help

the best way doing this should be a complete new Weapon system (self coded sword and stuff) working with trigegractions so it could be done

Slaktmaster 01-08-2002 05:12 AM

if (playerkillsplayer)

#r(0) is the account name of the killed player
#r(1) is the account name of the killer
#r(2) is the ap loss

LilNiglet 01-08-2002 05:21 AM

Quote:

Originally posted by Slaktmaster
if (playerkillsplayer)

#r(0) is the account name of the killed player
#r(1) is the account name of the killer
#r(2) is the ap loss

is that a actual command? because i am making a bounty system for 2001

Slaktmaster 01-08-2002 01:53 PM

No. But there really should be one like that. I'll post in the future improvements.

Saga2001 01-08-2002 03:47 PM

lol well thats interasting, posting non-existant commands...ook

joseyisleet 01-08-2002 06:45 PM

Kumada,
You could check if a player killed someone like that, yes. I don't think Stefan coded it like that though. How else would you do it when you said `showkills`. It would be a waist of time to use this.kills and stuff.

Xaviar 01-08-2002 11:32 PM

Quote:

Originally posted by joseyisleet
Kumada,
You could check if a player killed someone like that, yes. I don't think Stefan coded it like that though. How else would you do it when you said `showkills`. It would be a waist of time to use this.kills and stuff.

That's hardcoded into graal there, slappy...


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

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