• Welcome to Vice City Multiplayer.
 

1 question

Started by Intruder, August 31, 2008, 09:58:45 AM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Intruder

where would i start with !buycar and !sellcar i was looking through and it gave me an idea

szostol

I don't understand? You wanna know how to start making buycar?

1. Make alias with price
2. Make alias with owner
3. Make command
- writing in file or hadd owner name to car id

Punjabi

#2
<--------------------------------Gus Script----------------------------------->

elseif ($2 == !car) || ($2 == !pmcar) {
   if ($vcmp.cmdcheck(!car,%id) == fail) !halt  
   elseif (%a == -1) vcmp.msg %id  Absent ID/Name
   elseif ($vcmp.vehicle(%a,id) == 0) vcmp.msg %id  $vcmp.name(%a) car is currently on foot!
   else vcmp.msg %id Vehicle - Name: $+($chr(91),$vcmp.carname($vcmp.vehicle(%a,id)),$chr(93)) ID: $+($chr(91),$vcmp.vehicle(%a,id),$chr(93)) Price: $+($chr(91),$vcmp.vehiclecost($vcmp.vehicle(%a,id)),$chr(93)) Owner: $+($chr(91),$vcmp.carowner($vcmp.vehicle(%a,id)),$chr(93))
 }
 elseif ($2 == !buycar) {
   if ($vcmp.cmdcheck(!buycar,%id) == fail) !halt
   elseif (Sunshine Autos !isin $vcmp.area(%b)) vcmp.msg %id  To Buy A Car Deves Be Sunshine In Cars!!
   elseif ($vcmp.vehicle(%a,id) == 0) vcmp.msg %id
   elseif ($vcmp.carowner($vcmp.vehicle(%a,id)) != Sunshine Autos) vcmp.msg %id This vehicle is owned by $vcmp.carowner($vcmp.vehicle(%a,id))
   elseif ($vcmp.vehiclecost($vcmp.vehicle(%a,id)) > $vcmp.cash(%id)) vcmp.msg %id You need atleast $ $+ $vcmp.vehiclecost($vcmp.vehicle(%a,id))
   else {
     vcmp.cash- %b $vcmp.vehiclecost($vcmp.vehicle(%a,id))
     !writeini -n vcmp.cars.ini OWNERS $vcmp.vehicle(%a,id) $vcmp.name(%id)
     vcmp.msg %id You have just bought $+($chr(91),$vcmp.carname($vcmp.vehicle(%a,id)),$chr(93)) ID: $+($chr(91),$vcmp.vehicle(%a,id),$chr(93)) Price: $+($chr(91),$vcmp.vehiclecost($vcmp.vehicle(%a,id)),$chr(93))
   }
 }
 elseif ($2 == !sellcar) {
   if ($vcmp.cmdcheck(!sellcar,%id) == fail) !halt
   elseif (Sunshine Autos !isin $vcmp.area(%b)) vcmp.msg %id To Sell A Must Be In Order To Sunshine Or Make One Admin The Leasehold Landlord
   elseif ($vcmp.vehicle(%a,id) == 0) vcmp.msg %id You Have No Car No!
   elseif ($vcmp.carowner($vcmp.vehicle(%a,id)) != %name) vcmp.msg %id You Can not Buy This Car Has Owner
   else {
     !writeini -n vcmp.cars.ini OWNERS $vcmp.vehicle(%a,id) Sunshine Autos
     vcmp.cash+ %b $calc($vcmp.vehiclecost($vcmp.vehicle(%a,id)) * 0.55)
     vcmp.msg %id You have sold your vehicle with price $ $+ $calc($vcmp.vehiclecost($vcmp.vehicle(%a,id)) * 0.55)
   }
 }
 elseif ($2 == !getcar) || ($2 == !pmgetcar) {
   if ($vcmp.cmdcheck(!getcar,%id) == fail) !halt
   elseif (!$3) vcmp.msg %id Error - Missing Information, $2 <car id>
   elseif ($3 !isnum) vcmp.msg %id Error - Invalid Vehicle ID, $2 <car id>
   elseif ($vcmp.carowner($3) != %name) vcmp.msg %id Your not the owner of this car!
   else {
     vcmp.setvehicleloc $3 $hget(vcmp,%id $+ .xyz)
     .timer -m 1 400 vcmp.setvehicle %id $3
   }
 }
 elseif ($2 == !cardive) || ($2 == !pmgetcar) {
   if ($vcmp.cmdcheck(cardivegetcar,%id) == fail) !halt
   elseif (!$3) vcmp.msg %id  Missing Information, $2 <car id>
   elseif ($3 !isnum) vcmp.msg %id  Invalid Vehicle ID, $2 <car id>
   elseif ($vcmp.carowner($3) != %name) vcmp.msg %id You are not the owner of this car, go and buy one!
   else {
     vcmp.msg %id
     vcmp.setvehicleloc $3 $hget(vcmp,%id $+ .x) $hget(vcmp,%id $+ .y) $calc($hget(vcmp,%id $+ .z) + 700)
     .timer -m 1 400 vcmp.set 9 %id $3
   }
 }
 elseif ($2 == !lockcar) || ($2 == !pmlockcar) {
   if ($vcmp.cmdcheck(!lockcar,%id) == fail) !halt
   elseif (!$3) vcmp.msg %id Error - Missing Information, $2 <car id>
   elseif ($3 !isnum) vcmp.msg %id Error - Invalid Vehicle ID, $2 <car id>
   elseif ($vcmp.carowner($3) != %name) vcmp.msg %id You are not the owner of this car
   else {
     vcmp.lockdoors $3 4
     vcmp.msg %id **Car Locked
   }
 }
 elseif ($2 == !unlockcar) || ($2 == !pmunlockcar) {
   if ($vcmp.cmdcheck(!unlockcar,%id) == fail) !halt
   elseif (!$3) vcmp.msg %id Error - Missing Information, $2 <car id>
   elseif ($3 !isnum) vcmp.msg %id Error - Invalid Vehicle ID, $2 <car id>
   elseif ($vcmp.carowner($3) != %name) vcmp.msg %id You are not the owner of this car
   else {
     vcmp.lockdoors $3 0
   vcmp.msg %id **Car Unlocked    }
 }


