Removing Blocks from Blockmaker

For scripting examples for learning how to use AMXX.
User avatar
Archive-Poster
Posts: 1229
Gender:
United States of America

Removing Blocks from Blockmaker

Post by Archive-Poster »

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: Select all

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

Code: Select all

const gBlockMax =
Erase One Number from gBlockMax
Example:

Code: Select all

const gBlockMax = 24;
to

Code: Select all

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

Code: Select all

BM_NAME,
Search & Erase

Code: Select all

gszBlockModels[BM_NAME] = gszBlockModelNAME;
Search & Erase

Code: Select all

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

Code: Select all

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

Code: Select all

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

Code: Select all

case BM_NAME: actionName(id);
Search & Erase

Code: Select all

actionName(id)
{
//CODE HERE
}
Search & Erase

Code: Select all

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: Select all

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

Code: Select all

new bool:gbNoFallDamage[33];
Search

Code: Select all

const gBlockMax =
Erase One Number from gBlockMax
Example:

Code: Select all

const gBlockMax = 24;
to

Code: Select all

const gBlockMax = 23;
Search & Erase

Code: Select all

BM_NOFALLDAMAGE, //I
Search & Erase

Code: Select all

gszBlockModels[BM_NOFALLDAMAGE] = gszBlockModelNoFallDamage;
Search & Erase

Code: Select all

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

Code: Select all

'I',
Search & Erase

Code: Select all

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

Code: Select all

gbNoFallDamage[id] = false;
Search & Erase

Code: Select all

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

Code: Select all

  //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: Select all

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

Code: Select all

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

Code: Select all

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

Who is online

Users browsing this forum: No registered users and 1 guest