• Welcome to Vice City Multiplayer.
 

Only 1 little question! :D

Started by mbalee, January 27, 2008, 12:02:18 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mbalee

Na...
I have vehicle name and ids list.

  elseif ($2 == !car) || ($2 == !pmcar) {
    if ($vcmp.cmdcheck(!car,%id) == fail) !halt   
    elseif (%a == -1) vcmp.msg %id Error - Absent ID/Name
    elseif ($vcmp.vehicle(%a,id) == 0) vcmp.msg %id Error - $vcmp.name(%a) is currently on foot!
    else vcmp.msg %id Vehicle - Name: (WHAT IS NEEDED FOR HIS PLACE?) , ID: $+($chr(91),$vcmp.vehicle(%a,id),$chr(93)) , Damage: $+($chr(91),$calc(100 - $vcmp.vehicle(%id,hp)),%,$chr(93)) $+
  }


my cars name list in vcmp.data.ini

... [cars]
0=On_Foot
130=Landstalker
131=Idaho
132=Stinger
133=Linerunner
134=Perennial
135=Sentinel
136=Rio
137=Fire-Truck
138=Trashmaster
139=Stretch
140=Manana
141=Infernus
...


Help! Thanks!

javipg94

Hi agen  :P
Well , you are trying to set a car with !car cmd.. and its not correct.. !car cmd is to show the car's ID you are driving.
- Download the next pdf and see what car you want.. , In this case 187 an example.
http://adtec.gtagaming.com/uploads/vcmp-vehicle-id-listing.pdf

- Open config.ini and look for <<STARTS OF VEHICLES>> , We will set in the next code the car 187 with 1 colour --> 22 .

Vehicle = 187 -1285.2345 104.9041 10.9782 282.0292 22 22

Here's the syntax. --> Vehicle = ; #model_id #spawn_x #spawn_y #spawn_z #z_angle #color1 #color2  USE -1 to take colours from carcols.dat


I think its what you wanted , enjoy. ;D

mbalee

Sry, I do not understand this. :S

im created new alias: alias vcmp.carname return $readini(vcmp.data.ini,cars,$1)

and need the code.

$vcmp.carname(??,??)

:)

javipg94

Hi,
In fact , i didnt understand what are you meaning..

Tell me what do you mean with an example..

See you.

mbalee


Mex


mbalee


Mex

Make sure there is a space to the left and right of the alias, this would not work:
Name:$vcmp.carname($vcmp.vehicle(%a,id)),

This would:
Name: $vcmp.carname($vcmp.vehicle(%a,id)) ,

This would also work:
Name: $vcmp.carname($vcmp.vehicle(%a,id)) $+ ,

$+ removes the space btw

mbalee

Sry, but this does not work for me!!  >:(  >:(  >:(  ???  ???

My command:
  elseif ($2 == !car) || ($2 == !pmcar) {
    if ($vcmp.cmdcheck(!car,%id) == fail) !halt   
    elseif (%a == -1) vcmp.msg %id Error - Absent ID/Name
    elseif ($vcmp.vehicle(%a,id) == 0) vcmp.msg %id Error - $vcmp.name(%a) is currently on foot!
    else vcmp.msg %id Vehicle - Name: $vcmp.carname($vcmp.vehicle(%a,id)) , ID: $+($chr(91),$vcmp.vehicle(%a,id),$chr(93)) , Damage: $+($chr(91),$calc(100 - $vcmp.vehicle(%id,hp)),%,$chr(93)) $+
  }


Alias:
alias vcmp.carname return $readini(vcmp.data.ini,cars,$1)

Mex

Oh I see in your picture that you have stored the vehicle model ids and not the vehicle ids related to your config.ini file.

The only way I can think to get a player's vehicle model id, is from when they enter a vehicle.

If you feel you can add the code inside the 4 signals to the 4 signals in your script, and add the 2 alias's to your script, then do so.
Otherwise just put these 4 signals and 2 alias's into a new blank script.

The reason for this is you cannot have 2 of the same signal names in the same script, and I am assuming that you already have these 4 signal names in your script.

on *:SIGNAL:vcmp.enter:{
  var %name = $1, %id = $vcmp.getid(%name)
  !hadd -m vcmp %id $+ .carmodelid $3
}
on *:SIGNAL:vcmp.exit:{
  var %name = $1, %id = $vcmp.getid(%name)
  !hdel vcmp %id $+ .carmodelid
}
on *:SIGNAL:vcmp.kill:{
  var %name = $2, %id = $vcmp.getid(%name)
  !hdel vcmp %id $+ .carmodelid
}
on *:SIGNAL:vcmp.part:{
  var %name = $1, %id = $vcmp.getid(%name)
  !hdel vcmp %id $+ .carmodelid
}
alias vcmp.carmodelid !return $iif($hget(vcmp,$1 $+ .carmodelid) != $null,$v1,-1)
alias vcmp.carname !return $iif($readini(vcmp.data.ini,cars,$vcmp.carmodelid($1)) != $null,$v1,Unknown)


And here is the other code

elseif ($2 == !car) || ($2 == !pmcar) {
    if ($vcmp.cmdcheck(!car,%id) == fail) !halt   
    elseif (%a == -1) vcmp.msg %id Error - Absent ID/Name
    elseif ($vcmp.vehicle(%a,id) == 0) vcmp.msg %id Error - $vcmp.name(%a) is currently on foot!
    else vcmp.msg %id Vehicle - Name: $vcmp.carname(%a) , ID: $+($chr(91),$vcmp.vehicle(%a,id),$chr(93)) , Damage: $+($chr(91),$calc(100 - $vcmp.vehicle(%id,hp)),%,$chr(93)) $+
  }


Hope it works,
Mex

mbalee

BIG Thanks! This is good! Nice! :D  :-*