Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: Zack on February 08, 2009, 12:11:25 pm

Title: How can i show this? + Random Question
Post by: Zack on February 08, 2009, 12:11:25 pm
Hello
(http://i43.tinypic.com/11iiplf.png)

My question is: How can i show that purple text, that you can see on the image(i have the image from a Youtube Video).

PS: My english is not good... I hope you understand me :o .
Title: Re: How can i show this?
Post by: thijn on February 08, 2009, 03:25:09 pm
The code for it is ~p~ ;)
So it would be:
Code: [Select]
vcmp.announce %id ~p~Force is a heli nub

;D
Title: Re: How can i show this?
Post by: Zack on February 08, 2009, 04:29:02 pm
And how can i activate that?

I have another question:

I want to make a "Army-Job", you have to type a code like !badplayer and the server choose then a random player.

Can you tell me to where i must add that at the scripts? I am a new scripter.

Title: Re: How can i show this? + Random Question
Post by: [NoN]Toiletduck on February 08, 2009, 05:20:24 pm
Well one thing is that the colour of the announcement is determined by this: ~p~ or ~y~.

I do not know what the other colours are.  Does anyone have a list?
Title: Re: How can i show this? + Random Question
Post by: Knucis on February 08, 2009, 05:42:29 pm
I had one, but I formated my pc, let me see if i remember some:
~h~ --White [I think]
~p~
~~ --- Black [Maybe have some bugs]
~y~
~r~ [I think]
~x~ -- Strange color
~q~

etc...
Title: Re: How can i show this? + Random Question
Post by: Mex on February 08, 2009, 09:28:17 pm
i think ~b~ was also one, blue i think
Title: Re: How can i show this? + Random Question
Post by: Zack on February 08, 2009, 10:40:32 pm
Thanks.
But can you answer too my other question, please?:

I want to make a "Army-Job", you have to type a code like !badplayer and the server choose then a random player.

Can you tell me to where i must add that at the scripts? I am a new scripter.
Title: Re: How can i show this? + Random Question
Post by: Mex on February 09, 2009, 12:04:00 am
It needs to be added inside the vcmp.command signal if your using GUS 9.0.

try this

Code: [Select]
on *:SIGNAL:vcmp.command:{
  if ($2 == !badplayer) {
    var %a = 0, %b = $vcmp.maxplayers, %c, %randomid
    while (%a < %b) {
      if ($vcmp.name(%a) != Unknown) { %c = $addtok(%c, %a, 32) }
      !inc %a
    }
    if (%c == $null) { ;no players in server }
    else {
      %randomid = $gettok(%c, $rand(1, $numtok(%c, 32)), 32)
      ; the %randomid variable contains a random player id
    }
  }
}
Title: Re: How can i show this? + Random Question
Post by: Zack on February 09, 2009, 07:08:19 pm
Thank you.
But i was changing a little bit the script (i am learning so i test much) and i have the next script:
Code: [Select]
  elseif (!minigame1* iswm $2) || (!minigame1* iswm $2) {
    if ($vcmp.cmdcheck(!minigame1,%id) == fail) !halt
    else {
      .timer 1 1 vcmp.cmdsay $2 %id Minigame 1 [ARMY-MISSION] is activated by %name . Please wait...
      .timer 1 5 vcmp.cmdsay $2 %id The server will choose soon a random ID.
      .timer 1 8 vcmp.cmdsay $2 %id Your task is to kill that ID and do that so much as possible.
      .timer 1 12 vcmp.cmdsay $2 %id While they are searching for you, you may run away and shoot back too!
      .timer 1 15 vcmp.cmdsay $2 %id You have 120 seconds to kill him so much as you can.
      .timer 1 20 vcmp.cmdsay $2 %id The choosen player is: $vcmp.name($vcmp.randomid)
      .timer 1 21 vcmp.cmdsay $2 %id You have 120 seconds to kill him.
      .timer 1 120 vcmp.cmdsay $2 %id Minigame 1 [ARMY-MISSION] is over. There are no prices in this BETA!
    }
  }

The problem is: The server is choosing always 1 user: "Unknown"  :P .

Thijn was trying to help me, but i didnt work. Can someone tell me what's wrong ??? ?

EDIT2: I have a big problem: I have now a Fix-System, but the scripts are closing himself after 10 seconds. How can i make this?
Title: Re: How can i show this? + Random Question
Post by: [NoN]Toiletduck on February 09, 2009, 08:14:35 pm
What error message do you receive?
Title: Re: How can i show this? + Random Question
Post by: Zack on February 09, 2009, 08:20:19 pm
What error message do you receive?

Its no error, Vista give me the error(i translate it from dutch): MIRC didnt work anymore(or something). The repair-script is done and the MIRC is closing himself(i have this only when i use the repair command).


