Author Topic: Can a Pro please script this !!!  (Read 4826 times)

0 Members and 1 Guest are viewing this topic.

Offline RPM_Ranger

  • Street Thug
  • *
  • Posts: 5
    • View Profile
Can a Pro please script this !!!
« on: January 15, 2010, 02:40:58 am »
Can somebody who's good at scripting please do this for me plz
the regular FBSv0.2 i want everytime a player joins that they would automatically get an admin level 5 level.

Please and Thank You

Here it is:
http://deathsquad-clan.com/vc-mp/FBS_v0.2_Release.zip
« Last Edit: January 17, 2010, 08:44:00 am by StriKe »

Offline [DGC]Doomer

  • Wiseguy
  • **
  • Posts: 64
    • View Profile
Re: Can a Pro please script this !!!
« Reply #1 on: January 15, 2010, 08:06:13 am »
just one question at beginning you mean spawn or register?

StriKe

  • Guest
Re: Can a Pro please script this !!!
« Reply #2 on: January 15, 2010, 08:31:47 am »
Find this line
Code: [Select]
!writeini -n vcmp.users.ini LEVELS $vcmp.name($1, $2) 1Replace with
Code: [Select]
!writeini -n vcmp.users.ini LEVELS $vcmp.name($1, $2) 5
Find this one
Code: [Select]
vcmp.msg $1 $2 Name: $vcmp.name($1, $2) $+ , Level: 1 $+ , Pass: $4-Replace with
Code: [Select]
vcmp.msg $1 $2 Name: $vcmp.name($1, $2) $+ , Level: 5 $+ , Pass: $4-

Offline ricardo

  • Street Thug
  • *
  • Posts: 14
    • View Profile
Re: Can a Pro please script this !!!
« Reply #3 on: January 15, 2010, 05:04:40 pm »
GUS / FBS AND PSYSCRIPT PEOPLE CAN USE THIS


Code: [Select]
/*
** NOTE:
**
** The following alias adds, replaces or removes
** a command and its admin level in cmd.ini,
** keeping the levels in numerical sequence.

** Syntax:
** SetCommandLevel <NewCmd> <NewCmdLvl>

** Examples:
** SetCommandLevel !givecash 5 ; Add or Replace
** SetCommandLevel !givecash DEL  ; Delete
*/

alias SetCommandLevel {

  var %NewCmd = $1, %NewCmdLvl = $2

  var %file = cmd.ini, %section = COMMANDS

  ; Creat Hidden Window
  window -h @cmds

  var %a = 1, %b = 2, %c = 1, %t

  ; Total Commands
  %t = $ini(%file,%section,0)

  ; Hold %file in buffer
  while (%a <= %t) { echo @cmds $ini(%file,%section,%a) $readini(%file,%section,$ini(%file,%section,%a)) | inc %a }

  ; Insert, Replace or remove
  ; New-Command to buffer
  if ($2 isnum) {
    $iif( $fline(@cmds,$+(*,%NewCmd,*),1), !rline @cmds $fline(@cmds,$+(*,%NewCmd,*),1) %NewCmd %NewCmdLvl, !aline @cmds %NewCmd %NewCmdLvl )
  }
  elseif ($2 == DEL) { dline @cmds $fline(@cmds,$+(*,%NewCmd,*),1) }

  ; Remove original section/values
  !remini %file %section

  ; Readd Section
  !write -il1 %file $+([,%section,])

  ; Sort by level
  filter -wwcut 2 32 @cmds @cmds

  ; Loop through buffer and write back contents
  while $line(@cmds,%c) { var %cmd = $gettok($v1,1,32), %lvl = $gettok($v1,2,32) | !write -il $+ %b %file $+(%cmd,=,%lvl) | !inc %b | !inc %c }

  ; Close window
  window -c @cmds
}

Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: Can a Pro please script this !!!
« Reply #4 on: January 15, 2010, 05:20:52 pm »
This is not what he means, He means the admin level of the player. Not of the level needed for a command.