<----------------------------Sansan Script-------------------------------->

Command !Car:
elseif ($2 == !car) {
     var %p = $iif($3,$v1,%id)
     if ( $vcmp.hgetcarid(%id) = 0 ) {
       vcmp.adminmsg %id You are Currently on Foot
       !halt
   }
     elseif ($vcmp.nameid(%p) != $null) vcmp.adminmsg %id Vehicle Status: Model:[ $vcmp.carsnames($vcmp.hgetcarid(%id)) ] ID:[ $vcmp.carsids($vcmp.hgetcarid(%id)) ]  Hp:[ $vcmp.hgetcarhp(%id) ]
     vcmp.adminmsg %id Owner:[ $vcmp.carsowners($vcmp.hgetcarid(%id)) ] Price:[ $ $+  $vcmp.carsprices($vcmp.hgetcarid(%id)) ] Share:[ $vcmp.carsshares($vcmp.hgetcarid(%id)) ]
     else vcmp.adminmsg %id Error: Invalid ID.
   }


Command !Mycars:
 elseif ($2 == !mycars) {
     var %a = 0,%b = 0,%c = 0,%d
     while (%a < $ini(vcmp.cars.ini,OWNERS,0)) {
       %b = $readini(vcmp.cars.ini,OWNERS,$ini(vcmp.cars.ini,OWNERS,%a))
       %c = %b
       %d = $ini(vcmp.cars.ini,OWNERS,%a)
       !inc %a
       if (%c == $vcmp.hgetname(%id)) vcmp.adminmsg %id Mycars:[ $vcmp.carsnames(%d) ( %d ) ]
     }
   }


Command !Buycar:
elseif ($2 == !buycar) {
     if ( $vcmp.hgetcarid(%id) = 0 ) {
       vcmp.adminmsg %id You are Currently on Foot
       !halt
     }
     if (Sunshine-Autos-Viceport-Vice-City-Mainland !isin $vcmp.playerarea(%id)) {
       vcmp.adminmsg %id Error - You Must Be in Sunshine-Autos To Buy a Car!
       !halt
     }
     elseif ( $vcmp.carsowners($vcmp.hgetcarid(%id)) != Sunshine-Autos ) {
       vcmp.adminmsg %id Error - This Vehicle is already Owned.
       !halt
     }
     elseif ($hget(mycars, $vcmp.hgetname(%id)) >= 2) vcmp.adminmsg %id Error, you have reached your car limit.

     elseif ( $vcmp.carsprices($vcmp.hgetcarid(%id)) > $vcmp.hgetmoney(%id)) {
       vcmp.adminmsg %id Error - You need atleast $ $+ $vcmp.carsprices($vcmp.hgetcarid(%id)) to buy this vehicle.
       !halt
     }
     else {
       !writeini vcmp.cars.ini OWNERS $vcmp.hgetcarid(%id) $vcmp.hgetname(%id)
       vcmp.adminmsg %id Bought Car!
       var %cars = $hget(myCars, $vcmp.hgetname(%id))
       !hadd -m myCars $vcmp.hgetname(%id) $calc(%cars +1)
       vcmp.setmon %id $calc($vcmp.hgetmoney(%id) - $vcmp.carsprices($vcmp.hgetcarid(%id)))
     }
   }

