Author Topic: how make my own command?  (Read 6397 times)

0 Members and 1 Guest are viewing this topic.

Offline jason

  • Street Thug
  • *
  • Posts: 22
    • View Profile
    • http://wavemaster.net63.net
how make my own command?
« on: July 20, 2008, 08:29:09 pm »
hello

how can i make my own command for sansan v3?


and how can i add the !heal command in sansan v3?
« Last Edit: July 20, 2008, 08:44:03 pm by jason »

Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: how make my own command?
« Reply #1 on: July 20, 2008, 09:41:54 pm »
its easy to add your own command in SanSan,
If you want a command like /c <command here> you have to change the
Code: [Select]
on *:SIGNAL:vcmp.event.command:simply add a line (at the end):
Code: [Select]
elseif ($2 == here you comand) { Here the code you want to run when the command is typed }If you want a command like !command here
you have to change the
Code: [Select]
on *:SIGNAL:vcmp.event.gamecmdsimply add a line:
Code: [Select]
elseif ($2 == !here your command) { Here the code you want to run when the command is typed }
I hope that helped ;)


and how can i add the !heal command in sansan v3?
Try this:
Code: [Select]
    elseif ($2 == !heal) {
vcmp.sethp $1 100
vcmp.adminmsg %id You healed
    }
Or if you want the players to pay:
Code: [Select]
    elseif ($2 == !heal) {
var %cost = Here the amount you want it to cost
vcmp.sethp $1 100
vcmp.setmon %id $calc($vcmp.hgetmoney(%id) - %cost
vcmp.adminmsg %id You healed
    }
« Last Edit: July 20, 2008, 09:48:36 pm by thijn »

Offline jason

  • Street Thug
  • *
  • Posts: 22
    • View Profile
    • http://wavemaster.net63.net
Re: how make my own command?
« Reply #2 on: July 20, 2008, 09:54:44 pm »
when i type !heal to hel me i die

lol

Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: how make my own command?
« Reply #3 on: July 20, 2008, 10:00:04 pm »
lolz, try this:
Command:
Code: [Select]
elseif ($2 == !heal) {
vcmp.cmd.healplayer $1
    }
Alias:
Code: [Select]
alias vcmp.cmd.healplayer {
  var %id = $vcmp.nameid($$1-)
  var %hp = 100
  var %amount = 1000
  if (%amount >= $vcmp.hgetmoney(%id)) {
    vcmp.gametextpm %id ~a~ Not enough money...
    vcmp.adminmsg %id You need 1000!
  }
  else {
    vcmp.adminchat ** Heal -  Player: $chr(91) $vcmp.hgetname($vcmp.nameid($1)) $chr(93)
    vcmp.adminmsg %id You healed -  Cost: 1000
    vcmp.sethp %id %hp
  vcmp.setmon %id $calc($vcmp.hgetmoney(%id) - 1000) }
}

Offline jason

  • Street Thug
  • *
  • Posts: 22
    • View Profile
    • http://wavemaster.net63.net
Re: how make my own command?
« Reply #4 on: July 20, 2008, 10:02:12 pm »
ok i test it

Offline TanaX01

  • Made Man
  • ***
  • Posts: 214
  • BlackList! <3
    • View Profile
Re: how make my own command?
« Reply #5 on: July 20, 2008, 10:04:44 pm »
 nice aport ;)

Offline jason

  • Street Thug
  • *
  • Posts: 22
    • View Profile
    • http://wavemaster.net63.net
Re: how make my own command?
« Reply #6 on: July 20, 2008, 10:07:10 pm »
it do nothing

it says:

heal - player: []




help
« Last Edit: July 20, 2008, 10:37:59 pm by jason »

Offline Hancock

  • Street Thug
  • *
  • Posts: 25
  • Hancock Of The Forum of vice city Multiplayer ;D
    • View Profile
Re: how make my own command?
« Reply #7 on: December 08, 2008, 01:52:24 pm »
Hi, How Can I heal 200 in hp Coz it exist in GTA-vc
Hancock Of VC-MP


Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: how make my own command?
« Reply #8 on: December 09, 2008, 10:15:33 pm »
U can't

Offline Tamas

  • Made Man
  • ***
  • Posts: 127
    • View Profile
    • http://www.tamasnet.eu/
Re: how make my own command?
« Reply #9 on: December 10, 2008, 06:04:17 pm »
He can  :P Just the vc-mp automatically sets his hp back to 100.

Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: how make my own command?
« Reply #10 on: December 10, 2008, 11:50:06 pm »
He can  :P Just the vc-mp automatically sets his hp back to 100.
Lolz, Why u post this? I allready told him :P