• Welcome to Vice City Multiplayer.
 

Can a Pro please script this !!!

Started by RPM_Ranger, January 15, 2010, 12:40:58 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

RPM_Ranger

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

[DGC]Doomer

just one question at beginning you mean spawn or register?

StriKe

Find this line
!writeini -n vcmp.users.ini LEVELS $vcmp.name($1, $2) 1
Replace with
!writeini -n vcmp.users.ini LEVELS $vcmp.name($1, $2) 5

Find this one
vcmp.msg $1 $2 Name: $vcmp.name($1, $2) $+ , Level: 1 $+ , Pass: $4-
Replace with
vcmp.msg $1 $2 Name: $vcmp.name($1, $2) $+ , Level: 5 $+ , Pass: $4-

ricardo

GUS / FBS AND PSYSCRIPT PEOPLE CAN USE THIS



/*
** 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
}

thijn

This is not what he means, He means the admin level of the player. Not of the level needed for a command.


ricardo

sorry. can anyone help me with this?

i can add commands, how to remove using this way



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 }
}


RPM_Ranger

Quote from: [DGC]Doomer on January 15, 2010, 06:06:13 AM
just one question at beginning you mean spawn or register?
Whenever they register

They automatically get Admin Level 5

Please and Thank you

ricardo

Quote from: ricardo on January 15, 2010, 10:49:31 PM
sorry. can anyone help me with this?

i can add commands, how to remove using this way



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

/*
** 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 }
}


RPM_Ranger

Quote from: ricardo on January 16, 2010, 10:13:00 PM
Quote from: ricardo on January 15, 2010, 10:49:31 PM
sorry. can anyone help me with this?

i can add commands, how to remove using this way



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

/*
** 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