Jump to content

please find error in my script!For Mta:ma sa


NextDeaD

Recommended Posts

it just a part of script .this part must work when race finish.this part must give money to player if he bet on winner.

look and find error plz!

elseif ($readini($scriptdir $+ bet.ini,PLAYERS,$mta.nick($1,%a)) = $readini($scriptdir $+ rank.ini,rank1,$mta.rank($1,$2))) {

!.timer 1 2 !writeini -n " $+ $scriptdir $+ RPG.ini" CASH $readini($scriptdir $+ bet.ini,OVPLAYERS,$mta.nick($1,$2) $gus.add($gus.cash($1,%a),100)

!.timer 1 2 !remini -n " $+ $scriptdir $+ Rank.ini" RANK1 $mta.rank($1,$2))

!remini -n " $+ $scriptdir $+ bet.ini" PLAYERS $mta.nick($1,%a))

!remini -n " $+ $scriptdir $+ bet.ini" MONEY $mta.nick($1,%a))

!remini -n " $+ $scriptdir $+ bet.ini" OVPLAYERS $mta.nick($1,$2))

}

it last part of script .i know that error here!

Link to comment

i think i know where error !error in this code: $readini($scriptdir $+ bet.ini,PLAYERS,$mta.nick($1,%a)) == $readini($scriptdir $+ rank.ini,rank1,$mta.rank($1,$2))

becose $readini($scriptdir $+ bet.ini,PLAYERS,$mta.nick($1,%a)) - nick of player!(it not number) and $readini($scriptdir $+ rank.ini,rank1,$mta.rank($1,$2)) - it nick of winner

maybe error in this?

Link to comment
so maybe you can write correct part of script where. if nick from one .ini were = nick from other .ini

who can write this line???

this part must be in on *:SIGNAL:mta.finish: ?

Is it a seperate script? or something you copied and just need adding to GUS?

Post ur mta.finish alias and i'll take a look. That script u posted wasnt right or wasnt from mta.finish, ur getting the errors coz brackets are missing ete, and ur using %a when i cant see what u have defined it as.

either way, i cant see how u can check everyones bets from just that.

Post ur mta.finish alias and we can see better.

Link to comment

this is alias and Mta.finish from my mta gus file

on *:SIGNAL:mta.disconnect:{

if (%recon == on) {

!.timer 1 1 mta.connect $1

}

}

/*

/////////////////////////////////////////////////////

//////////////MTA:mA:General Use Scripts/////////////

/////////////////////////////////////////////////////

// Creators: [XE]Tommis, [uVA]Kevwuk, [FMJ]master //

// ..Please remember to update.. //

/////////////////////////////////////////////////////

*/

alias gus.getid {

var %a = 0

while (%a <= $mta.server($1).cmax) {

if ($+(*,$2,*) iswm $mta.nick($1,%a)) !return %a

!inc %a

}

!return -1

}

alias gus.adm {

if ($readini($scriptdir $+ admin.ini,ADMIN,$mta.nick($1,$2)) != $null) !return $readini($scriptdir $+ admin.ini,ADMIN,$mta.nick($1,$2))

else !return 0

}

alias gus.Playerbet {

if ($readini($scriptdir $+ bet.ini,MONEY,$mta.nick($1,%a)) != $null) !return $readini($scriptdir $+ bet.ini,MONEY,$mta.nick($1,%a))

else !return 0

}

alias gus.ovPlayerbet {

if ($readini($scriptdir $+ bet.ini,OVPLAYERS,$mta.nick($1,$2)) != $null) !return $readini($scriptdir $+ bet.ini,OVPLAYERS,$mta.nick($1,$2))

else !return 0

}

alias gus.Moneybet {

if ($readini($scriptdir $+ bet.ini,MONEY,$mta.nick($1,%a)) != $null) !return $readini($scriptdir $+ bet.ini,MONEY,$mta.nick($1,%a))

else !return 0

}

