Vice City Multiplayer

VC:MP => mIRC/pawn Scripting => Topic started by: Chezor on September 03, 2008, 04:23:53 PM

Title: !report - script help
Post by: Chezor on September 03, 2008, 04: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..
Title: Re: !report - script help
Post by: K.I.S.S on September 03, 2008, 05:14:26 PM

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!
Title: Re: !report - script help
Post by: Force on September 03, 2008, 05: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  ;)


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
    }
  }
}
Title: Re: !report - script help
Post by: K.I.S.S on September 03, 2008, 06: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.
Title: Re: !report - script help
Post by: Force on September 03, 2008, 06: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.
Title: Re: !report - script help
Post by: Windlord on September 03, 2008, 07: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


Title: Re: !report - script help
Post by: K.I.S.S on September 03, 2008, 07: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.
Title: Re: !report - script help
Post by: Chezor on September 03, 2008, 08:10:24 PM
Quote from: [SDT]F_T_F0RC3 on September 03, 2008, 06: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.

umm if player limit = max slots ?
means i got 50 slots so it will be 50 only right ? sorry im not great scriptor  ::)
Title: Re: !report - script help
Post by: Force on September 03, 2008, 08: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  :)
Title: Re: !report - script help
Post by: Chezor on September 03, 2008, 08: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
      }
    }
  }
Title: Re: !report - script help
Post by: Orpheus on September 03, 2008, 08: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
Title: Re: !report - script help
Post by: Chezor on September 03, 2008, 08:27:54 PM
oops a major bug there in my script :P i fixed it here

Quoteelseif ($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
     }
   }
 }