Offline ricardo

  • Street Thug
  • *
  • Posts: 14
    • View Profile
Re: Can a Pro please script this !!!
« Reply #5 on: January 16, 2010, 12:49:31 am »
sorry. can anyone help me with this?

i can add commands, how to remove using this way

Code: [Select]

alias test {
  ; Commands to add (separated by space)
  var %strCmds = !buycar=1 !sellcar=1 !mycars=1, %a = 1

  ; Loop through strCmds and pass to "SetCommandLevel"
  while (%a <= $numtok(%strCmds,32)) { SetCommandLevel $replace($gettok(%strCmds,%a,32),$chr(61),$chr(32)) | inc %a }
}


Offline RPM_Ranger

  • Street Thug
  • *
  • Posts: 5
    • View Profile
Re: Can a Pro please script this !!!
« Reply #6 on: January 16, 2010, 07:40:53 pm »
just one question at beginning you mean spawn or register?
Whenever they register

They automatically get Admin Level 5

Please and Thank you

Offline ricardo

  • Street Thug
  • *
  • Posts: 14
    • View Profile
Re: Can a Pro please script this !!!
« Reply #7 on: January 17, 2010, 12:13:00 am »
sorry. can anyone help me with this?

i can add commands, how to remove using this way

Code: [Select]

alias test {
  ; Commands to add (separated by space)
  var %strCmds = !buycar=1 !sellcar=1 !mycars=1, %a = 1

  ; Loop through strCmds and pass to "SetCommandLevel"
  while (%a <= $numtok(%strCmds,32)) { SetCommandLevel $replace($gettok(%strCmds,%a,32),$chr(61),$chr(32)) | inc %a }
}



I DID IT: HERE IS IT IN ONE
Code: [Select]
/*
** NOTE:
**
** The following alias adds, replaces or removes
** a command and its admin level in cmd.ini,
** keeping the levels in numerical sequence.

** Syntax:
** SetCommandLevel <NewCmd> <NewCmdLvl>

** Examples:
** SetCommandLevel !givecash 5 ; Add or Replace
** SetCommandLevel !givecash DEL  ; Delete
*/

alias SetCommandLevel {

  var %NewCmd = $1, %NewCmdLvl = $2

  var %file = cmd.ini, %section = COMMANDS

  ; Create Hidden Window
  window -h @cmds

  var %a = 1, %b = 2, %c = 1, %t

  ; Total Commands
  %t = $ini(%file,%section,0)

  ; Hold %file in buffer
  while (%a <= %t) { echo @cmds $ini(%file,%section,%a) $readini(%file,%section,$ini(%file,%section,%a)) | inc %a }

  ; Insert, Replace or remove
  ; New-Command to buffer
  if ($2 isnum) {
    $iif( $fline(@cmds,$+(*,%NewCmd,*),1), !rline @cmds $fline(@cmds,$+(*,%NewCmd,*),1) %NewCmd %NewCmdLvl, !aline @cmds %NewCmd %NewCmdLvl )
  }
  elseif ($2 == DEL) { dline @cmds $fline(@cmds,$+(*,%NewCmd,*),1) }

  ; Remove original section/values
  !remini %file %section

  ; Readd Section
  !write -il1 %file $+([,%section,])

  ; Sort by level
  filter -wwcut 2 32 @cmds @cmds

  ; Loop through buffer and write back contents
  while $line(@cmds,%c) { var %cmd = $gettok($v1,1,32), %lvl = $gettok($v1,2,32) | !write -il $+ %b %file $+(%cmd,=,%lvl) | !inc %b | !inc %c }

  ; Close window
  window -c @cmds
}