alias gus.iscash {

if ($readini($scriptdir $+ RPG.ini,CASH,$mta.nick($1,$2)) == $null) !return 0

else !return 1

}

alias gus.cash {

if ($readini($scriptdir $+ RPG.ini,CASH,$mta.nick($1,$2)) != $null) !return $readini($scriptdir $+ RPG.ini,CASH,$mta.nick($1,$2))

else !return 0

}

alias gus.nameitems {

if ($readini($scriptdir $+ RPG.ini,ITEMS,$mta.nick($1,$2)) != $null) !return $readini($scriptdir $+ RPG.ini,ITEMS,$mta.nick($1,$2))

else !return N/A

}

alias gus.items {

!return $readini($scriptdir $+ RPG.ini,ITEMS,$mta.nick($1,$2))

}

alias gus.Admin1 !return $readini($scriptdir $+ RPG.ini,ITEMS,Adminlvl_1)

alias gus.freezetime !return $readini($scriptdir $+ RPG.ini,ITEMS,Freeze)

alias gus.mutetime !return $readini($scriptdir $+ RPG.ini,ITEMS,Mute)

alias gus.time {

if ($gettok($mta.time($1,$2).text,1,58) != 00) !return $gettok($mta.time($1,$2).text,1,58) $+ mins $gettok($mta.time($1,$2).text,2,58) $+ . $+ $gettok($mta.time($1,$2).text,3,58) $+ secs

else !return $gettok($mta.time($1,$2).text,2,58) $+ . $+ $gettok($mta.time($1,$2).text,3,58) $+ secs

}

alias gus.pingkick {

var %a = 0,%b = 0

while (%a = $gus.maxping($1) && $mta.ping($1,%a) != 0) {

mta.text $1 Kicking $mta.nick($1,%a) - Ping: $mta.ping($1,%a) - Max Ping: $gus.maxping($1) $mta.kick($1,%a)

!inc %b

}

}

!inc %a

}

}

alias gus.maxping !return $iif($readini($scriptdir $+ admin.ini,PING,max),$readini($scriptdir $+ admin.ini,PING,max),Off)

alias gus.version !return x16 Finall

alias ClassC {

if (($1) && (*.*.*.* iswm $1)) return $gettok($1,1-3,46) $+ .*

}

alias ClassB {

if (($1) && (*.*.*.* iswm $1)) return $gettok($1,1-2,46)

}

alias gus.trace {

set %ip $mta.ip($1,$2)

set %tr.name $mta.nick($1,$2)

set %tr.serv $1

if ($readini($scriptdir $+ gus.dns.ini,CACHE,$ClassC($mta.ip($1,$2)))) mta.text $1 $mta.nick($1,$2) $+ (IP: $gettok($mta.ip($1,$2),1-2,46) $+ .***.*** $+ ) - Location: $readini($scriptdir $+ gus.dns.ini,CACHE,$ClassC($mta.ip($1,$2)))

else {

if (!$sock(gus.trace $+ %ip)) sockopen gus.trace $+ %ip http://www.dnsstuff.com 80

}

}

alias gus.rpgwin {

%players = $mta.server($1).players

%rank = $mta.rank($1,$2)

if (%rank == 1) {

if (2 <= %players) {

mta.text $1 $mta.nick($1,$2) You came first out of %players Players $+ ! (Rank: First $+ ) (Money Earned: $chr(36) $+ $calc(50 * %players) $+ )

!writeini -n " $+ $scriptdir $+ RPG.ini" CASH $mta.nick($1,$2) $gus.add($gus.cash($1,$2),$calc(50 * %players))

}

elseif (1 = %players) {

mta.text $1 $mta.nick($1,$2) Playing with yourself earned you money too $+ ! (Rank: First $+ ) (Money Earned: $chr(36) $+ $calc(50 * %players) $+ )

!writeini -n " $+ $scriptdir $+ RPG.ini" CASH $mta.nick($1,$2) $gus.add($gus.cash($1,$2),$calc(50 * %players))

}

}

elseif (%rank == 2) {

if (2 <= %players) {

mta.text $1 $mta.nick($1,$2) You Came Second! (Money Earned: $chr(36) $+ $calc(25 * %players) $+ )

!writeini -n " $+ $scriptdir $+ RPG.ini" CASH $mta.nick($1,$2) $gus.add($gus.cash($1,$2),$calc(25 * %players))

!writeini -n " $+ $scriptdir $+ Rank.ini" RANK2 $mta.rank($1,$2) $mta.nick($1,$2))

}

}

