WestCoast Posted October 4, 2006 Share Posted October 4, 2006 Hello. I need a bit help with my drugs script. i made a script that if i type !Drugs it says the drugs what i own that work perfectly but i have a problem with a !buyweed script i want that i want choose how much i want to buy Example: !buyweed 1 to 100 etc. in my script i can only buy 10 Kg of weed. when i buyweed my cash goes to $-10000 i want a pm says: You dont have enough money to buy weed. This is what i wrote: on *:SIGNAL:mta.command: { var %a = $iif($4 == $null,$2,$iif($mta.getid($1,$4) == -1,$2,$v1)) if ($3 = !Buyweed) { if (Ryton Aide !isin $mta.area($1,$2)) mta.msg $1 $2 You Are Not At Ryton Aide else { mta.say $1 $mta.name($1,$2) Brought 10 Kg Of Weed. writeini MTAScript.ini Cash $mta.name($1,$2) $calc($mta.cash($1,$2) - 10000) writeini Drugs.ini Drugs $mta.name($1,%a) $calc($mta.drugs($1,%a) + 10) } } } alias mta.cash !return $iif($readini(MTAScript.ini,Cash,$mta.name($1,$2)) == $null,0,$v1) alias mta.drugs !return $iif($readini(Drugs.ini,Drugs,$mta.name($1,$2)) == $null,0,$v1) Thnx WestCoast Link to comment
WestCoast Posted October 5, 2006 Author Share Posted October 5, 2006 So can someone help me or not plz? Realy Need Some Help Man. Thnx WestCoast Link to comment
Squall Posted October 27, 2006 Share Posted October 27, 2006 wats up wid every 1 dont they like u or something let me try Link to comment
[XE]Stormax Posted October 27, 2006 Share Posted October 27, 2006 Westcoast you said you coudnt script. Link to comment
BetaDevil Posted October 27, 2006 Share Posted October 27, 2006 I'm not a very good scripter and never scripted for 0.5 but this should work on *:SIGNAL:mta.command: { var %a = $iif($4 == $null,$2,$iif($mta.getid($1,$4) == -1,$2,$v1)) if ($3 == !buyweed) { if (Ryton Aide isin $mta.area($1,$2) { if ($4 >= 1 && $4 <= 100) { mta.say $1 $mta.namce ($1,$2) brought $4 KG weed. writeini MTAScript.ini Cash $mta.name($1,$2) $calc($mta.cash($1,$2) - $4 * 100) writeini Drugs.ini Drugs $mta.name($1,%a) $calc($mta.drugs($1,%a) + $4) } else mta.msg $1 Enter a valid amount of drugs (1-100) } else mta.msg $1 $2 You are not at Ryton Aide } } alias mta.cash !return $iif($readini(MTAScript.ini,Cash,$mta.name($1,$2)) == $null,0,$v1) alias mta.drugs !return $iif($readini(Drugs.ini,Drugs,$mta.name($1,$2)) == $null,0,$v1) Link to comment
lil Toady Posted October 27, 2006 Share Posted October 27, 2006 just to fix some BetaDevil's mistakes on *:SIGNAL:mta.command: { if ($3 == !buyweed) { if (Ryton isin $mta.area($1,$2)) { if (($4 isnum) && ($4 >= 1) && ($4 <= 100)) { mta.say $1 $mta.name($1,$2) brought $4 KG of weed. !writeini MTAScript.ini Cash $mta.name($1,$2) $calc($mta.cash($1,$2) - $4 * 1000) !writeini Drugs.ini Drugs $mta.name($1,$2) $calc($mta.drugs($1,$2) + $4) } else mta.msg $1 Enter a valid amount of drugs (1-100) } else mta.msg $1 $2 You are not at Ryton Aide } } alias mta.cash !return $iif($readini(MTAScript.ini,Cash,$mta.name($1,$2)),$v1,0) alias mta.drugs !return $iif($readini(Drugs.ini,Drugs,$mta.name($1,$2)),$v1,0) Link to comment
ceelen1 Posted October 30, 2006 Share Posted October 30, 2006 it doesnt work the drug script it says: your not at ryton aide (but iam) Link to comment
Recommended Posts