Commands !Sellcar:
elseif ($2 == !sellcar) {
     var %money = $calc($vcmp.carsprices($vcmp.hgetcarid(%id)) /2 )
     var %cars = $hget(mycars, $vcmp.hgetname(%id))
     if ( $vcmp.hgetcarid(%id) = 0 ) {
       vcmp.adminmsg %id You are Currently on Foot
       !halt
     }
     if (Sunshine-Autos-Viceport-Vice-City-Mainland !isin $vcmp.playerarea(%id)) {
       vcmp.adminmsg %id Error - You Must Be in Sunshine-Autos To Sell a Car!
       !halt
     }
     elseif ( $vcmp.carsowners($vcmp.hgetcarid(%id)) != $vcmp.hgetname(%id) ) {
       vcmp.adminmsg %id Error - This is not your Vehicle.
       !halt
     }
     else {
       !writeini vcmp.cars.ini OWNERS $vcmp.hgetcarid(%id) Sunshine-Autos
       !hadd -m mycars $vcmp.hgetname(%id) $calc(%cars -1)
       if ($hget(mycars, $vcmp.hgetname(%id)) == 0 ) !hdel mycars $vcmp.hgetname(%id)
       vcmp.adminmsg %id Sold Car!
       vcmp.setmon %id $calc($vcmp.hgetmoney(%id) + %money)
     }
   }
Command !Getcar:



Command !Getcar:
elseif ($2 == !getcar) {
     if ($vcmp.hgetcarid(%id) != 0) vcmp.adminmsg %id You must be on foot to use the <!Getcar> Command.
     elseif (!$3) vcmp.adminmsg %id Error - Missing Information, $2 <ID>
     elseif ($3 !isnum) vcmp.adminmsg %id $2 $+ , Invalid Vehicle ID.
     elseif (. isin $3) vcmp.adminmsg %id $2 $+ , Invalid Vehicle ID.
     elseif ($3 > 140) || ($3 < 0) vcmp.adminmsg %id Error: Invalid Vehicle ID.
     elseif (+ isin $3) || (- isin $3) vcmp.adminmsg %id $2 $+ , Invalid Vehicle ID.
     elseif ( $vcmp.carsowners($3) != $vcmp.hgetname(%id)) vcmp.adminmsg %id Error - You Dont have Keys To this Vehicle.
     else {
       vcmp.setcarloc $3 $calc($vcmp.hgetpos.x(%id) + 2) $calc($vcmp.hgetpos.y(%id) + 2) $calc($vcmp.hgetpos.z(%id) - 1)  
       vcmp.adminmsg %id Spawning Car:[ $3 $+ ]
     }
     if ($vcmp.hgetcarid(%id) != 0) vcmp.adminmsg %id You must be on foot to use the <!Getcar> Command.
     elseif (!$3) vcmp.adminmsg %id Error - Missing Information, $2 <ID>
     elseif ($3 !isnum) vcmp.adminmsg %id $2 $+ , Invalid Vehicle ID.
     elseif (. isin $3) vcmp.adminmsg %id $2 $+ , Invalid Vehicle ID.
     elseif ($3 > 140) || ($3 < 0) vcmp.adminmsg %id Error: Invalid Vehicle ID.
     elseif (+ isin $3) || (- isin $3) vcmp.adminmsg %id $2 $+ , Invalid Vehicle ID.
     elseif ( $vcmp.carsshares($3) != $vcmp.hgetname(%id)) vcmp.adminmsg %id Error - You Dont have Keys To this Vehicle.
     else {
       vcmp.setcarloc $3 $calc($vcmp.hgetpos.x(%id) + 2) $calc($vcmp.hgetpos.y(%id) + 2) $calc($vcmp.hgetpos.z(%id) - 1)  
       vcmp.adminmsg %id Spawning Car:[ $3 $+ ]
     }
   }


