Vice City Multiplayer
VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: Chezor on September 06, 2008, 06:45:16 pm
-
I need help with scripting the following:
If i want to script.
Chezor: /c eat
All others who are near me by distance 5, will only get a PM. Suppose 1 and 2 are players. Then 1 is standing close to my by distance 5 and 2 is standing away from me. So 1 will only get the pm saying i m eating food. And 2 will not get the pm.
PM to 1: Chezor is eating food
got it ?.. but i dont know how to make it. I tried several times...
-
basically like local chat so only ppl near you can see what ya writen?
-
yes
-
I tried several times...
What code?
-
I tried several times...
What code?
I tried the following..
on *:SIGNAL:vcmp.command2:{
var %id = $1
var %name = $vcmp.name($1)
if ($2 == l) {
var %b = $vcmp.getid($1)
var %c = $vcmp.distince(%id,%b)
if ($3 == $null) vcmp.msg %id Please enter text, Cmd: /c l [Text]
elseif (%c <= 6) vcmp.msg %b >>localchat - %name says $3
}
}
thats only 1 example :/ i tried experimenting various codes however i was not successful so you thought its now better that i could get some tips from you guys.
-
try something like:
if ($2 == l) {
var %b = 0
if ($3 == $null) vcmp.msg %id Please enter text, Cmd: /c l [Text]
else {
while (%b <= 50) {
if ($vcmp.distance(%id,%b) <= 5) {
vcmp.msg %b Localchat - %name says: $3-
}
}
}
}
-
And what's distance alias?
-
try something like:
if ($2 == l) {
var %b = 0
if ($3 == $null) vcmp.msg %id Please enter text, Cmd: /c l [Text]
else {
while (%b <= 50) {
if ($vcmp.distance(%id,%b) <= 5) {
vcmp.msg %b Localchat - %name says: $3-
}
}
}
}
that code is crashing my mIRC. when i go ingame and use /c l text
It turns mIRC to non responding program.
And what's distance alias?
its this..
alias vcmp.distince {
var %id1 = $1
var %id2 = $2
var %x = $abs($calc($vcmp.location(%id1,x) - $vcmp.location(%id2,x)))
var %y = $abs($calc($vcmp.location(%id1,y) - $vcmp.location(%id2,y)))
var %z = $abs($calc($vcmp.location(%id1,z) - $vcmp.location(%id2,z)))
!return $round($calc($calc(%x + %y + %z) / 2),1)
}
-
try something like:
if ($2 == l) {
var %b = 0
if ($3 == $null) vcmp.msg %id Please enter text, Cmd: /c l [Text]
else {
while (%b <= 50) {
if ($vcmp.distance(%id,%b) <= 5) {
vcmp.msg %b Localchat - %name says: $3-
}
}
}
}
that code is crashing my mIRC. when i go ingame and use /c l text
It turns mIRC to non responding program.
I can immediately see why, he hasn't put an !inc %b in, the revised script should look something like:
if ($2 == l) {
var %b = 0
if ($3 == $null) vcmp.msg %id Please enter text, Cmd: /c l [Text]
else {
while (%b <= 50) {
if ($vcmp.distance(%id,%b) <= 5) {
vcmp.msg %b Localchat - %name says: $3-
}
!inc %b
}
}
}
-
oh what a fool i am, i didnt see that.. ;D
-
Acctually i forgot it ;D :D
Anyways does it works now?
-
Acctually i forgot it ;D :D
Anyways does it works now?
yep