• Welcome to Vice City Multiplayer.
 

Distance-PM

Started by Chezor, September 06, 2008, 05:45:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Chezor

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...



Scripts: Fuel system in vehicles, Speedometer, Spawnback, Improved Copwork, Improved Jailing, Improved phone with sms, and many more. Coming soon..

Intruder

basically like local chat so only ppl near you can see what ya writen?

Chezor


Scripts: Fuel system in vehicles, Speedometer, Spawnback, Improved Copwork, Improved Jailing, Improved phone with sms, and many more. Coming soon..

thijn



Chezor

Quote from: thijn on September 07, 2008, 11:51:28 AM
Quote from: Chezor on September 06, 2008, 05:45:16 PM
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.

Scripts: Fuel system in vehicles, Speedometer, Spawnback, Improved Copwork, Improved Jailing, Improved phone with sms, and many more. Coming soon..

thijn

#5
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-
}
}
}
}


szostol

And what's distance alias?

Chezor

Quote from: thijn on September 07, 2008, 08:04:18 PM
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.

Quote from: szostol on September 07, 2008, 09:56:34 PM
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)
}


Scripts: Fuel system in vehicles, Speedometer, Spawnback, Improved Copwork, Improved Jailing, Improved phone with sms, and many more. Coming soon..

Force

Quote from: Chezor on September 08, 2008, 06:34:12 AM
Quote from: thijn on September 07, 2008, 08:04:18 PM
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
    }
  }
}

Chezor

oh what a fool i am, i didnt see that..  ;D

Scripts: Fuel system in vehicles, Speedometer, Spawnback, Improved Copwork, Improved Jailing, Improved phone with sms, and many more. Coming soon..

thijn

Acctually i forgot it ;D :D
Anyways does it works now?


Chezor


Scripts: Fuel system in vehicles, Speedometer, Spawnback, Improved Copwork, Improved Jailing, Improved phone with sms, and many more. Coming soon..