Command !Sharecar:
elseif ($2 == !sharecar) {
     if ( $vcmp.hgetcarid(%id) = 0 ) {
       vcmp.adminmsg %id You are Currently on Foot
       !halt
     }
     elseif ( $vcmp.carsshares($vcmp.hgetcarid(%id)) != None ) {
       vcmp.adminmsg %id Error - This Vehicle is Already Shared.
       !halt
     }
     elseif ( $vcmp.carsowners($vcmp.hgetcarid(%id)) != $vcmp.hgetname(%id) ) {
       vcmp.adminmsg %id Error - This is not your Vehicle.
       !halt
     }
     else {
       !writeini vcmp.cars.ini SHARE $vcmp.hgetcarid(%id) $vcmp.hgetname($vcmp.nameid($3))
       vcmp.adminmsg %id Shared Car!
     }
   }
Command !DelSharecar:

Code:
   elseif ($2 == !delsharecar) {
     if ( $vcmp.hgetcarid(%id) = 0 ) {
       vcmp.adminmsg %id You are Currently on Foot
       !halt
     }
     elseif ( $vcmp.carsowners($vcmp.hgetcarid(%id)) != $vcmp.hgetname(%id) ) {
       vcmp.adminmsg %id Error - This is not your Vehicle.
       !halt
     }
     else {
       !writeini vcmp.cars.ini SHARE $vcmp.hgetcarid(%id) $vcmp.hgetname($vcmp.nameid($3)) None
       vcmp.adminmsg %id Deleted Share Car!
     }
   }

Please Create New File In Script Name:

1.- vcmp.owners in vcmp.owner:

Code:
[OWNERS]
13=Sunshine Autos
10=Sunshine Autos
145=Sunshine Autos
148=Sunhine Autos
146=Sunshine Autos
45=Sunshine Autos
25=Sunshine Autos
2=Sunshine Autos
149=Sunshine Autos
126=Sunshine Autos
110=Sunshine Autos
97=Sunshine=Autos
52=Sunshine Autos
27=Sunshine Autos
151=Sunshine Autos
44=Sunshine Autos
100=Sunshine Autos
101=Sunshine Autos
15=Sunshine Autos
73=Sunshine Autos
152=Sunshine Autos
2.- New File Name: vcmp.myCars

3.- New File Name: vcmp.cars in vcmp.cars


