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.


Messages - Mex

Pages: 1 [2] 3 4 5
16
mIRC/pawn Scripting / Re: scripting.
« on: February 08, 2009, 06:05:41 am »
yeh you need to know the basics of scripting before you can create those kind of commands

check my post in this topic, it may help you
http://forum.vicecitymultiplayer.com/index.php?topic=1042.0

17
mIRC/pawn Scripting / Re: Help a new scripter our please.
« on: February 01, 2009, 02:35:53 am »
can u explain more of them by examples???

sure
what do you want me to explain?

18
mIRC/pawn Scripting / Re: Help a new scripter our please.
« on: January 11, 2009, 06:04:46 am »
Well first of all, you will need the following:
VCMP Server Software
VCMP Client Software
mIRC Software

When the VCMP Server Software is running, it enables other people to connect to your server.
(You may need to make some changes to other software for others to actually be able to connect to your server, such as opening ports in your router and firewall.)

The VCMP client server simply allows you to connect to another computer running the VCMP server software.

mIRC.
Designed for chatroom stuff, but thanks to it's amazing built-in scripting language features, it has the ability to send/receive data to other software such as the VCMP server software.



Scripting is based on events.  Events are simply things that happen.  A few examples of events are:
A player gets into a vehicle.
A player leaves a server.
A player types some text.
A player kills another player.

When certain events occur, the VCMP server software sends data to all the mIRCs connected to the VCMP server software.
mIRC receives that data, and depending on what that data is, mIRC will know which event just happened!
The VCMP server software also sends event-specific data to mIRC.
Such as if the event was "A player gets into a vehicle", the other data sent would be the ID of the player that got into the vehicle, and the ID of the vehicle that the player got in to.

So basically:
Event occurs in VCMP -> Inform mIRC of the event


mIRC will then read your script, and execute the code in it.

--

Lets say for example, I wanted to kick a player when they typed !kickme
Here is the code that should work with GUS 9.0

on *:SIGNAL:vcmp.command:{
  if ($2 == !kickme) vcmp.kick $1
}

So the first line is: on *:SIGNAL:vcmp.command:{
There are 3 parts to this line, each part is seperated by a colon.

First part: on *
The word "on" tells mIRC that the code is an event.
The * is something to do with the chatroom-side of mIRC, so don't worry about that.

Second part: SIGNAL
This word just tells mIRC that the event is a signal.
(This is needed because there are other types of events apart from Signals in mIRC.)

Third part: vcmp.command
This is simply the name of the Signal.
Different Signal names are used for different events.
For example, using GUS 9.0, the Signal name for a player spawning is: vcmp.spawn


The 2 brackets { and } simply surround code.
When the vcmp.command signal occurs, the code inside those curly brackets will be executed.


Now the line of code inside these curly brackets is: if ($2 == !kickme) vcmp.kick $1

This is a basic if statement.
A basic if statement works by comparing 2 values.
The 2 values in this if statement are "$2" and "!kickme"

$2 is an identifier.
The $ sign tells mIRC that it is an identifier.
The number to the right of the $ sign, tells mIRC which value to fetch.

Remember earlier I mentioned about the VCMP server software sending data to mIRC, and it also sends other data, such as the ID of the player and the ID of the vehicle?
Well this is how we fetch that other data.

When mIRC reads an identifier, it will replace it with it's actual value.

Inside the vcmp.command signal, here are the values sent to the signal:
$1 is the ID of the player who typed the command.
$2 is the command the player typed.
$3 is the first word the player typed after the command.
$4 is the second word the player typed after the command.
$3- is all the words the player typed after the command.


Now back to the if statement.
Remember what we originally wanted.  To kick the player if they typed !kickme
So we won't need to use $3, as we don't care what the player typed after the command.
We will need to use $2, because $2 contains the command that the player typed.
If the player didn't type !kickme, then we don't want the "vcmp.kick $1" code being executed

The if statement: if ($2 == !kickme)
is just like saying: if the player typed the command !kickme, then do some code

Now the code to do, is: vcmp.kick $1
Remember, $1 holds the ID of the player who typed the command
When mIRC reads "vcmp.kick $1" it will kick the player who has the ID $1 (if $1 holds the value 7, it will kick the player with ID 7)

So to sum it all up:
VCMP event happens in client (player types !kickme) -> VCMP client tells VCMP server what happened -> VCMP server tells mIRC what happened -> mIRC reads your script -> mIRC tells the VCMP server to kick the player

There's alot more to mIRC scripting than that ofcourse.

Anyway, hope it has helped you. :)


