• Welcome to Vice City Multiplayer.
 
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Mex

#31
mIRC/pawn Scripting / Re: readini variable
March 31, 2008, 06:15:22 PM
If you wish to use a variable instead of plain text inside the $readini identifier, you can.
For example if your ini layout was the following:

[section]
bob=hacking


And your script was this:

var %banslist = bob
var %test = $readini(filename.ini,section,%banslist)


Then the variable called %test will contain the word "hacking".

I hope thats what your after, if not then please explain exactly what your trying to do.
#32
Its possible to stop people editing it using a DLL.
But I dont think its possible to 'hide' the script.
#33
mIRC/pawn Scripting / Re: Scripting Help :]
March 23, 2008, 04:14:30 PM
Quote from: Chezor on March 15, 2008, 06:54:32 PM
at least give me the idea how to make it or explain me.

Each vehicle has a unique id.  This might help:
http://forum.vicecitymultiplayer.com/index.php?topic=135.0

Quote from: Chezor on March 15, 2008, 06:54:32 PM
Also i want to know how to make a command like !gotohideout <locname> so only admin lvl 1 can go to that location. and no other player can go to that location.

Heres a really basic bit of code which should help you.

if ($2 == !gotohideout) {
  if ($adminlevel(%name) < 1) { vcmp.msg %id You mustbe admin level 1. }
  elseif ($3 == bank) { vcmp.setlocation %id <x> <y> <z> [<interior>] }
  elseif ($3 == ssa) { vcmp.setlocation %id <x> <y> <z> [<interior>] }
  elseif ($3 == roof) { vcmp.setlocation %id <x> <y> <z> [<interior>] }
  else { vcmp.msg %id Invalid location name. }
}
elseif ($2 == !setlevel) {
  if ($4 == $null) { vcmp.msg %id !setlevel <fullnick> <level> }
  else { !writeini -n $qt($scriptdir $+ adminlevel.ini) Levels $3 $4 }
}
alias adminlevel { !return $iif($readini($qt($scriptdir $+ adminlevel.ini),Levels,$1),$v1,0)

#34
Quote from: jansi on February 26, 2008, 09:58:03 PM
I can connect to the vc:mp server, send commands (for example, "kick 0") and disconnect, but I don't receive any rcon output (like "[join] 0 Player" or "RCON: Kick Usage: kick <playerid>").

I know this is obvious but just double check you are using the correct DLL version.
On the homepage there is one under "0.1 downloads" which is the old version.  I downloaded this one the other day (not knowing it was an old version), and i could connect to the server but not do certain commands.
The latest version is under "VC:MP 0.3 is released!"
#35
mIRC/pawn Scripting / Re: IRC commands in game
February 22, 2008, 05:19:52 PM
Quote from: mbalee on February 19, 2008, 07:27:05 PM
:S I know how this is very hard, but need.

It will become harder when you try !connect when the script is disconnected.
#36
Support / Re: I can't find my server
February 17, 2008, 04:59:10 PM
If you are running the server on the same computer that you are connecting to using the client, you (and only you) should use the ip 127.0.0.1, anyone else who is not on your network should use your external ip (http://www.whatsmyip.org/)
#37
mIRC/pawn Scripting / Re: Help! Server Xtras
February 13, 2008, 05:01:05 PM
Hey here's an update for the 'part or nick' alias:

$vcmp.partofnick($vcmp.name(%id))

alias vcmp.partofnick {
  var %a = 1, %b = $1, %c, %d, %e, %f, %g, %h
  while (%a <= $len(%b)) {
    %c = $mid(%b,%a,1)
    if (%c == $chr(40)) { %d = $v2 | %e = $chr(41) | !break }
    elseif (%c == $chr(91)) { %d = $v2 | %e = $chr(93) | !break }
    !inc %a
  }
  %f = $pos(%b,%d,1) | %g = $pos(%b,%e,1)
  if ((!%d) || (!%f) || (!%g)) { !return }
  %h = $mid(%b,%f,$calc((%g - %f) + 1))
  !return $iif($len(%h) > 2,%h)
}


It will work for nicks like:
[XX]Testing Test[XX]ing Testing[XX] (XX)Testing Test(XX)ing Testing(XX)
#38
mIRC/pawn Scripting / Re: Help! Server Xtras
February 12, 2008, 10:09:12 PM
Quote from: mbalee on February 12, 2008, 10:03:41 PM
Thanks! :)

But... need some little things

1. cannot start with number

np, hope this works too.

on *:SIGNAL:vcmp.join:{
  var %name = $1, %id = $vcmp.getid(%name)
  var %a = 1, %b = @ / & % * !
  if ($left(%name,1) isnum) { vcmp.kick %id }
  while (%a <= $numtok(%b,32)) {
    if ($gettok(%b,%a,32) isin %name) {
      vcmp.kick %id
    }
    !inc %a
  } 
}


Quote from: mbalee on February 12, 2008, 10:03:41 PM
2. with ( and ) characters

$vcmp.partofnick($vcmp.name(%id),$chr(40),$chr(41))
#39
mIRC/pawn Scripting / Re: Help! Server Xtras
February 12, 2008, 09:19:50 PM
Quote from: mbalee on February 12, 2008, 06:24:48 PM
1. How may I make it that the nickname may not contain @,/,&,%,*,! and other characters? (kick)

Hey mbalee,
Just put the characters after the "%b = " bit, hope it works.

(A regular expression could probably do this better, but I don't know them.)

on *:SIGNAL:vcmp.join:{
  var %name = $1, %id = $vcmp.getid(%name)
  var %a = 1, %b = @ / & % * !
  while (%a <= $numtok(%b,32)) {
    if ($gettok(%b,%a,32) isin %name) {
      vcmp.kick %id
    }
    !inc %a
  } 
}


Quote from: mbalee on February 12, 2008, 06:24:48 PM
2. How I may have it read through only the parenthesis and the characters in him?
exampl: [VcMp]Testplayer the nick and only need [VcMp]

Remember to put this alias outside any signal brackets (scope).

alias vcmp.partofnick {
  var %name = $1, %pos1 = $pos(%name,$2,1), %pos2 = $pos(%name,$3,1)
  !return $mid(%name,%pos1,%pos2)
}


And heres the identifier to use:
$vcmp.partofnick($vcmp.name(%id),[,])
#40
mIRC/pawn Scripting / Re: Skins
February 02, 2008, 08:49:15 AM
Quote from: GTA-Roloboy on February 01, 2008, 07:22:39 PM
Can this also with skins?

That depends if the skin id is sent from the server to the script when the player spawns.
You can test this by doing the following.

In the vcmp.data alias look for this code:
elseif ($1 == [spawn]) {

}


Then add "echo -s $1-" inbetween the curly brackets:
elseif ($1 == [spawn]) {
  echo -s $1-
}


Now go ingame and spawn as any skin, and in the main mIRC window you should see "[spawn] something..".
If there is a number somewhere in the "something", it could be the skin id.
Try comparing it to your config skin id and the VC:MP skin id.

If the server does send the skin id to the script, then you can send that value to the vcmp.spawn signal.
Then you can use INI/Hash or whatever method you wish to store that value, which will be used for the !skin command.

If the server doesn't send the skin id to the script, there are other ways to get the !skin command working.

Quote from: GTA-Roloboy on February 01, 2008, 07:22:39 PM
and.. is it possible to do with !weapons <Name/ID> to see which weapons (and ammo) the player have?

You can use the $vcmp.weapon(playerid) alias to get the player's current weapon.
You could try creating an alias which shows all the player's weapons.
Such as, when a player picks up a weapon pickup, store the player id/name, wep id/name and ammo/default ammo amount somewhere.

I can think of a few problems with this though.
If someone buys a weapon at a weapon shop, I don't think the server sends any message to the script.
If someone shoots and runs out of ammo, again I don't think the server sends any message to the script.
#41
If you're using this script, then try this

on *:SIGNAL:vcmp.command:{
  if ($2 == !masskill) {
    var %a = 0
    while (%a <= 50) {
      if ($hget(vcmp,%a $+ .name) != $null) { vcmp.sethp %a 0 }
      !inc %a
    }
  }
}


Replace 50 with the max players allowed in your server.
#42
I dont know much about bots, but why cant the bot connect to the server like a script?
Then make sure in the config.ini file for the server, 'RconMaxUsers' is set to 2 or more.
#43
mIRC/pawn Scripting / Re: Only 1 little question! :D
January 30, 2008, 06:29:44 AM
Oh I see in your picture that you have stored the vehicle model ids and not the vehicle ids related to your config.ini file.

The only way I can think to get a player's vehicle model id, is from when they enter a vehicle.

If you feel you can add the code inside the 4 signals to the 4 signals in your script, and add the 2 alias's to your script, then do so.
Otherwise just put these 4 signals and 2 alias's into a new blank script.

The reason for this is you cannot have 2 of the same signal names in the same script, and I am assuming that you already have these 4 signal names in your script.

on *:SIGNAL:vcmp.enter:{
  var %name = $1, %id = $vcmp.getid(%name)
  !hadd -m vcmp %id $+ .carmodelid $3
}
on *:SIGNAL:vcmp.exit:{
  var %name = $1, %id = $vcmp.getid(%name)
  !hdel vcmp %id $+ .carmodelid
}
on *:SIGNAL:vcmp.kill:{
  var %name = $2, %id = $vcmp.getid(%name)
  !hdel vcmp %id $+ .carmodelid
}
on *:SIGNAL:vcmp.part:{
  var %name = $1, %id = $vcmp.getid(%name)
  !hdel vcmp %id $+ .carmodelid
}
alias vcmp.carmodelid !return $iif($hget(vcmp,$1 $+ .carmodelid) != $null,$v1,-1)
alias vcmp.carname !return $iif($readini(vcmp.data.ini,cars,$vcmp.carmodelid($1)) != $null,$v1,Unknown)


And here is the other code

elseif ($2 == !car) || ($2 == !pmcar) {
    if ($vcmp.cmdcheck(!car,%id) == fail) !halt   
    elseif (%a == -1) vcmp.msg %id Error - Absent ID/Name
    elseif ($vcmp.vehicle(%a,id) == 0) vcmp.msg %id Error - $vcmp.name(%a) is currently on foot!
    else vcmp.msg %id Vehicle - Name: $vcmp.carname(%a) , ID: $+($chr(91),$vcmp.vehicle(%a,id),$chr(93)) , Damage: $+($chr(91),$calc(100 - $vcmp.vehicle(%id,hp)),%,$chr(93)) $+
  }


Hope it works,
Mex
#44
mIRC/pawn Scripting / Re: Four NEW questions
January 29, 2008, 05:45:19 PM
Quote from: szostol on January 29, 2008, 12:07:28 PM
2. Ok it work in !brb command, but where write it in !anmsg command?

Change
vcmp.announce %a $4
to
vcmp.announce %a $4-

Quote from: szostol on January 29, 2008, 12:07:28 PM
1. I don't understand can you write all /c report command for me?

on *:SIGNAL:vcmp.command2:{
  var %name = $1, %id = $vcmp.getid(%name)
  if (!report* iswm $2) || (!pmreport* iswm $2) {
    if ($vcmp.cmdcheck(!report,%id) == fail) !halt
    elseif ($4 == $null) vcmp.msg %id Error - Missing Information, $2 <name> <reason>
    else {
      vcmp.msg %id You sent report, Thanks you for your support!
      !write vcmp.report.ini $vcmp.name(%a) - $4-
    }
  }
}


If that doesn't work try replacing
  var %name = $1, %id = $vcmp.getid(%name)
with
  var %id = $1, %name = $vcmp.name(%id)
#45
mIRC/pawn Scripting / Re: Four NEW questions
January 29, 2008, 02:21:44 AM
Quote from: szostol on January 28, 2008, 07:52:42 PM
1. How to make pm commands? I did !report but i want to make same as it's on LW /c report because it's very very good idea.

If you're using the GUS script by Tommis the signal name for /c commands is 'vcmp.command2', so:

on *:SIGNAL:vcmp.command2:{
  ;$1 = nick or id, cant remember
  ;$2 = first word
}


Quote from: szostol on January 28, 2008, 07:52:42 PM
I wanna know how to make to don't need use some hyphens as " _ " so i wanna example !anmsg szostol stop spamming on chat

Put a dash on the end of the $4 identifier, (or whichever identifier you are using to refer to the "text"), such as $4-
"$4-" is the same as "$4 $5 $6 $7 $8" etc etc, but in one identifier.