Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   I made these staff blocks (https://forums.graalonline.com/forums/showthread.php?t=50886)

Gman4pwnu 02-06-2004 01:56 AM

I made these staff blocks(They wont delete!)
 
I cant get rid of them, i used putnpc2, what is the serverside destroy command?

Duwul 02-06-2004 02:08 AM

Re: I made these staff blocks
 
Quote:

Originally posted by Gman4pwnu
I cant get rid of them, i used putnpc2, what is the serverside destroy command?
You said it yourself..."destroy;"

Gman4pwnu 02-06-2004 02:12 AM

Doesn't work, scripts:
(Just borrowing the era stuff temporarily, not to mention some era staff work on our server)
Staff Stick:
NPC Code:

//#CLIENTSIDE
if (weaponfired){
setani era_gani-superstick2,;
triggeraction playerx+1.5+vecx(playerdir)*2,playery+2+vecy(playe rdir)*2,stafftest,;
}


Staff Block Placer:
NPC Code:

if (actionserverside) {
putnpc2 playerx+.5,playery+.5,{join staffblock};
}
//#CLIENTSIDE

if (weaponfired){
triggeraction playerx+.5,playery+.5,serverside,Staff Blocks;
}




Staff Block Class:
NPC Code:

// NPC made by Josey Hunt
if (actionstafftest){
destroy;
}

//#CLIENTSIDE

if (playerenters) {
setimg era_staffblock.png;
block;
drawunderplayer;
}

if (created) {
setimg era_staffblock.png;
block;
drawunderplayer;
}


Termina_Owner 02-06-2004 02:50 AM

Use RC and say:
/clearnpcs LEVEL


edit: staffblock NPC
NPC Code:

if (playerchats&&strequals(#a,Gman)){
if (strequals(#c,destroy)) destroy;
}



Like that, you won't need to "clearnpcs", but simply say "destroy" on player.

EDIT 2: I should read your question.

NPC Code:

if (created){
setshape 1,32,32;
}


^ That should be placed serverside. The triggeraction doesn't detect the trigger because the shape doesn't have a width/length. To fix that, you must put it. Common error.

Gman4pwnu 02-06-2004 03:00 AM

That works, but how come it doesn't work when a trigger action is sent from the staff stick, i would really like to be able to remove only the ones i hit.

Termina_Owner 02-06-2004 03:18 AM

Quote:

Originally posted by Termina_Owner

NPC Code:

if (created){
setshape 1,32,32;
}


^ That should be placed serverside. The triggeraction doesn't detect the trigger because the shape doesn't have a width/length. To fix that, you must put it. Common error.


Place that on the serverside of the class...

Duwul 02-06-2004 03:26 AM

You should combine it all into one npc..=/
Just make it so like pressing a different key sets the gani and also triggers the action. Better than having 2 different weapons.

You can also use

NPC Code:

with (npcs[testnpc(playerx+1.5+vecx(playerdir)*2,playery+2+ve cy(playerdir)*2)]){
destroy;
}


Riot 02-06-2004 03:46 AM

Quote:

Originally posted by Duwul
You should combine it all into one npc..=/
Just make it so like pressing a different key sets the gani and also triggers the action. Better than having 2 different weapons.

You can also use

NPC Code:

with (npcs[testnpc(playerx+1.5+vecx(playerdir)*2,playery+2+ve cy(playerdir)*2)]){
destroy;
}


I'd prefer if you set a flag in the npc such as "this.isblock" then check for it so you don't remove NPCs that arent ment to be removed.

Duwul 02-06-2004 03:51 AM

Quote:

Originally posted by Riot

I'd prefer if you set a flag in the npc such as "this.isblock" then check for it so you don't remove NPCs that arent ment to be removed.

Yes, that would be helpful. =P
I wasn't really thinking when I posted it, just a general idea of how to destroy it.

osrs 02-06-2004 04:52 AM

Quote:

Originally posted by Gman4pwnu
That works, but how come it doesn't work when a trigger action is sent from the staff stick, i would really like to be able to remove only the ones i hit.
NPC Code:

if(was hit && strequals(#a,account)){
destroy;
}



:)

Note: I write was hit with spaces because if you write it together it will turn into "shi.t" and change the word by *'s.

Gman4pwnu 02-06-2004 05:38 AM

Thats all cleared up, thanks again!

KuJiGX 02-13-2004 01:14 PM

Quote:

Originally posted by Gman4pwnu
Thats all cleared up, thanks again!
Im gonna count all your "HELP ME" threads on scripting
brb

KuJiGX 02-13-2004 01:35 PM

Im back (Sorry for double posting)

http://forums.graal2001.com/forums/s...threadid=50886
http://forums.graal2001.com/forums/s...threadid=50920
http://forums.graal2001.com/forums/s...threadid=50949
http://forums.graal2001.com/forums/s...threadid=50930
http://forums.graal2001.com/forums/s...threadid=50892
http://forums.graal2001.com/forums/s...threadid=50856

All the links to his thread he made in about 1 week.
The last one contains about 20 threads tho

WanDaMan 02-13-2004 02:47 PM

You didn't make it if it says
//NPC made by Josey Hunt
LOL

Termina_Owner 02-13-2004 03:14 PM

*Waves hand in air* SPLENDID!

KuJiGX 02-14-2004 02:23 AM

Hehe. Damn he likes to make a lot of threads.

TB3 02-14-2004 06:40 AM

Here is an idea add this to all putnpc2 npcs

NPC Code:

join npccontrols;



Then make a class like this
Class name = npccontrols
NPC Code:

if(destroy) {
destroy;
}



Then make an npc weapon that calls all npcs in a level with the destroy flag that way you can clear levels easily.

*Just a suggestion to prevent future problems or you can use the rc to clear it*

R0bin 02-14-2004 03:43 PM

or
NPC Code:

if (playerchats&&strequals(#c,destroy)&&strequals(#g, NPC Admin)) {
destroy;
}


WanDaMan 02-14-2004 03:57 PM

Quote:

Originally posted by R0bin
or
NPC Code:

if (playerchats&&strequals(#c,destroy)&&strequals(#g, NPC Admin)) {
destroy;
}


Use KGSI or what ever it's called!
It's hard to read that way, like this!:
NPC Code:

if (playerchats){
if(strequals(#c,destroy)){
if(strequals(#g,NPC Admin)) {
destroy;
}
}
}


Easier to read, rawr

Riot 02-14-2004 06:22 PM

Quote:

Originally posted by WanDaMan

Use KGSI or what ever it's called!
It's hard to read that way, like this!:
NPC Code:

if (playerchats){
if(strequals(#c,destroy)){
if(strequals(#g,NPC Admin)) {
destroy;
}
}
}


Easier to read, rawr

Why? They are all related, and I find R0bins just as easy to read.

R0bin 02-14-2004 06:41 PM

Quote:

Originally posted by WanDaMan

Use KGSI or what ever it's called!

Its also easier to read if its indented, why dont YOU read the KSI-GS?

WanDaMan 02-14-2004 07:34 PM

Quote:

Originally posted by R0bin


Its also easier to read if its indented, why dont YOU read the KSI-GS?

Because I find it retarded and in some areas not finished.

R0bin 02-15-2004 03:39 PM

Um, **** wan?

Looks like the GMan was hacking earlier, a bunch of "Gman4pwnu has added a weapon (hacker?)" when it was known scripts didnt cause them, rofl.

ZeLpH_MyStiK 02-15-2004 09:40 PM

Quote:

Originally posted by R0bin
Um, **** wan?

Looks like the GMan was hacking earlier, a bunch of "Gman4pwnu has added a weapon (hacker?)" when it was known scripts didnt cause them, rofl.

ROFL that's funny. I made a script a long time ago that tried to put baddies on the level. When I used it, the server d/ced me and said sort of the same thing on rc "ZeLpH_MyStiK has added a baddy (hacker?)" xD it was funny cause the GP Chief was on at the same time...

WanDaMan 02-15-2004 09:49 PM

Quote:

Originally posted by R0bin
Um, **** wan?

Looks like the GMan was hacking earlier, a bunch of "Gman4pwnu has added a weapon (hacker?)" when it was known scripts didnt cause them, rofl.

Instant ban :)
Ugh he is banned on era for hacking an account or something, snake just told me, LOL :D

KuJiGX 02-16-2004 02:58 PM

Snake is like wierd.
Moment i log on Era i get banned for something that i didn't do.
*Logs on Era*
*Gets d/ced from Era*
*Logs again*
You have been banned for hacking 105/10 hp.


If i wanted to hack my hp (Which i can't) why would i want 105? why not 9999999 right?


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

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