Day of Defeat Plugins Community
This site is an archive — everything is readable and downloadable, nothing can be posted. Admin

Dod_checkpoint

by h0_noMan · 2007-12-30 · 2 replies · 4975 views · 38 downloads

Read the thread (3 posts)

From the first post

This plugins is now completly tested and works fine.
rn
rnI am a fan of KZ maps and i wanted a plugins to add the possibility to save a location and move to this location after (when you failed a jump for example)
rn
rn
CHANGELOGrnrnv1.1 : rn- Added an unblock command to move if you are blockedrn- Simplyfing some code (array)rnrnv1.2 :rn- Removed the unblock commandrn- add_checkpoint now add only location that are fine (you shouldnt be blocked in a wall)rn- The language can be changed in the SMA by changing the value of languagernrn-----------rnrnCVAR :rndod_checkpoint 1|0 // Enable/Disable the modrnrn-----------rnrnConsole commands:rnadd_checkpoint   // Save the player's locationrngo_checkpoint    // Move the player to his last saved checkpointrnrnTested on AMX Mod X 1.80

rn
rnThanks for suggestions and comments.

Files

dod_checkpoint.sma Plugin Source 5 KB 38 dl Download Compile

The thread

All 3 posts from 3 people on Dod_checkpoint, kept as they were written.

H h0_noMan
started this thread
Posts: 80
Threads: 11
Joined: Dec 2007
12-30-2007, 08:00 PM #1

This plugins is now completly tested and works fine.rnrnI am a fan of KZ maps and i wanted a plugins to add the possibility to save a location and move to this location after (when you failed a jump for example)rnrn

CHANGELOGrnrnv1.1 : rn- Added an unblock command to move if you are blockedrn- Simplyfing some code (array)rnrnv1.2 :rn- Removed the unblock commandrn- add_checkpoint now add only location that are fine (you shouldnt be blocked in a wall)rn- The language can be changed in the SMA by changing the value of languagernrn-----------rnrnCVAR :rndod_checkpoint 1|0 // Enable/Disable the modrnrn-----------rnrnConsole commands:rnadd_checkpoint   // Save the player's locationrngo_checkpoint    // Move the player to his last saved checkpointrnrnTested on AMX Mod X 1.80
rnrnThanks for suggestions and comments.

=|[76AD]|= TatsuSaisei
posted here
Posts: 794
Threads: 54
Joined: May 2005
12-31-2007, 04:28 PM #2

one of the few minor things I noticed was this habit you have of using -1 during a return.. and then checking for it later... while this IS valid and DOES work.. there is a cleaner method...n ninstead of retunring -1 when not stuck ... return 0 (so the only possible returns are 1 and 0) and then when you "check" the return value in your if...n n

 nif(dod_stucked(id)==-1)n
n ncan be changed ton n
 nif(!dod_stucked(id))n
n nwhich is the same as
 nif(dod_stucked(id)== 0)n
n nand the oppositen
 nif(dod_stucked(id))n
n nis the same asn
 nif(dod_stucked(id)== 1)n
n nThe way IF works is that a statement is TRUE when it is ANY value OTHER then 0 and FALSE only when it is equal to 0n nso then down in the bottom of the plugin you could do this...n n
if(!get_cvar_num("dod_checkpoint"))
n nas opposed to n
if(get_cvar_num("dod_checkpoint")==0)
n nPersonally the only time I would use == is when I am looking for a specific value other then 0 or not 0 ... n ngood clean code though....n

{DwP} 325th ABN
posted here
Posts: 231
Threads: 12
Joined: Aug 2006
01-04-2008, 02:38 AM #3

ill give it a run if tatsu says clean im in

DoD Plugins Archive · Repository · Old Forum Threads · Maps · Admin · built 14 Sep 2026 00:34 UTC