• Welcome to Vice City Multiplayer.
 

Getting The Player Skin

Started by Mex, August 18, 2007, 01:03:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mex

Ok I need to get the players skin, for a !skin command and other reasons

So I thought, simple..

on *:SIGNAL:vcmp.spawn:{
  vcmp.say $vcmp.name(%id) Spawned As A ' $+ $readini(SkinLocations.ini,Skins,$vcmp.location(%id)) $+ '.
}

Obviously the ini would contain skin spawns locations and their names..
like:
[Skins]
Location=SkinName

So I tested it, but the problem was it was reading the location too early :\
only a few miliseconds, but enough to read the wrong location..

So I thought ok ill do area instead of location.

This time I had the same problem with it reading the area to early.

So I tried a timer:
.timerspawn 1 1 vcmp.say $vcmp.area(%id)
also
.timerspawn 1 20 vcmp.say $vcmp.area(%id)

I found out it reads the area at the start of the timer.. then says the area at the time specified.

Which is useless as I need it to read the area after the specified time.

If anyone can help me with this I would really apreciate it,

Thanks,
Mex.

Mex

Sorted on MSN, Thanks Tommis.

For anyone that wants to know,
you need to put a timer to an alias.

Chezor

I dont get this thing, I also want the same cmd as mex .. the !skin cmd

my code is

alias vcmp.findskin {
  if (City Hall isin $vcmp.area(%id)) {
    !writeini -n vcmp.skin.ini SKINS $vcmp.getid($1) Citizen
    vcmp.msg %id You spawned as a Citzen.
  }
  elseif (Police isin $vcmp.area(%id)) {
    !writeini -n vcmp.skin.ini SKINS $vcmp.getid($1) Cop
    vcmp.msg %id You spawned as a Cop.
  }
}


and

on *:SIGNAL:vcmp.spawn:{
  var %name = $1
  var %id = $vcmp.getid($1)

  $vcmp.findskin(%id)
}


but if we spawn as citizen and then spawn as cop. It detects the location where we died and not where we spawned. So it will say you spawned as citizen. if i spawn as cop..
I dont prefer to create new topic as this topic is already there.. (i know this is too old topic :P )

Scripts: Fuel system in vehicles, Speedometer, Spawnback, Improved Copwork, Improved Jailing, Improved phone with sms, and many more. Coming soon..

Tommis

#3
Hey,

Try this;



alias vcmp.before.findskin {

  ;$1 == ID
  ;$2 == NAME

  timer -m 1 1000 vcmp.findskin $1-
}
alias vcmp.findskin {

  ;$1 == ID
  ;$2 == NAME

  if (City Hall isin $vcmp.area($1)) {
    !writeini -n vcmp.skin.ini SKINS $1 Citizen
    vcmp.msg $1 You spawned as a Citzen.
  }
  elseif (Police isin $vcmp.area($1)) {
    !writeini -n vcmp.skin.ini SKINS $1 Cop
    vcmp.msg $1 You spawned as a Cop.
  }

}




on *:SIGNAL:vcmp.spawn:{
  var %name = $1
  var %id = $vcmp.getid($1)

  timer -m 1 500 vcmp.before.findskin %id %name
}


It basically waits a second then does it. Should give the scripts enough time to update the data with regards to location.

Regards,
Tommis

Punjabi

Thanks tommis i really need this for my GUS..... ::)
GOD BLESS ALL..<<Founder of PUN Clan.....Born to fight and Kill..>>