Vice City Multiplayer

VC:MP => mIRC/pawn Scripting => Topic started by: Mex on August 18, 2007, 02:03:33 PM

Title: Getting The Player Skin
Post by: Mex on August 18, 2007, 02:03:33 PM
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.
Title: Re: Getting The Player Skin
Post by: Mex on August 19, 2007, 12:36:38 AM
Sorted on MSN, Thanks Tommis.

For anyone that wants to know,
you need to put a timer to an alias.
Title: Re: Getting The Player Skin
Post by: Chezor on September 13, 2008, 07:08:53 PM
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 )
Title: Re: Getting The Player Skin
Post by: Tommis on September 13, 2008, 07:12:57 PM
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
Title: Re: Getting The Player Skin
Post by: Punjabi on September 16, 2008, 10:07:58 AM
Thanks tommis i really need this for my GUS..... ::)