Author Topic: !report - script help  (Read 6888 times)

0 Members and 1 Guest are viewing this topic.

Offline Chezor

  • Wiseguy
  • **
  • Posts: 90
  • RPG Planet Scripter
    • View Profile
    • RPG Planet
!report - script help
« on: September 03, 2008, 05:23:53 pm »
If i type !report <name> <reason>
it should report to the admin online at the moment in the server. [ the admin which will be shown when we type !admin cmd ]

like
!report chezor rulebreaking
pm to chezor: thankyou for your report.
pm to all admins: reported: chezor, reason: rulebreaking.

i need some help in pming the admin present online ! im trying but i cudnt script this.. give some help.. im learning through GUS so help according to aliases in GUS..



elseif ($2 == !report) || (!rport) {
    if ($vcmp.cmdcheck(!report,%id) == fail) !halt
elseif (!$3) vcmp.msg %id Absent ID/Name
elseif (!$4) vcmp.msg %id Absent reason, Syntax: !report <name> <reason>
else {
vcmp.msg %id You sent report to admins, Thanks for your support.


and further there in above script i need is that.. it should sent pm to admin present online..

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

Offline K.I.S.S

  • Street Thug
  • *
  • Posts: 16
    • View Profile
Re: !report - script help
« Reply #1 on: September 03, 2008, 06:14:26 pm »
Code: [Select]
elseif ($2 == !report) || ($2 == !pmreport) {
  var %aa = 0,%bb,%cc,%dd
  if ($vcmp.cmdcheck(!report,%id) == fail) !halt
  elseif (!$4-) vcmp.msg %id Error - $2 <name> <reason>
  elseif (%a == -1) vcmp.msg %id Error - Absent ID/Name $+ , $2 <name> <reason>
  else {

    vcmp.say Reporting - Name: $vcmp.name(%a) $+ , From: $vcmp.name(%b) $+ , Reason: $4-
    !write vcmp.report.txt Date: $date - Time: $timestamp - Reported: $vcmp.name(%a) - From: $vcmp.name(%b) - Reason: $4-

    while (%aa <= 50) {
      if ($vcmp.level(%aa) >= 4) {
        if (!%bb) %bb = $vcmp.name(%aa)
        elseif ($numtok(%bb,32) <= 10) %bb = %bb  $vcmp.name(%aa)
        elseif (!%cc) %cc = $vcmp.name(%aa)
        elseif ($numtok(%cc,32) <= 10) %cc = %cc  $vcmp.name(%aa)
        elseif (!%dd) %dd = $vcmp.name(%aa)
        elseif ($numtok(%dd,32) <= 10) %dd = %dd  $vcmp.name(%aa)
      }
      !inc %aa
    }
    if (%bb) {
      //tokenize 32 %bb
      if ($1) vcmp.msg $vcmp.getid($1) $1 $+ , Reported: $vcmp.name(%a) - From: $vcmp.name(%b) - Reason: $4-
      if ($2) vcmp.msg $vcmp.getid($2) $2 $+ , Reported: $vcmp.name(%a) - From: $vcmp.name(%b) - Reason: $4-
      if ($3) vcmp.msg $vcmp.getid($3) $3 $+ , Reported: $vcmp.name(%a) - From: $vcmp.name(%b) - Reason: $4-
      if ($4) vcmp.msg $vcmp.getid($4) $4 $+ , Reported: $vcmp.name(%a) - From: $vcmp.name(%b) - Reason: $4-
      if ($5) vcmp.msg $vcmp.getid($5) $5 $+ , Reported: $vcmp.name(%a) - From: $vcmp.name(%b) - Reason: $4-
      if ($6) vcmp.msg $vcmp.getid($6) $6 $+ , Reported: $vcmp.name(%a) - From: $vcmp.name(%b) - Reason: $4-
      if ($7) vcmp.msg $vcmp.getid($7) $7 $+ , Reported: $vcmp.name(%a) - From: $vcmp.name(%b) - Reason: $4-
      if ($8) vcmp.msg $vcmp.getid($8) $8 $+ , Reported: $vcmp.name(%a) - From: $vcmp.name(%b) - Reason: $4-
      if ($9) vcmp.msg $vcmp.getid($9) $9 $+ , Reported: $vcmp.name(%a) - From: $vcmp.name(%b) - Reason: $4-
    }
  }
}

UNTESTED!

Uses the tokenize identifer to split the online players up by their level. sends a report to them if they are level 4 or greater.


UNTESTED!

Offline Force

  • LU Developer
  • Made Man
  • *
  • Posts: 242
    • View Profile
Re: !report - script help
« Reply #2 on: September 03, 2008, 06:51:00 pm »
This one is a lot shorter than K.I.S.S's and just a note kiss, you don't need to get the names of the admins online  ;)

Code: [Select]
elseif ($2 == !report) || (!rport) {
  if ($vcmp.cmdcheck(!report,%id) == fail) !halt
  elseif (!$3) vcmp.msg %id Absent ID/Name
  elseif (!$4) vcmp.msg %id Absent reason, Syntax: !report <name> <reason>
  else {
    vcmp.msg %id You sent report to admins, Thanks for your support.     
    var %a = 0
    while (%a <= 50) {
      if ($vcmp.level(%a) > 6) {
        vcmp.msg %a Report from ( $+ $2 $+ ) $vcmp.name($2) $+ : Reported: $3- Reason: $4-
      }
      !inc %a
    }
  }
}

Offline K.I.S.S

  • Street Thug
  • *
  • Posts: 16
    • View Profile
Re: !report - script help
« Reply #3 on: September 03, 2008, 07:16:25 pm »
yours may be shorter [SDT]force, but its daft.

your sending it out to 50 players regardless if their online or not. so the loop will continue processing even if there is no player to send it too. 50 times.

i will reffer your to the recently post by Ginarrbrik
http://forum.vicecitymultiplayer.com/index.php?PHPSESSID=2681a0adce9789207d78279a18edddf4&topic=694.0

you might like to run your eyes over it.

Offline Force

  • LU Developer
  • Made Man
  • *
  • Posts: 242
    • View Profile
Re: !report - script help
« Reply #4 on: September 03, 2008, 07:19:05 pm »
jajaja, i understand that ;) I used 50 as an example.

