Author Topic: 2 questions, most likely noob ones:  (Read 548 times)

0 Members and 1 Guest are viewing this topic.

Offline AquaByrd

  • Soldier
  • **
  • Posts: 108
  • Lolwut?
2 questions, most likely noob ones:
« on: January 18, 2009, 08:36:27 am »
I'm writing my 1st script, although I've read the tutorials I never really learn anything from them other than how to replicate what the tutorial teaches you, and as I found with Photoshop this doesn't help me learn new stuff.

So, question 1:

How do I make it so only admins can use a command?

Question 2:

How to I script a 'DoDamage' that does damage to a chosen player? E.g. /slap <player ID>
My sig was 300 x 120, the maximum size is 300 x 125. Check next time will you.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: 2 questions, most likely noob ones:
« Reply #1 on: January 18, 2009, 09:38:39 am »
1) the event OnCommand is only called when admins do a / command (where as OnPlayerCommand is called when anybody does a / command)
2) A few hints:
OnCommand or OnPlayerCommand
check using GetPiece if the first part is '/slap'
get the 2nd piece w/ GetPiece, and change it to an int with StrtoInt
DoDamage to this int

if you didn't already know, http://www.enesce.com/help has some references for events, functions, and variables

Offline chutem

  • Veteran
  • *****
  • Posts: 1119
Re: 2 questions, most likely noob ones:
« Reply #2 on: January 18, 2009, 07:32:45 pm »
I think here is better than enesce.com/help.

Other than that, yeah, what curt said.
1NK3FbdNtH6jNH4dc1fzuvd4ruVdMQABvs