Graal Forums

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

Duwul 02-05-2004 12:49 AM

triggeraction question
 
I was wondering if you could do this.

NPC Code:

with (getplayer(account)){
triggeraction 0,0,server/clientside,weaponname,params;
}



This could be used for maybe triggering someone elses weapon. Thanks for your input.

Riot 02-05-2004 01:28 AM

Re: triggeraction question
 
Quote:

Originally posted by Duwul
I was wondering if you could do this.

NPC Code:

with (getplayer(account)){
triggeraction 0,0,server/clientside,weaponname,params;
}



This could be used for maybe triggering someone elses weapon. Thanks for your input.

Im pretty sure you can do that, with clientside atleast.

Termina_Owner 02-05-2004 02:11 AM

NPCW:

NPC Code:

if (serverside){
if (strequals(#p(0),a)){
with (getplayer(#p(1))){
setstring client.a,1;
}
}
if (strequals(#p(0),b)){
setplayerprop #c,Arg... How can you do this to me?!;
}
}
//#CLIENTSIDE
if (playerenters) timeout = 0.05;
if (timeout){
if (!strequals(#s(client.a),)){
setstring client.a,;
triggeraction 0,0,serverside,NPCW,b;
}
}
if (weaponfired){
triggeraction 0,0,serverside,NPCW,a,#a;
}



A short example... I don't know if you can do that to someone else, but well, this is a detour if you can't.

xManiamaNx 02-05-2004 02:21 AM

if (serverside){

needs to be

if (actionserverside){

ZeLpH_MyStiK 02-05-2004 02:22 AM

Quote:

Originally posted by Termina_Owner
NPCW:

NPC Code:

if (serverside){
if (strequals(#p(0),a)){
with (getplayer(#p(1))){
setstring client.a,1;
}
}
if (strequals(#p(0),b)){
setplayerprop #c,Arg... How can you do this to me?!;
}
}
//#CLIENTSIDE
if (playerenters) timeout = 0.05;
if (timeout){
if (!strequals(#s(client.a),)){
setstring client.a,;
triggeraction 0,0,serverside,NPCW,b;
}
}
if (weaponfired){
triggeraction 0,0,serverside,NPCW,a,#a;
}



A short example... I don't know if you can do that to someone else, but well, this is a detour if you can't.

should be if (actionserverside) and also you can use callnpcs or do a triggeraction and add in the acct as a param and check if the person has that account.

Termina_Owner 02-05-2004 02:28 AM

Meh... That's one of my common mistakes... When I script rapidly only to get an overview idea, I tend to forget the action... Ohwell... 'Jira would've known my mistake. I don't take him for a fool.

Duwul 02-05-2004 05:19 AM

Quote:

Originally posted by Termina_Owner
Meh... That's one of my common mistakes... When I script rapidly only to get an overview idea, I tend to forget the action... Ohwell... 'Jira would've known my mistake. I don't take him for a fool.
Haha! =P
I knew about setting a string. I was just thinking maybe this could be a way around using it.

adam 02-05-2004 07:17 AM

Only way to know is to try.

Only way to try is to get a job on a server. Or buy your own.

Alexander 02-05-2004 08:31 AM

Re: triggeraction question
 
Quote:

Originally posted by Duwul
I was wondering if you could do this.

NPC Code:

with (getplayer(account)){
triggeraction 0,0,server/clientside,weaponname,params;
}



This could be used for maybe triggering someone elses weapon. Thanks for your input.

It works I use it sometimes, triggering clientside, I don't believe serverside would work never tried.

Quote:

Originally posted by Termina_Owner
stuff

That script doesn't go outside the player and the with(getplayer(#p(1))) is unneeded.
Your script is basicly:
NPC Code:

//#CLIENTSIDE
if (weaponfired) setplayerprop #c,Arg... How can you do this to me?!;


Termina_Owner 02-05-2004 09:48 AM

Quote:

That script doesn't go outside the player and the with(getplayer(#p(1))) is unneeded.
It was technically demonstrating. I know it didn't go out, but seeing I was writing the script up for 'Jira here, I knew he'd understand the point in which I was trying to demonstrate.

Just replace the #a by the account name you wanted. It's much simpler as to demonstrate then to find the index of the player in so-so place from you.

It's a technical script, however it's not a practical one. It's main purpose was to show a point of view in which 'Jira understood, knowing fully that there was unneeded substance, in which was needed to show my point.

I don't like doing full programs just to show a point in which the full program would be much more complex to the intended reader, making him have a much harder time learning from a technical script then from the practical one I could've made.

I have reason for why I do things, if you want me to explain every line by line (Right 'jira? I know you LOVE that!), then IM me on AIM and I'll be glad to tell you why each line was used.

I'm out.

osrs 02-05-2004 09:52 AM

Quote:

Originally posted by Termina_Owner


It was technically demonstrating. I know it didn't go out, but seeing I was writing the script up for 'Jira here, I knew he'd understand the point in which I was trying to demonstrate.

Just replace the #a by the account name you wanted. It's much simpler as to demonstrate then to find the index of the player in so-so place from you.

It's a technical script, however it's not a practical one. It's main purpose was to show a point of view in which 'Jira understood, knowing fully that there was unneeded substance, in which was needed to show my point.

I don't like doing full programs just to show a point in which the full program would be much more complex to the intended reader, making him have a much harder time learning from a technical script then from the practical one I could've made.

I have reason for why I do things, if you want me to explain every line by line (Right 'jira? I know you LOVE that!), then IM me on AIM and I'll be glad to tell you why each line was used.

I'm out.

Ajira is actually good at scripting, don't think he needs suck help. :)

Termina_Owner 02-05-2004 10:12 AM

Quote:

Originally posted by osrs


Ajira is actually good at scripting, don't think he needs suck help. :)

Reread => I said that Ajira is a good enough scripter to know what I meant.

As for the line by line, it's an inside joke, I'd guess... :) I told him every line of a whole post on aim just to piss him off... He knows what I meant, and that's all there is to it.

Duwul 02-05-2004 03:33 PM

Rofl.

First, osrs, Rance is my friend. =P
He's also better at scripting than me.

And yes, the line by line is VERY annoying..meh..

And Rogue, I do work on a server.

And thanks everyone for your input.
I guess I'll try it and see if it works.

adam 02-05-2004 08:23 PM

:( Im not a friend?

Duwul 02-06-2004 01:20 AM

Quote:

Originally posted by adam
:( Im not a friend?
Of course you are. <333


All times are GMT +2. The time now is 11:43 AM.

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