elseif (%rank == 3) {

if (3 <= %players) {

mta.text $1 $mta.nick($1,$2) You Came Third! (Money Earned: $chr(36) $+ $calc(15 * %players) $+ )

!writeini -n " $+ $scriptdir $+ RPG.ini" CASH $mta.nick($1,$2) $gus.add($gus.cash($1,$2),$calc(15 * %players))

!writeini -n " $+ $scriptdir $+ Rank.ini" RANK3 $mta.rank($1,$2) $mta.nick($1,$2))

}

}

elseif (%rank == 4) {

if (4 <= %players) {

mta.text $1 $mta.nick($1,$2) You Came Fourth! (Money Earned: $chr(36) $+ $calc(10 * %players) $+ )

!writeini -n " $+ $scriptdir $+ RPG.ini" CASH $mta.nick($1,$2) $gus.add($gus.cash($1,$2),$calc(10 * %players))

}

}

elseif (%rank == 5) {

if (5 <= %players) {

mta.text $1 $mta.nick($1,$2) You Came Fifth ! (Money Earned: $chr(36) $+ $calc(6 * %players) $+ )

!writeini -n " $+ $scriptdir $+ RPG.ini" CASH $mta.nick($1,$2) $gus.add($gus.cash($1,$2),$calc(6 * %players))

}

}

elseif (%rank == 6) {

if (6 = $mta.time($1,$2) && $mta.rank($1,$2) == 1 && $mta.race($1) != $null) || ($gettok($readini($scriptdir $+ times.ini,TOP,$replace($mta.race($1),$chr(32),-)),2,32) == $null && $mta.rank($1,$2) == 1 && $mta.race($1) != $null) {

if ($gettok($readini($scriptdir $+ times.ini,TOP,$replace($mta.race($1),$chr(32),-)),2,32) != $null && $gettok($readini($scriptdir $+ times.ini,TOP,$replace($mta.race($1),$chr(32),-)),2,32) >= $mta.time($1,$2)) {

mta.text $1 Improved Best Time on $mta.race($1) $+ ! (Time: $gus.time($1,$2) $+ ) (By: $mta.nick($1,$2) $+ )

!writeini -n " $+ $scriptdir $+ times.ini" TOP $replace($mta.race($1),$chr(32),-) $mta.nick($1,$2) $mta.time($1,$2)

!writeini -n " $+ $scriptdir $+ times.ini" TIMES $replace($mta.race($1),$chr(32),-) $gus.time($1,$2)

!.timer 1 2 mta.text $1 $mta.nick($1,$2) Setting Better Best Time (Money Earned: $chr(36) $calc(200 * %players) )

!writeini -n " $+ $scriptdir $+ RPG.ini" CASH $mta.nick($1,$2) $gus.add($gus.cash($1,$2),$calc(200 * %players))

}

elseif ($gettok($readini($scriptdir $+ times.ini,TOP,$replace($mta.race($1),$chr(32),-)),2,32) == $null && $gettok($readini($scriptdir $+ times.ini,TOP,$replace($mta.race($1),$chr(32),-)),1,32) == $null) {

mta.text $1 New Best Time on $mta.race($1) $+ ! (Time: $gus.time($1,$2) $+ ) (By: $mta.nick($1,$2) $+ )

!writeini -n " $+ $scriptdir $+ times.ini" TOP $replace($mta.race($1),$chr(32),-) $mta.nick($1,$2) $mta.time($1,$2)

!writeini -n " $+ $scriptdir $+ times.ini" TIMES $replace($mta.race($1),$chr(32),-) $gus.time($1,$2)

!.timer 1 2 mta.text $1 $mta.nick($1,$2) Setting New Best Time (Money Earned: $chr(36) $calc(100 * %players) )

!writeini -n " $+ $scriptdir $+ RPG.ini" CASH $mta.nick($1,$2) $gus.add($gus.cash($1,$2),$calc(100 * %players))

}

}

elseif ($readini($scriptdir $+ bet.ini,PLAYERS,$mta.nick($1,%a)) == $readini($scriptdir $+ rank.ini,rank1,$mta.rank($1,$2))) {

!.timer 1 2 !writeini -n " $+ $scriptdir $+ RPG.ini" CASH $readini($scriptdir $+ bet.ini,OVPLAYERS,$mta.nick($1,$2) $gus.add($gus.cash($1,%a),100)

!.timer 1 2 !remini -n " $+ $scriptdir $+ Rank.ini" RANK1 $mta.rank($1,$2))

!remini -n " $+ $scriptdir $+ bet.ini" PLAYERS $mta.nick($1,%a))

!remini -n " $+ $scriptdir $+ bet.ini" MONEY $mta.nick($1,%a))

