AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Code Snippets/Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=83)
-   -   Removing Blocks from Blockmaker (https://forums.alliedmods.net/showthread.php?t=124358)

KungPau 04-15-2010 18:57

Removing Blocks from Blockmaker
 
This is a tutorial on how to remove blocks from blockmaker
If you need help removing blocks just PM me ill be glad to help.
To Search for words in a code press CTRL+F!
For a better example scroll down and view NoFallDamage Example

Example on erasing a simple block:
Search & Erase
Code:

new const gszBlockModelNAME[] = "models/blockmaker/bm_block_name.mdl";
Search
Code:

const gBlockMax =
Erase One Number from gBlockMax
Example:
Code:

const gBlockMax = 24;
to
Code:

const gBlockMax = 23;
Search And Erase
Should be around the area where BM_PLATFORM, // A is located
Code:

BM_NAME,
Search & Erase
Code:

gszBlockModels[BM_NAME] = gszBlockModelNAME;
Search & Erase
Code:

"NAME",
Block KEY: Search & Erase Under --> new const gBlockSaveIds[gBlockMax]
Code:

'KEYHERE',          <--- The Blocks Key
Search & Erase
Code:

else if (equal(szType, "NAME")) blockType = BM_NAME;
Search & Erase
Code:

case BM_NAME: actionName(id);
Search & Erase
Code:

actionName(id)
{
//CODE HERE
}

Search & Erase
Code:

case 'KEYHERE': createBlock(0, BM_NAME, vVec1, axis, size);

********************************************* ***


Example on a No Fall Damage:
Some blocks may not be as difficult as nofalldamage
Search & Erase
Code:

new const gszBlockModelNoFallDamage[] = "models/blockmaker/bm_block_nofalldamage.mdl";
=========================================
Search & Erase
Code:

new bool:gbNoFallDamage[33];
=========================================
Search
Code:

const gBlockMax =
Erase One Number from gBlockMax
Example:
Code:

const gBlockMax = 24;
to
Code:

const gBlockMax = 23;
=========================================
Search & Erase
Code:

BM_NOFALLDAMAGE, //I
Search & Erase
Code:

gszBlockModels[BM_NOFALLDAMAGE] = gszBlockModelNoFallDamage;
Search & Erase
Code:

"No Fall Damage",
Search & Erase Under --> new const gBlockSaveIds[gBlockMax]
Code:

'I',
Search & Erase
Code:

else if (equal(szType, "NOFALLDAMAGE")) blockType = BM_NOFALLDAMAGE;
Search & Erase
Code:

gbNoFallDamage[id] = false;
Search & Erase
Code:

case BM_NOFALLDAMAGE: actionNoFallDamage(id);
============================================
"Hard Part" Search & Erase
Code:

  //if player is set to not get fall damage
  if (gbNoFallDamage[id])
  {
  entity_set_int(id,  EV_INT_watertype, -3);
  gbNoFallDamage[id] = false;

My way in erasing the "Hard Part":
Code:

public client_PostThink(id)
{
 //if player is alive
 if (is_user_alive(id))
 {
  //Nada
 }
}

============================================= =====
Search & Erase
Code:

actionNoFallDamage(id)
{
 //set the player to not receive any fall damage (handled in client_PostThink)
 gbNoFallDamage[id] = true;
}

Search & Erase
Code:

case 'I': createBlock(0, BM_NOFALLDAMAGE, vVec1, axis, size);

iwontsuffer 04-15-2010 19:14

Re: Removing Blocks from Blockmaker
 
This is a great tutorial. Even know you help me a lot with coding since I'm new... Keep up the good work!

Alucard^ 04-18-2010 03:19

Re: Removing Blocks from Blockmaker
 
Seriously i don't think this can be called "tutorial". You don't learn nothing with this. Here only say what you have to do, thats all.

r14170 05-02-2010 11:50

Re: Removing Blocks from Blockmaker
 
Quote:

Originally Posted by Alucard^ (Post 1153711)
Seriously i don't think this can be called "tutorial". You don't learn nothing with this. Here only say what you have to do, thats all.

its a kind of tutorial, but you are right ,youu dont learn nothing with this

t*stylez 05-02-2010 12:59

Re: Removing Blocks from Blockmaker
 
removing something is common sense basically.
if you see the block that your removing somewhere in the source, just remove that part of it.
This wasn't really a tutorial as said before.


All times are GMT -4. The time now is 11:54.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.