Author Topic: Disarm procedure  (Read 2908 times)

0 Members and 1 Guest are viewing this topic.

Offline Norbo

  • Camper
  • ***
  • Posts: 338
Disarm procedure
« on: October 28, 2008, 07:22:49 am »
Script Name: Disarm
Script Description Disarm an ID for a period of time!
Author: Norbo
Compile Test: Passed
Core Version: 2.6.3
Hosted by: Soldat Central - http://soldatcentral.com/

Full Description:
Disarm(ID: byte; Time: integer);

ID: The ID to be disarmed
Time: For how long should the ID be disarmed. Use a negative number to disarm forever.

NOTE: When your using a positive number, only one person can be disarmed at a time!

Examples:

Disarm(1,5); //Will disarm ID 1 for 5 seconds, then give him back his weapons, including the ammo that he had before he was disarmed

Disarm(1,-1); //Will disarm ID 1 forever (he wont get back his weapons)

In the script i included a OnPlayerCommand function with /test command, so you can see how its done

Have Fun and please report any bugs etc.





(Size 774 B)
- http://soldatcentral.com/index.php?page=script&f=65 -


** Script hosted by Soldat Central! Please visit the author's script page and Rate this script **

Offline DemonicForces

  • Major(1)
  • Posts: 11
  • Evil?!?
Re: Disarm procedure
« Reply #1 on: December 09, 2008, 05:29:04 pm »
How do i have to inser the command if i'm inagme ?!?!

/Disarm(1,5) don't works!
/test works => the Script is ok but I also can't find a command inside the script to use it....

plz help me

Offline GSx_Major

  • Major
  • *
  • Posts: 97
Re: Disarm procedure
« Reply #2 on: December 09, 2008, 09:19:44 pm »
It's not meant to be used as a command, if you want it to you change OnCommand to this,
Code: [Select]
function OnCommand(ID: Byte; Text: string): boolean;
begin
if GetPiece(Text, 0) = '/disarm' then
  Disarm(StrToInt(GetPiece(Text, ' ', 1), StrToInt(GetPiece(Text, ' ', 2)));
end;

(not tested)
...and headbutt the sucker through your banana suit!

Offline DemonicForces

  • Major(1)
  • Posts: 11
  • Evil?!?
Re: Disarm procedure
« Reply #3 on: December 10, 2008, 11:53:52 pm »
How else will i have to use it ?!?!
only /test ?!?!?

Offline iDante

  • Veteran
  • *****
  • Posts: 1967
Re: Disarm procedure
« Reply #4 on: December 11, 2008, 12:41:36 am »
How else will i have to use it ?!?!
only /test ?!?!?
It's not for you to use, it's for other people to include in their scripts.

Offline Norbo

  • Camper
  • ***
  • Posts: 338
Re: Disarm procedure
« Reply #5 on: December 11, 2008, 02:21:46 pm »
Yes, it is not for use, it is a single procedure that scripters can use in their scripts.
If u want it as a command add the code that iDante posted. Just add it UNDERNEATH the disarm procedure

Offline DemonicForces

  • Major(1)
  • Posts: 11
  • Evil?!?
Re: Disarm procedure
« Reply #6 on: December 11, 2008, 03:06:51 pm »
Ahh I understand -.-"

but which code did iDante posted ?!?!
and the Code from Major didn't worked

Offline GSx_Major

  • Major
  • *
  • Posts: 97
Re: Disarm procedure
« Reply #7 on: December 11, 2008, 10:57:00 pm »
Try this,

Code: [Select]
function OnCommand(ID: Byte; Text: string): boolean;
begin
  if GetPiece(Text, ' ', 0) = '/disarm' then
    Disarm(StrToInt(GetPiece(Text, ' ', 1), StrToInt(GetPiece(Text, ' ', 2)));
end;
...and headbutt the sucker through your banana suit!

Offline DemonicForces

  • Major(1)
  • Posts: 11
  • Evil?!?
Re: Disarm procedure
« Reply #8 on: December 12, 2008, 10:25:17 am »
nope ^^ don't work either  ???

Offline shantec

  • Soldier
  • **
  • Posts: 140
  • Get ANGREH!!
Re: Disarm procedure
« Reply #9 on: December 12, 2008, 10:36:05 am »
Code: [Select]
function OnCommand(ID: Byte; Text: string): boolean;
begin
  if GetPiece(Text, ' ', 0) = '/disarm' then begin
    Disarm(StrToInt(GetPiece(Text, ' ', 1)), StrToInt(GetPiece(Text, ' ', 2)));
  end;
 result := false;
end;
Maybe?

It missed ")" in StrToInt();


oh and also it needs disarm procedure too! (if you didn't realize that)
« Last Edit: December 12, 2008, 10:44:44 am by shantec »
Also Known As REIMA


Lol Happles (happy apples)

Offline DemonicForces

  • Major(1)
  • Posts: 11
  • Evil?!?
Re: Disarm procedure
« Reply #10 on: December 12, 2008, 01:35:39 pm »
Good and Bad news:

-Good news: Server isn't Crashing anymore

-Bad news: the command isn't working  :-X
                or how do I have to type it in ?!?

Offline GSx_Major

  • Major
  • *
  • Posts: 97
Re: Disarm procedure
« Reply #11 on: December 12, 2008, 02:47:54 pm »
/disarm 2 5
Disarms player 2 for 5 seconds.

Unless I forgot to add brackets and commas there too :D
...and headbutt the sucker through your banana suit!

Offline DemonicForces

  • Major(1)
  • Posts: 11
  • Evil?!?
Re: Disarm procedure
« Reply #12 on: December 12, 2008, 04:01:32 pm »
BIG THX =)
Every thing is Working now  ;D

Thank you guys for helping me

Offline Irlandec

  • Soldier
  • **
  • Posts: 176
Re: Disarm procedure
« Reply #13 on: April 01, 2009, 06:29:18 am »
Thx for the release