View unanswered posts | View active topics
|
Page 1 of 1
|
[ 3 posts ] |
|
| Author |
Message |
|
westrupp
|
Post subject: anti resskill code Posted: Thu Jul 10, 2008 10:24 am |
|
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 |
|
 |
|
Luth
|
Post subject: Re: anti resskill code Posted: Thu Jul 10, 2008 11:31 am |
|
 |
| POL Developer |
Joined: Mon Jan 30, 2006 8:10 am Posts: 85
|
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 |
|
 |
|
westrupp
|
Post subject: ReadGameClock Posted: Sat Jul 19, 2008 8:54 am |
|
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 |
|
 |
|
Page 1 of 1
|
[ 3 posts ] |
|
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
|
|