alias AddMultipleCmds {
  ; Commands to add (separated by space)
  var %a, %strCmds = !buycar=1 !sellcar=1 !mycars=1

  ; Loop through strCmds and pass to "SetCommandLevel"
  while (%a <= $numtok(%strCmds,32)) { SetCommandLevel $replace($gettok(%strCmds,%a,32),$chr(61),$chr(32)) | inc %a }

  ; Remove multipe commands from cmd.ini
  ; while (%a <= $numtok(%strCmds,32)) { SetCommandLevel $replace($gettok(%strCmds,%a,32),$mid($gettok(%strCmds,%a,32),$pos($gettok(%strCmds,%a,32),=), $len($gettok(%strCmds,%a,32))), $chr(32) DEL) | inc %a }
}


Offline RPM_Ranger

  • Street Thug
  • *
  • Posts: 5
    • View Profile
Re: Can a Pro please script this !!!
« Reply #8 on: January 17, 2010, 02:16:16 am »
sorry. can anyone help me with this?

i can add commands, how to remove using this way

Code: [Select]

alias test {
  ; Commands to add (separated by space)
  var %strCmds = !buycar=1 !sellcar=1 !mycars=1, %a = 1

  ; Loop through strCmds and pass to "SetCommandLevel"
  while (%a <= $numtok(%strCmds,32)) { SetCommandLevel $replace($gettok(%strCmds,%a,32),$chr(61),$chr(32)) | inc %a }
}



I DID IT: HERE IS IT IN ONE
Code: [Select]
/*
** NOTE:
**
** The following alias adds, replaces or removes
** a command and its admin level in cmd.ini,
** keeping the levels in numerical sequence.

** Syntax:
** SetCommandLevel <NewCmd> <NewCmdLvl>

** Examples:
** SetCommandLevel !givecash 5 ; Add or Replace
** SetCommandLevel !givecash DEL  ; Delete
*/

alias SetCommandLevel {

  var %NewCmd = $1, %NewCmdLvl = $2

  var %file = cmd.ini, %section = COMMANDS

  ; Create Hidden Window
  window -h @cmds

  var %a = 1, %b = 2, %c = 1, %t

  ; Total Commands
  %t = $ini(%file,%section,0)

  ; Hold %file in buffer
  while (%a <= %t) { echo @cmds $ini(%file,%section,%a) $readini(%file,%section,$ini(%file,%section,%a)) | inc %a }

  ; Insert, Replace or remove
  ; New-Command to buffer
  if ($2 isnum) {
    $iif( $fline(@cmds,$+(*,%NewCmd,*),1), !rline @cmds $fline(@cmds,$+(*,%NewCmd,*),1) %NewCmd %NewCmdLvl, !aline @cmds %NewCmd %NewCmdLvl )
  }
  elseif ($2 == DEL) { dline @cmds $fline(@cmds,$+(*,%NewCmd,*),1) }

  ; Remove original section/values
  !remini %file %section

  ; Readd Section
  !write -il1 %file $+([,%section,])

  ; Sort by level
  filter -wwcut 2 32 @cmds @cmds

  ; Loop through buffer and write back contents
  while $line(@cmds,%c) { var %cmd = $gettok($v1,1,32), %lvl = $gettok($v1,2,32) | !write -il $+ %b %file $+(%cmd,=,%lvl) | !inc %b | !inc %c }

  ; Close window
  window -c @cmds
}


alias AddMultipleCmds {
  ; Commands to add (separated by space)
  var %a, %strCmds = !buycar=1 !sellcar=1 !mycars=1

  ; Loop through strCmds and pass to "SetCommandLevel"
  while (%a <= $numtok(%strCmds,32)) { SetCommandLevel $replace($gettok(%strCmds,%a,32),$chr(61),$chr(32)) | inc %a }

  ; Remove multipe commands from cmd.ini
  ; while (%a <= $numtok(%strCmds,32)) { SetCommandLevel $replace($gettok(%strCmds,%a,32),$mid($gettok(%strCmds,%a,32),$pos($gettok(%strCmds,%a,32),=), $len($gettok(%strCmds,%a,32))), $chr(32) DEL) | inc %a }
}


Dude your like in my thread can you take that somewhere else