The Server says: Rcon: Admin [127.0.0.1] has lost connection.
Title: Re: How can i show this? + Random Question
Post by: thijn on February 09, 2009, 09:25:35 pm
Thank you.
But i was changing a little bit the script (i am learning so i test much) and i have the next script:
Code: [Select]
  elseif (!minigame1* iswm $2) || (!minigame1* iswm $2) {
    if ($vcmp.cmdcheck(!minigame1,%id) == fail) !halt
    else {
      .timer 1 1 vcmp.cmdsay $2 %id Minigame 1 [ARMY-MISSION] is activated by %name . Please wait...
      .timer 1 5 vcmp.cmdsay $2 %id The server will choose soon a random ID.
      .timer 1 8 vcmp.cmdsay $2 %id Your task is to kill that ID and do that so much as possible.
      .timer 1 12 vcmp.cmdsay $2 %id While they are searching for you, you may run away and shoot back too!
      .timer 1 15 vcmp.cmdsay $2 %id You have 120 seconds to kill him so much as you can.
      .timer 1 20 vcmp.cmdsay $2 %id The choosen player is: $vcmp.name($vcmp.randomid)
      .timer 1 21 vcmp.cmdsay $2 %id You have 120 seconds to kill him.
      .timer 1 120 vcmp.cmdsay $2 %id Minigame 1 [ARMY-MISSION] is over. There are no prices in this BETA!
    }
  }

The problem is: The server is choosing always 1 user: "Unknown"  :P .

Thijn was trying to help me, but i didnt work. Can someone tell me what's wrong ??? ?

EDIT2: I have a big problem: I have now a Fix-System, but the scripts are closing himself after 10 seconds. How can i make this?
Like I said, You need to add the vcmp.randomid alias wich I made (with base from Mex, Thanks for that)

Code: [Select]
alias vcmp.randomid {
var %a = 0, %b = $vcmp.maxplayers, %c, %randomid
while (%a < %b) {
if ($vcmp.name(%a) != Unknown) %c = $addtok(%c, %a, 32)
!inc %a
}
if (%c == $null) {
!return 0
}
else {
%randomid = $gettok(%c, $rand(1, $numtok(%c, 32)), 32)
!return %randomid
}
}
}
Just add that alias to your other Aliases ;) Then it should work
Title: Re: How can i show this? + Random Question
Post by: Zack on February 09, 2009, 09:48:12 pm
When i add that script to "alias" MIRC says:


Code: [Select]
VCMP General Use Scripts v9.00 - Loaded/Started
VCMP General Use Scripts v9.00 - Attempting to Connect
-
* /vcmp.check.ini: not connected to server (line 33, vcmp.mrc)
-
Title: Re: How can i show this? + Random Question
Post by: Mex on February 09, 2009, 11:20:14 pm
jus to confirm; the code thijn posted should be put inside the Remote tab in mirc, and outside the scope of any other alias's or events.

this error that your getting:
Code: [Select]
* /vcmp.check.ini: not connected to server (line 33, vcmp.mrc)means that on line 33 in vcmp.mrc, mIRC attempted to call an alias called "vcmp.check.ini",
however it could not find the alias in any scripts that you have loaded.

possiby you have removed some code which contained this alias? or are missing an enite script?
Title: Re: How can i show this? + Random Question
Post by: Zack on February 10, 2009, 06:48:47 pm
The scripts are working again... There's a problem with thijn's Alias.

 ;D . The scripts are fixed, the !fix-problem is fixed... I try soon again the Alias ??? .
Title: Re: How can i show this? + Random Question
Post by: Mex on February 10, 2009, 07:38:02 pm
There's a problem with thijn's Alias.

Remove the last } ;)
Title: Re: How can i show this? + Random Question
Post by: Zack on February 10, 2009, 09:17:44 pm
Thank you, the alias is working now, but the script is still saying the same: Unknown.

Is it maybe becouse i am the only one in the server?
Title: Re: How can i show this? + Random Question
Post by: Mex on February 11, 2009, 04:32:12 pm
Is it maybe becouse i am the only one in the server?

That probably isn't the problem.


The reason it is always saying "Unknown" as the name is because in this line:
Code: [Select]
.timer 1 20 vcmp.cmdsay $2 %id The choosen player is: $vcmp.name($vcmp.randomid)
The $vcmp.randomid alias is not returning the correct value.

It may not be returning the correct value because it might not be finding the alias.
Make sure that you have a script loaded with the alias inside it.

Also try pressing 'Control' and 'h' in the mirc scripts editor, which will properly align all the code in that script with indentation, and inform you of any { and } bracket errors.

If it says you have bracket errors, then try placing the code in another blank script for the alias to work, or fix the bracket errors :p


Also it could be a bug in the vcmp.randomid alias i guess, but i cant see anything wrong with it :s
Title: Re: How can i show this? + Random Question
Post by: Zack on February 11, 2009, 04:42:05 pm
Woot! Thank you very much all. The server says now:
The choosen player is: Zack  ;D.

The only problem is that i am the only one in the server, so i am not 100% sure the server is choosing a random id.