Author Topic: Spawn place command  (Read 2365 times)

0 Members and 1 Guest are viewing this topic.

Offline scripter_pawn

  • Street Thug
  • *
  • Posts: 30
    • View Profile
Spawn place command
« on: August 29, 2011, 10:57:27 am »
Code: [Select]
alias vcmp.msg !return $dll( " $+ $scriptdirvcmp.dll $+ ", AdminMsg, $1- )               
alias vcmp.setlocation !return $dll( " $+ $scriptdirvcmp.dll $+ ", SetLocation, $1- )
alias vcmp.name !return $dll( " $+ $scriptdirvcmp.dll $+ ", GetName, $1- )

alias vcmp.location {
  var %a = $dll( " $+ $scriptdirvcmp.dll $+ ", GetLocation, $1- )
  if ( $prop == x ) !return $gettok( %a, 1, 32 )
  else if ( $prop == y ) !return $gettok( %a, 2, 32 )
  else if ( $prop == z ) !return $gettok( %a, 3, 32 )
  !return %a
}

on *:SIGNAL:vcmp.player.command2:{
    if ( $3 == spawnplace ) {
    if ( !$4 ) vcmp.msg $1 $2 USE /c $3 [on/off/set]
    elseif ( $rfs.spawn($1,$2) == 0 ) vcmp.msg $1 $2 You are not spawned
    else {
      if ( $4 == on ) {
        vcmp.msg $1 $2 You have turned on your spawnplace
        writeini splace.ini $vcmp.name($1,$2) type  1
      }
      elseif ( $4 == off ) {
        vcmp.msg $1 $2 You have turned off your spawnplace
        writeini splace.ini $vcmp.name($1,$2) type  0
      }
      elseif ( $4 == set ) {
        vcmp.msg $1 $2 You have seted your spawn place
        writeini splace.ini $vcmp.name($1,$2) x $vcmp.location($1,$2).x
        writeini splace.ini $vcmp.name($1,$2) y $vcmp.location($1,$2).y
        writeini splace.ini $vcmp.name($1,$2) z $vcmp.location($1,$2).z
      }
    }
}
on *:SIGNAL:vcmp.player.spawn: {
writeini Accounts.ini $vcmp.name($1,$2) spawn 0
if ( $readini(splace.ini,$vcmp.name($1,$2),type) == 1 ) {
      vcmp.setlocation $1 $2 $readini(splace.ini,$vcmp.name($1,$2),x) $readini(splace.ini,$vcmp.name($1,$2),y) $readini(splace.ini,$vcmp.name($1,$2),z) 0
    }
}
on *:SIGNAL:vcmp.player.death: {
writeini Accounts.ini $vcmp.name($1,$2) spawn 0
}
on *:SIGNAL:vcmp.player.kill: {
writeini Accounts.ini $vcmp.name($1,$3) spawn 0
}
alias rfs.spawn { return $readini(Accounts.ini,$vcmp.name($1,$2),spawn) }
hope it will work :p
if there is somethink i forget write it here
« Last Edit: August 29, 2011, 11:03:03 am by scripter_pawn »