Vice City Multiplayer
VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: mbalee on December 01, 2007, 06:12:36 pm
-
elseif ($2 == !players) || ($2 == !pmplayers) {
if ($vcmp.cmdcheck(!players,%id) == fail) !halt
else {
var %aa = 0,%bb,%cc,%dd
while (%aa <= 50) {
if ($vcmp.level(%aa) >= 1) {
if (!%bb) %bb = $vcmp.name(%aa) $+ ;
elseif ($numtok(%bb,32) <= 7) %bb = %bb $vcmp.name(%aa) $+
elseif (!%cc) %cc = $vcmp.name(%aa) $+
elseif ($numtok(%cc,32) <= 7) %cc = %cc $vcmp.name(%aa) $+
elseif (!%dd) %dd = $vcmp.name(%aa) $+
elseif ($numtok(%dd,32) <= 7) %dd = %dd $vcmp.name(%aa) $+
}
!inc %aa
}
if (%bb) {
vcmp.cmdsay $2 %id Online Players: *$calc...?????????
if (%cc) vcmp.cmdsay $2 %id %cc
if (%dd) vcmp.cmdsay $2 %id %dd
}
}
}
*What write here???
-
Hey, what exactly are you trying to do?
Also you haven't displayed the %bb variable, so try replacing
*$calc...
with
%bb
-
I would like it with numbers!
... Online Players: [17/30]
-
Ah ok, if you only want the numbers displayed and not the player's names then this should work:
elseif ($2 == !players) || ($2 == !pmplayers) {
if ($vcmp.cmdcheck(!players,%id) == fail) !halt
else {
var %aa = 0,%bb = 0
while (%aa <= 50) {
if ($vcmp.level(%aa) >= 1) {
inc %bb
}
inc %aa
}
vcmp.cmdsay $2 %id Online Players: $+($chr(90),%bb,/30,$chr(91))
}
}
Also dont forget to add the command name (!players) and its required-to-use level to the ini file.
Also this will only count the players who's level is more than or equal to 1.
If you want the script to count all players in the server, no matter what their level is, then use this instead:
elseif ($2 == !players) || ($2 == !pmplayers) {
if ($vcmp.cmdcheck(!players,%id) == fail) !halt
else {
var %aa = 0,%bb = 0
while (%aa <= 50) {
if ($vcmp.name(%aa) != Unknown) {
inc %bb
}
inc %aa
}
vcmp.cmdsay $2 %id Online Players: $+($chr(90),%bb,/30,$chr(91))
}
}
-
sorry, but your command is wrong! :S :(
writes this to me: Z1/30
-
Hey sorry about that, I used the wrong ASCII values.
Here they are again fixed:
elseif ($2 == !players) || ($2 == !pmplayers) {
if ($vcmp.cmdcheck(!players,%id) == fail) !halt
else {
var %aa = 0,%bb = 0
while (%aa <= 30) {
if ($vcmp.level(%aa) >= 1) {
inc %bb
}
inc %aa
}
vcmp.cmdsay $2 %id Online Players: $+($chr(91),%bb,/30,$chr(93))
}
}
elseif ($2 == !players) || ($2 == !pmplayers) {
if ($vcmp.cmdcheck(!players,%id) == fail) !halt
else {
var %aa = 0,%bb = 0
while (%aa <= 30) {
if ($vcmp.name(%aa) != Unknown) {
inc %bb
}
inc %aa
}
vcmp.cmdsay $2 %id Online Players: $+($chr(91),%bb,/30,$chr(93))
}
}
Also this will now only check for up to 30 players, as I assumed your server had a max players of 30.
-
Sry..., but what is this???!!!
I was not curious about this!!!!
$calc...
NOT [ and ] CHARACTERS!!
To count out the on-line players!
Please!
-
... Online Players: [17/30]
NOT [ and ] CHARACTERS!!
Ok then try this.
elseif ($2 == !players) || ($2 == !pmplayers) {
if ($vcmp.cmdcheck(!players,%id) == fail) !halt
else {
var %aa = 0,%bb = 0
while (%aa <= 30) {
if ($vcmp.name(%aa) != Unknown) {
inc %bb
}
inc %aa
}
vcmp.cmdsay $2 %id Online Players: %bb $+ /30
}
}
-
OK! Sry, I was me the idiotic. Works.