• 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

#16
i think ~b~ was also one, blue i think
#17
mIRC/pawn Scripting / Re: Please help
February 08, 2009, 04:11:05 AM
just fort i'd mention, as you've got more than 1 condition in your elseif statement, you should put an extra set of ( ) around the first and last condition.

so
elseif (!levelupapp* iswm $2) || (!pmlevelupapp* iswm ?2) {
should be
elseif ((!levelupapp* iswm $2) || (!pmlevelupapp* iswm ?2)) {


even though the way you had it may work, that is the way it should be done ;)
#18
mIRC/pawn Scripting / Re: scripting.
February 08, 2009, 04: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
#19
mIRC/pawn Scripting / Re: Help a new scripter our please.
February 01, 2009, 12:35:53 AM
Quote from: Faramir on January 11, 2009, 09:42:50 PM
can u explain more of them by examples???

sure
what do you want me to explain?
#20
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 ;)
#21
mIRC/pawn Scripting / Re: Counting
November 20, 2008, 11:38:37 PM
try this

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:
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
#22
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".
#23
Videos and Screenshots / Re: 0.4 preview video
July 06, 2008, 01:27:30 AM
Quote from: bakasan on June 06, 2008, 12:14:10 PM
thats coming soon...

awesome, i cant wait to start learning pawn.
the video looks great.
#24
mIRC/pawn Scripting / Re: Skin
June 19, 2008, 04: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..
#25
mIRC/pawn Scripting / Re: Very Confused
May 16, 2008, 05:05:21 AM
Quote from: JaTochNietDan on May 08, 2008, 09:54:32 PM
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.
#26
mIRC/pawn Scripting / Re: Set Car Health
May 07, 2008, 06:01:48 AM
Quote from: GTA-Roloboy on May 01, 2008, 04:17:38 PM
But Argonath RPG has it working?

We use a method to work around this.
#27
mIRC/pawn Scripting / Re: Set Car Health
April 27, 2008, 11:51:54 PM
Setting a vehicle's health is bugged, the car will either set on fire or set the health to like 3 million hp.
#28
Vice City / Re: [HELP] A few things
April 09, 2008, 06: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:
ListenPort = 5192
5192 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.
#29
Script Showroom / Re: New VC-MP mIRC Admin
March 31, 2008, 06:37:47 PM
wow this looks sweet, great work :)
#30
mIRC/pawn Scripting / Re: Get spawned players
March 31, 2008, 06: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.