Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: jason on July 20, 2008, 08:29:09 pm

Title: how make my own command?
Post by: jason 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?
Title: Re: how make my own command?
Post by: thijn 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
    }
Title: Re: how make my own command?
Post by: jason on July 20, 2008, 09:54:44 pm
when i type !heal to hel me i die

lol
Title: Re: how make my own command?
Post by: thijn 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) }
}
Title: Re: how make my own command?
Post by: jason on July 20, 2008, 10:02:12 pm
ok i test it
Title: Re: how make my own command?
Post by: TanaX01 on July 20, 2008, 10:04:44 pm
 nice aport ;)
Title: Re: how make my own command?
Post by: jason on July 20, 2008, 10:07:10 pm
it do nothing

it says:

heal - player: []




help
Title: Re: how make my own command?
Post by: Hancock on December 08, 2008, 01:52:24 pm
Hi, How Can I heal 200 in hp Coz it exist in GTA-vc
Title: Re: how make my own command?
Post by: thijn on December 09, 2008, 10:15:33 pm
U can't
Title: Re: how make my own command?
Post by: Tamas on December 10, 2008, 06:04:17 pm
He can  :P Just the vc-mp automatically sets his hp back to 100.
Title: Re: how make my own command?
Post by: thijn 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