Author Topic: Only 1 little question! :D  (Read 6786 times)

0 Members and 3 Guests are viewing this topic.

Offline mbalee

  • Street Thug
  • *
  • Posts: 32
    • View Profile
    • Hungarian GTA Site
Only 1 little question! :D
« on: January 27, 2008, 02:02:18 pm »
Na...
I have vehicle name and ids list.

Code: [Select]
  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

Code: [Select]
... [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!
« Last Edit: January 27, 2008, 02:09:32 pm by mbalee »

Offline javipg94

  • Street Thug
  • *
  • Posts: 13
    • View Profile
Re: Only 1 little question! :D
« Reply #1 on: January 27, 2008, 04:22:40 pm »
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 .

Code: [Select]
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

Offline mbalee

  • Street Thug
  • *
  • Posts: 32
    • View Profile
    • Hungarian GTA Site
Re: Only 1 little question! :D
« Reply #2 on: January 27, 2008, 04:33:27 pm »
Sry, I do not understand this. :S

im created new alias:
Code: [Select]
alias vcmp.carname return $readini(vcmp.data.ini,cars,$1)
and need the code.

$vcmp.carname(??,??)

:)

Offline javipg94

  • Street Thug
  • *
  • Posts: 13
    • View Profile
Re: Only 1 little question! :D
« Reply #3 on: January 27, 2008, 06:51:25 pm »
Hi,
In fact , i didnt understand what are you meaning..

Tell me what do you mean with an example..

See you.

Offline mbalee

  • Street Thug
  • *
  • Posts: 32
    • View Profile
    • Hungarian GTA Site
Re: Only 1 little question! :D
« Reply #4 on: January 27, 2008, 07:16:19 pm »
Look this picture! :P :P :P  :-\

http://www.bsweb.extra.hu/command.JPG


(this is the "little" question!) :D

Offline Mex

  • Wiseguy
  • **
  • Posts: 63
    • View Profile
Re: Only 1 little question! :D
« Reply #5 on: January 28, 2008, 12:03:01 pm »
Look this picture! :P :P :P  :-\

http://www.bsweb.extra.hu/command.JPG


(this is the "little" question!) :D

$vcmp.carname($vcmp.vehicle(%a,id))

Offline mbalee

  • Street Thug
  • *
  • Posts: 32
    • View Profile
    • Hungarian GTA Site
Re: Only 1 little question! :D
« Reply #6 on: January 28, 2008, 06:31:09 pm »
Sry, but not good! :(
Why??? :-/

Offline Mex

  • Wiseguy
  • **
  • Posts: 63
    • View Profile
Re: Only 1 little question! :D
« Reply #7 on: January 29, 2008, 04:12:47 am »
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

Offline mbalee

  • Street Thug
  • *
  • Posts: 32
    • View Profile
    • Hungarian GTA Site
Re: Only 1 little question! :D
« Reply #8 on: January 29, 2008, 07:59:02 pm »
Sry, but this does not work for me!!  >:(  >:(  >:(  ???  ???

My command:
Code: [Select]
  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:
Code: [Select]
alias vcmp.carname return $readini(vcmp.data.ini,cars,$1)

Offline Mex

  • Wiseguy
  • **
  • Posts: 63
    • View Profile
Re: Only 1 little question! :D
« Reply #9 on: January 30, 2008, 08:29:44 am »
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.

Code: [Select]
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

Code: [Select]
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

Offline mbalee

  • Street Thug
  • *
  • Posts: 32
    • View Profile
    • Hungarian GTA Site
Re: Only 1 little question! :D
« Reply #10 on: February 01, 2008, 07:09:46 pm »
BIG Thanks! This is good! Nice! :D  :-*