@ Chezor: The 50 in (while <= 50) { needs to be changed to the players limit of your server.

I don't know any restricting methods for GUS.

Windlord

  • Guest
Re: !report - script help
« Reply #5 on: September 03, 2008, 08:20:35 pm »
I don't think Force's method is daft as it only checks stuff once per loop
Yours does loads of things in a single loop and has the limit of being able to send messages to max. 9 admins online.
Setting names and levels into a var as a long string then tokenizing it again seems just simply daft.
Please proof-read your own codes before calling other codes daft.

Regards,
Windlord



Offline K.I.S.S

  • Street Thug
  • *
  • Posts: 16
    • View Profile
Re: !report - script help
« Reply #6 on: September 03, 2008, 08:38:14 pm »
if you wish to jump on board to fight for someone else, join another forum and stop spamming up this one.

edit:

i decided to be helpfull to Chezor, and so did [sdt]force but you decide to be a spammer.

ps, the loop itsself was created by tommis, i took it from GUS. if you have issues with it talk to tommis.

the only thing i did (and note its not within the loop)  was to use the tokenize identifer to send the message to 9 online admins.

pps, the reason i didnt reply to [sdt]force's last post is because i agreed with him.

why you decided to push for a argument and spam up the forum, i have no idea.
« Last Edit: September 03, 2008, 09:08:53 pm by K.I.S.S »

Offline Chezor

  • Wiseguy
  • **
  • Posts: 90
  • RPG Planet Scripter
    • View Profile
    • RPG Planet
Re: !report - script help
« Reply #7 on: September 03, 2008, 09:10:24 pm »
jajaja, i understand that ;) I used 50 as an example.

@ Chezor: The 50 in (while <= 50) { needs to be changed to the players limit of your server.

I don't know any restricting methods for GUS.

umm if player limit = max slots ?
means i got 50 slots so it will be 50 only right ? sorry im not great scriptor  ::)

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

