Vice City Multiplayer
VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: Amenine on December 30, 2008, 06:27:31 pm
-
Here ..its not working..anything wrong in it,,
Code:
elseif ($2 == !danger) {
var %a = 0,%c = -100
while (%aa <= %MaxPlayers) {
if ((%ratio > %c) var %b = $vcmp.name(%a),%c = %ratio
elseif ((%ratio == %c) {
if ($vcmp.kills(%b) > $vcmp.kills(%a)) { }
elseif ($vcmp.kills(%b) < $vcmp.kills(%a)) var %b = $vcmp.name(%a),%c = %ratio
}
!inc %aa
}
if (%b) vcmp.say == %b is the most dangerous player with a ratio of %c
else { }
}
Thanks
Amenine
-
I don't see the %aa or %ratio variable defined there....
-
What do u mean??
Means:How it shows the ratio of the player..??
Edit:[/b]:var %ratio = $round($calc($vcmp.kills(%a) / $vcmp.deaths(%a)),2)
..This..??
Confusing
Amenine
-
You can't take a variable from somewhere else in the script, it has to be under the particular part.
Aka, If you had this:
var %ratio = blalh
vcmp.say Stats: Blalh - Kills: 11111 - Deaths: 1111 - Ratio: %ratio
You can't then do:
elseif ($2 == !danger) {
var %a = 0,%c = -100
while (%aa <= %MaxPlayers) {
if ((%ratio > %c) var %b = $vcmp.name(%a),%c = %ratio
elseif ((%ratio == %c) {
if ($vcmp.kills(%b) > $vcmp.kills(%a)) { }
elseif ($vcmp.kills(%b) < $vcmp.kills(%a)) var %b = $vcmp.name(%a),%c = %ratio
}
!inc %aa
}
if (%b) vcmp.say == %b is the most dangerous player with a ratio of %c
else { }
}
because it doesn't know where the %ratio variable is. Same applies for the missing %aa variable you have but your using.
-
I found the problem with Amenine's script is that he removed half of the script.
elseif (!stat* iswm $2) || (!pmstat* iswm $2) {
var %ratio = $round($calc($vcmp.kills(%a) / $vcmp.deaths(%a)),2)
if ($vcmp.cmdcheck(!stats,%id) == fail) !halt
elseif (%a == -1) vcmp.msg %id Error - Absent ID/Name
else vcmp.say $vcmp.name(%a) $+ 's Stats - Joins: $vcmp.joins(%a) $+ , Kills: $vcmp.kills(%a) $+ , Deaths: $vcmp.deaths(%a) $+ , Ratio: %ratio ,
}