!remini -n " $+ $scriptdir $+ bet.ini" OVPLAYERS $mta.nick($1,$2))

}

if (%rpg == on) gus.rpgwin $1 $2

if ($mta.rank($1,$2) == 1) !writeini -n " $+ $scriptdir $+ stats.ini" WINS $mta.nick($1,$2) $gus.add($gus.wins($1,$2),1)

!writeini -n " $+ $scriptdir $+ stats.ini" RACES $mta.nick($1,$2) $gus.add($gus.races($1,$2),1)

}

Link to comment

Thx, but to be honest, the whole script is full of bugs, and i cant really see what ur trying to fix :roll:

U cant do a payout to a better on the info supplied in that alias.

i would imagine that u would have to use some kind of loop to check every player in the server to see if anyone bet on him, then do a payout if they did.

and i dont see anything like that in there.

if u need this fixing, by anyone on here, u need to post all the relevant info regarding the betting.

take this first post of urs for instance:

elseif ($readini($scriptdir $+ bet.ini,PLAYERS,$mta.nick($1,%a)) = $readini($scriptdir $+ rank.ini,rank1,$mta.rank($1,$2))) {

!.timer 1 2 !writeini -n " $+ $scriptdir $+ RPG.ini" CASH $readini($scriptdir $+ bet.ini,OVPLAYERS,$mta.nick($1,$2) $gus.add($gus.cash($1,%a),100)

!.timer 1 2 !remini -n " $+ $scriptdir $+ Rank.ini" RANK1 $mta.rank($1,$2))

!remini -n " $+ $scriptdir $+ bet.ini" PLAYERS $mta.nick($1,%a))

!remini -n " $+ $scriptdir $+ bet.ini" MONEY $mta.nick($1,%a))

!remini -n " $+ $scriptdir $+ bet.ini" OVPLAYERS $mta.nick($1,$2))

}

There is an error on 'every' line... sometimes more than just 1

but without seeing how ur bet is stored i cant fix it. sorry :roll:

Link to comment
ok.you cant find error , but you can write your example!i need just one little part when player finish and if other player bet on winner ,this "other player" take money (just write this moment!plz)

i can find the error.. the whole script is 1 big error. :lol:

u want me to write u a complete bet/win system that actually works?

hmmm i did that already, u could always use my script... at least it works and i can edit easily enough for u.

Link to comment
so.will you write this fu**ing part for me?? :)

plz plz plz plz plz plz plz plz plz plz plz plz plz......

why dont u just use a script already written? like mine :lol:

i have to go to work now.. i'll let u decide.

if not, then ok i will take a look at ur script. but u will be better off sending it me on msn, coz theres parts from other areas in ur script that need checking/changing. have a think about it.

i'll check ur reply after work.

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...