Edit:
If you want to know more about the features of mIRC scripting or the VCMP possibilites, just say so ;)

19
mIRC/pawn Scripting / Re: Counting
« on: November 21, 2008, 01:38:37 am »
try this

Code: [Select]
var %a = 1, %b = $ini(filename.ini,section,0), %c = 0
while (%a <= %b) {
  if (xy* iswm $ini(filename.ini,section,%a)) { !inc %c }
  !inc %a
}
!echo -a total items in section that match xy*: %c

[edit]
the above code is for if the ini layout is like:
[section]
xy1=value
xy2=value
xy3=value
etc

if your ini layout is like:
[section]
item=xy1
item2=xy2
item3=xy3

then try this:
Code: [Select]
var %a = 1, %b = $ini(filename.ini,section,0), %c, %d = 0
while (%a <= %b) {
  %c = $ini(filename.ini,section,%a)
  if (xy* iswm $readini(filename.ini,n,section,%c)) { !inc %d }
  !inc %a
}
!echo -a total values in section that match xy*: %d

20
mIRC/pawn Scripting / Re: /writeini: insufficient parameters
« on: July 23, 2008, 02:02:06 am »
The $vcmp.hgetname($1) identifier is returning $null, which means it will not be included as a parameter for the !writeini command, thus resulting in the message "insufficient parameters".

21
mIRC/pawn Scripting / Re: Skin
« on: June 19, 2008, 05:02:49 pm »
0.3x was released then 0.3z was released.. so 0.3x was just a previous version of vcmp

im not sure how to get co-ords in buildmode soz..

22
mIRC/pawn Scripting / Re: Very Confused
« on: May 16, 2008, 06:05:21 am »
but here it seems its all done through MIRC or something!!

basically mIRC connects to the vcmp server using a DLL file.

The server sends data to the DLL when an event happens, then calls signals in all running script/s.  Eg. A player spawns, or enters a vehicle.
mIRC can send data to a DLL file, which can retrieve value/s from the server or do something which doesn't require a value retrieved to the server.  Eg. Getting a player's health, or kicking a player from the server.

23
mIRC/pawn Scripting / Re: Set Car Health
« on: May 07, 2008, 07:01:48 am »
But Argonath RPG has it working?

We use a method to work around this.

24
mIRC/pawn Scripting / Re: Set Car Health
« on: April 28, 2008, 12:51:54 am »
Setting a vehicle's health is bugged, the car will either set on fire or set the health to like 3 million hp.

25
Vice City / Re: [HELP] A few things
« on: April 09, 2008, 07:56:08 pm »
You should forward the port which your server is setup on, you can find this port in your config.ini file.
The line will look like this:
Code: [Select]
ListenPort = 51925192 is the default port.

Then you will need to enter your router's IP address into your browser.
Check this link for your router's IP, select your router brand and model, then choose any software name.
(Several router's IPs start with 192.168)
http://www.portforward.com/english/routers/port_forwarding/routerindex.htm

You can then try following the instructions given to open a port for that software, replacing the port they tell you, with the port your vcmp server is running on.

Hope this helps.

26
mIRC/pawn Scripting / Re: Get spawned players
« on: March 31, 2008, 07:25:59 pm »
You could probably loop around all the players and check their speed.
Though it wouldn't work if a player's location changes as they switch through skins on the spawn screen, i'm not sure if it does.

27
mIRC/pawn Scripting / Re: readini variable
« on: March 31, 2008, 07: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:

Code: [Select]
[section]
bob=hacking

And your script was this:

Code: [Select]
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.

28
mIRC/pawn Scripting / Re: Question about releasing scripts
« on: March 23, 2008, 06:16:06 pm »
Its possible to stop people editing it using a DLL.
But I dont think its possible to 'hide' the script.

29
mIRC/pawn Scripting / Re: Scripting Help :]
« on: March 23, 2008, 06:14:30 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

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.

Code: [Select]
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)

30
mIRC/pawn Scripting / Re: IRC commands in game
« on: February 22, 2008, 07:19:52 pm »
:S I know how this is very hard, but need.

It will become harder when you try !connect when the script is disconnected.

Pages: 1 [2] 3 4 5