It is currently Wed Oct 15, 2008 8:15 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: anti resskill code
PostPosted: Thu Jul 10, 2008 10:24 am 
Offline

Joined: Wed Aug 01, 2007 3:07 am
Posts: 47
Location: Brazil
Code:
   var resskill := GetObjProperty(ghost, "resskill");
   if (killer == resskill)
      SetObjProperty( ghost, "killedtimes", 1);
   endif
   var killedtimes := getobjproperty (ghost,"killedtimes");
   if (killedtimes == 1)
      SetObjProperty( ghost, "killedtimes", 2);
   endif
   if (killedtimes == 2)
      SetObjProperty( ghost, "killedtimes", 3);
   endif
   if (killedtimes == 3)
      SetObjProperty( ghost, "killedtimes", 4);
   endif
   if (killedtimes == 4)
      MoveCharacterToLocation( killer, 5304, 1184, 0, 0);
      SendSysMessage( killer, "You have been jailed");
   endif


dont work...i think i dont have correct value for killer


Top
 Profile  
 
 Post subject: Re: anti resskill code
PostPosted: Thu Jul 10, 2008 11:31 am 
Offline
POL Developer

Joined: Mon Jan 30, 2006 8:10 am
Posts: 112
Code:
   // resskill should be the serial of the last person to kill this character
   var resskill := GetObjProperty(ghost, "resskill");
   if (killer.serial != resskill)
      SetObjProperty( ghost, "resskill", killer.serial);
      SetObjProperty( ghost, "killedtimes", 1);
      return;
   endif

   var killedtimes := CInt(getobjproperty (ghost,"killedtimes"));
   if (killedtimes < 4)
      SetObjProperty( ghost, "killedtimes", killedtimes + 1);
   else
      MoveCharacterToLocation( killer, 5304, 1184, 0, 0);
      SendSysMessage( killer, "You have been jailed");
   endif


This is a cleaner version of your script. I made a few assumptions, but it may fix your problem. :) Here's hoping.


Top
 Profile  
 
 Post subject: ReadGameClock
PostPosted: Sat Jul 19, 2008 8:54 am 
Offline

Joined: Wed Aug 01, 2007 3:07 am
Posts: 47
Location: Brazil
Code:

   var acc := playr.acct;

   var penultimopk := GetObjProperty (ghost,"ultimopk");
   SetObjProperty( ghost, "penultimopk", penultimopk);
   SetObjProperty( ghost, "ultimopk", plyr.name);

   ReadConfigFile("::npcdesc");
       FindConfigElem(conf2, "plyr.npctemplate");
   if (plyr.npctemplate)
      SetObjProperty( ghost, "killedtimes", 0);
      EraseObjProperty( ghost, "ultimopk" );
   endif

   
   var killedtimes := CInt(getobjproperty (ghost,"killedtimes"));
      if (killedtimes > 4)
             MoveCharacterToLocation( plyr , 5304, 1184, 0, 0);
                    acc.setprop("Release", (ReadGameClock() + 345600)); // 4 Days
            SendSysMessage( plyr , "Jailed by Anti-Resskill System.");
                    SetObjProperty( ghost, "killedtimes", 0);
      endif

   var resskill  := GetObjProperty (ghost,"ultimopk");
   var resskill2 := GetObjProperty (ghost,"penultimopk");
   if (resskill != resskill2)
            SetObjProperty( ghost, "killedtimes", 0);
      endif

      if ((resskill == resskill2) and (killedtimes < 5))
            SetObjProperty( ghost, "killedtimes", killedtimes + 1);
   endif



Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl