Author Topic: Help with some 'basic' scritpting  (Read 983 times)

0 Members and 4 Guests are viewing this topic.

Offline BRADEN

  • Camper
  • ***
  • Posts: 319
Help with some 'basic' scritpting
« on: March 12, 2008, 09:06:37 am »
I'm new to scripting and I wanna try out some cool things.

About this: http://enesce.com/help/index.html?Functions/CreateBullet.html

1) What is hit multiplier?
2) Is "function CreateBullet(X,Y,VelX,VelY,HitM: Single; sStyle, Owner: Byte): integer" and "CreateBullet(GetPlayerStat(1,'x'), GetPlayerStat(1,'y') - 500, 0, 0,100, 2, 1)" the same command type?
3) Can someone explain the relatonship between these two?
4) How does the server know on whom to drop the bullet? Where does the name  need to be written?
5) Can you make this action happen after a player writes a 'custom' command like /arstrike? And how?

Thanks in advance.
« Last Edit: March 12, 2008, 09:08:17 am by BRADEN »

Death is the solution to all problems. No man; no problem.
-Joseph Stalin

Offline Boblekonvolutt

  • Soldier
  • **
  • Posts: 222
  • "YOU are a CAR."
Re: Help with some 'basic' scritpting
« Reply #1 on: March 12, 2008, 11:00:18 am »
1) Some damage thing, it's useless anyway...
2) Not sure what you mean.
3) The first one defines the function, the other one calls it.
4) The GetPlayerStat(1, 'X') tells it to drop it on the X pos of player 1, same for the Y part.
5) Use OnCommand, check if it's '/airstrike' and then call CreateBullet. Something like this,

Code: [Select]
// OnCommand is called when an admin uses a / command, with ID being the user and Text the command.
function OnCommand(ID: byte; Text: string): boolean;
begin
  if Text = '/bomb me plz' then
     CreateBullet(GetPlayerStat(ID, 'X'), GetPlayerStat(ID, 'Y'), 0, 0, 100, 4, ID);
end;

Offline BRADEN

  • Camper
  • ***
  • Posts: 319
Re: Help with some 'basic' scritpting
« Reply #2 on: March 12, 2008, 11:33:33 am »
OMG, the shit I have to go through is just unbelievable. So I scripted some basic stuff and it worked, but then I dleteted it by mistake and had to write it again! Now the dedicated server won't start! Tell me what I did wrong:


Death is the solution to all problems. No man; no problem.
-Joseph Stalin

Offline amb2010

  • Camper
  • ***
  • Posts: 264
  • Fear the dot ...
Re: Help with some 'basic' scritpting
« Reply #3 on: March 12, 2008, 11:48:57 am »
Well if you go into where the dedicated server is and look in the logs folder, find the Console Log for what you just ran and look in it.
It will say something like
Compiling > Blah
ERROR (line) (column) (reason)

I dont see anything wrong with it though.
And as the lyrics go in the United State's national anthem: "America, f**k YEAH!".

Offline BRADEN

  • Camper
  • ***
  • Posts: 319
Re: Help with some 'basic' scritpting
« Reply #4 on: March 12, 2008, 12:02:57 pm »
Thanks amb2010, but thank god, after three attempts it worked again. Now how do I make a '/gimme mp5' thing? Do I just start off in another line or do I need to write something in between?
« Last Edit: March 12, 2008, 12:12:37 pm by BRADEN »

Death is the solution to all problems. No man; no problem.
-Joseph Stalin

Offline amb2010

  • Camper
  • ***
  • Posts: 264
  • Fear the dot ...
Re: Help with some 'basic' scritpting
« Reply #5 on: March 12, 2008, 12:20:28 pm »
EDIT: You removed your edits so you fixed the problem?

Anyways to add the /gimme mp5 just go down another line and make another if statement.
And as the lyrics go in the United State's national anthem: "America, f**k YEAH!".

Offline BRADEN

  • Camper
  • ***
  • Posts: 319
Re: Help with some 'basic' scritpting
« Reply #6 on: March 12, 2008, 12:32:48 pm »
Yes and my script if finally DONE! I LOVE IT!

BTW, can you spawn a rambo bow because it isn't listen in enesce's list: http://enesce.com/help/index.html?Functions/SpawnObject.html

Death is the solution to all problems. No man; no problem.
-Joseph Stalin

Offline chutem

  • Veteran
  • *****
  • Posts: 1119
Re: Help with some 'basic' scritpting
« Reply #7 on: March 14, 2008, 01:18:28 am »
With that script it will always give the deagles to player with id of 1, not the person who said the command, just change the '1' to 'ID'.
1NK3FbdNtH6jNH4dc1fzuvd4ruVdMQABvs