Offline Force

  • LU Developer
  • Made Man
  • *
  • Posts: 242
    • View Profile
Re: !report - script help
« Reply #8 on: September 03, 2008, 09:15:50 pm »
Yep if you have 50 player slots it would be while (%a <= 50), if you had 16 player slots it would be while (%a <= 16) and so on  :)

Offline Chezor

  • Wiseguy
  • **
  • Posts: 90
  • RPG Planet Scripter
    • View Profile
    • RPG Planet
Re: !report - script help
« Reply #9 on: September 03, 2008, 09:23:15 pm »
hmm guys.. 1 problem u didnt see :P

reported: $3
so if i type
!report fkoff wtf
chezor reported fkoff reason wtf

i want to report a player in server. even if i include his id in $3 then also it shud report to admins

like
Chezor and kiss are present in server
chezor: !report ki deathmatching
pm >> : chezor reported kiss deathmatching

but with this script
chezor: !Report ki deathmatching
pm >> : chezor reported ki deathmatching

so its like i made

  elseif ($2 == !report) || (!rport) {
    if ($vcmp.cmdcheck(!report,%id) == fail) !halt
    elseif (!$3) vcmp.msg %id Absent ID/Name
    elseif (!$4) vcmp.msg %id Absent reason, Syntax: !report <name> <reason>
    else {
      vcmp.msg %id You sent report to admins, Thanks for your support.     
      var %a = 0
      while (%a <= 50) {
        if ($vcmp.level(%a) > 2) {
          vcmp.msg %a $vcmp.name(%id) Reported: $vcmp.name(%a) Reason: $4-
        }
        !inc %a
      }
    }
  }
« Last Edit: September 03, 2008, 09:25:01 pm by Chezor »

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

Offline Orpheus

  • Street Thug
  • *
  • Posts: 20
    • View Profile
Re: !report - script help
« Reply #10 on: September 03, 2008, 09:27:44 pm »
OFF TOPIC:  K.I.S.S , I know what you have said, about windlord spamming this topic, and i just wanted to say, its not fair to call it spam, he wasnt attacking you, he was just pointing out that "he who throws the first  stone should be standing on solid ground " a metaphor for, your script was no better so, don't call others scripts such things

ON topic:Thanks force, thatll help me when I do my VCMP Server :) I plan to use a lot of while loops

Regards Orph

P,s appologies if this is spam

Offline Chezor

  • Wiseguy
  • **
  • Posts: 90
  • RPG Planet Scripter
    • View Profile
    • RPG Planet
Re: !report - script help
« Reply #11 on: September 03, 2008, 09:27:54 pm »
oops a major bug there in my script :P i fixed it here

Quote
 elseif ($2 == !report) || (!rport) {
    if ($vcmp.cmdcheck(!report,%id) == fail) !halt
    elseif (!$3) vcmp.msg %id Absent ID/Name
    elseif (!$4) vcmp.msg %id Absent reason, Syntax: !report <name> <reason>
    else {
      vcmp.msg %id You sent report to admins, Thanks for your support.    
      var %a = 0
      while (%a <= 50) {
        if ($vcmp.level(%a) > 2) {
          vcmp.msg %a $vcmp.name(%id) Reported: $vcmp.name(%a) Reason: $4-
        }
        !inc %a
      }
    }
  }

  elseif ($2 == !report) || (!rport) {
    if ($vcmp.cmdcheck(!report,%id) == fail) !halt
    elseif (!$3-) vcmp.msg %id Absent ID/Name
    elseif (!$4) vcmp.msg %id Absent reason, Syntax: !report <name> <reason>
    else {
      vcmp.msg %id You sent report to admins, Thanks for your support.    
      var %a = 0
      while (%a <= 50) {
        if ($vcmp.level(%a) > 2) {
          vcmp.msg %a $vcmp.name(%id) Reported: $vcmp.name(%a) Reason: $4-
        }
        !inc %a
      }
    }
  }

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