Code:
[PRICES]
1=75000
2=75000
3=75000
4=75000
5=75000
6=75000
7=75000
8=75000
9=1500000
10=300000
11=1200000
12= etc etc
[ID] ( is id you cars )
1=1
2=2
3=3
4=4
5=5
6=6
7=7
8=8
9=9
10=10
11=11
[OWNERS] ( owner id 1= etc is empy no modific )
1=
2=
3=
4=
5=
6=
7=
8=
9=
10=
11=
12=
[NAMES] ( and all name car's )
1=Washington
2=Angel
3=Angel
4=Angel
5=Angel



:PI hpe this will help u
Thnaks Punjabi_goli

GOD BLESS ALL..<<Founder of PUN Clan.....Born to fight and Kill..>>

Intruder


Intruder

for the gus script what do i do with inis like it dont have prices  n owers

TanaX01

it's Script By Rulk And TanaX01  ???

szostol

So report it to moderator if you don't want to relase it.

Punjabi

 :PHey guys plz be cool i am just telling him code made by Tanax
:-X
GOD BLESS ALL..<<Founder of PUN Clan.....Born to fight and Kill..>>

szostol

But maybe tana doesn't want to give others his work?

Intruder

could you just tell em what the inis are spost to look like please for the gus script

thijn

vcmp.cars.ini

[OWNERS]
1=Sunshine Autos
2=Sunshine Autos
3=Sunshine Autos
4=Sunshine Autos
5=Sunshine Autos
6=Sunshine Autos
7=Sunshine Autos
8=Sunshine Autos
9=Sunshine Autos
10=Sunshine Autos
11=Sunshine Autos
12=Sunshine Autos
13=Sunshine Autos
14=Sunshine Autos
15=Sunshine Autos
16=Sunshine Autos
17=Sunshine Autos
18=Sunshine Autos
19=Sunshine Autos
20=Sunshine Autos
21=Sunshine Autos
22=Sunshine Autos
23=Sunshine Autos
24=Sunshine Autos
25=Sunshine Autos
26=Sunshine Autos
27=Sunshine Autos
28=Sunshine Autos
29=Sunshine Autos
30=Sunshine Autos
31=Sunshine Autos
32=Sunshine Autos
33=Sunshine Autos
34=Sunshine Autos
35=Sunshine Autos
36=Sunshine Autos
37=Sunshine Autos
38=Sunshine Autos
39=Sunshine Autos
40=Sunshine Autos
41=Sunshine Autos
42=Sunshine Autos
43=Sunshine Autos
44=Sunshine Autos
45=Sunshine Autos
46=Sunshine Autos
47=Sunshine Autos
48=Sunshine Autos
49=Sunshine Autos
50=Sunshine Autos
51=Sunshine Autos
52=Sunshine Autos
53=Sunshine Autos
54=Sunshine Autos
55=Sunshine Autos
56=Sunshine Autos
57=Sunshine Autos
58=Sunshine Autos
59=Sunshine Autos
60=Sunshine Autos
61=Sunshine Autos
62=Sunshine Autos
63=Sunshine Autos
64=Sunshine Autos
65=Sunshine Autos
66=Sunshine Autos
67=Sunshine Autos
68=Sunshine Autos
69=Sunshine Autos
70=Sunshine Autos
71=Sunshine Autos
72=Sunshine Autos
73=Sunshine Autos
74=Sunshine Autos
75=Sunshine Autos
76=Sunshine Autos
77=Sunshine Autos
78=Sunshine Autos
79=Sunshine Autos
80=Sunshine Autos
81=Sunshine Autos
82=Sunshine Autos
83=Sunshine Autos
84=Sunshine Autos
85=Sunshine Autos
86=Sunshine Autos
87=Sunshine Autos
88=Sunshine Autos
89=Sunshine Autos
90=Sunshine Autos
91=Sunshine Autos
92=Sunshine Autos
93=Sunshine Autos
94=Sunshine Autos
95=Sunshine Autos
96=Sunshine Autos
97=Sunshine Autos
98=Sunshine Autos
99=Sunshine Autos
100=Sunshine Autos
101=Sunshine Autos
102=Sunshine Autos
103=Sunshine Autos
104=Sunshine Autos
105=Sunshine Autos
106=Sunshine Autos
107=Sunshine Autos
108=[[NL]Thijn[NL]]
109=Sunshine Autos
110=Sunshine Autos
111=Sunshine Autos
112=Sunshine Autos
113=Sunshine Autos
114=Sunshine Autos
115=Sunshine Autos
116=Sunshine Autos
117=Sunshine Autos
118=Sunshine Autos
119=Sunshine Autos
120=Sunshine Autos
121=Sunshine Autos
122=Sunshine Autos
123=Sunshine Autos
124=Sunshine Autos
125=Sunshine Autos
126=Sunshine Autos
127=Sunshine Autos
128=Sunshine Autos
129=Sunshine Autos
130=Sunshine Autos
131=Sunshine Autos
132=Sunshine Autos
133=Sunshine Autos
134=Sunshine Autos
135=Sunshine Autos
136=Sunshine Autos
137=Sunshine Autos
138=Sunshine Autos
139=Sunshine Autos
140=Sunshine Autos
141=Sunshine Autos
142=Sunshine Autos
143=Sunshine Autos
144=Sunshine Autos
145=Sunshine Autos
146=Sunshine Autos
147=Sunshine Autos
148=Sunshine Autos
149=Sunshine Autos
150=Sunshine Autos
151=Sunshine Autos
152=Sunshine Autos
153=Sunshine Autos
154=Sunshine Autos
155=Sunshine Autos
156=Sunshine Autos
157=Sunshine Autos
158=Sunshine Autos
159=Sunshine Autos
160=Sunshine Autos
161=Sunshine Autos
162=Sunshine Autos
163=Sunshine Autos
164=Sunshine Autos
165=Sunshine Autos
166=Sunshine Autos
167=Sunshine Autos
168=Sunshine Autos
169=Sunshine Autos
170=Sunshine Autos
171=Sunshine Autos
172=Sunshine Autos
173=Sunshine Autos
174=Sunshine Autos
175=Sunshine Autos
176=Sunshine Autos
177=Sunshine Autos
178=Sunshine Autos
179=Sunshine Autos
180=Sunshine Autos
181=Sunshine Autos
182=Sunshine Autos
183=Sunshine Autos
184=Sunshine Autos
185=Sunshine Autos
186=Sunshine Autos
187=Sunshine Autos
188=Sunshine Autos
189=Sunshine Autos
190=Sunshine Autos
191=Sunshine Autos
192=Sunshine Autos
193=Sunshine Autos
ETC.



VRocker

ermm just poking my head in here... but isn't that script missing some required aliases?

And the ini shouldn't need Sunshine Autos added in for every id. look into using $iif, it'll save work :)


Punjabi

I will try to do tha ;D
Thanks
Punjabi_goli
GOD BLESS ALL..<<Founder of PUN Clan.....Born to fight and Kill..>>

Intruder

what is scripts are made by Tanax?

TanaX01

My Script Is Gus and Vrock  ;) Bot 1.1 By Rulk  ;) and tanax edit commands