AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Blockmaker - Water Block |H |E |L |P (https://forums.alliedmods.net/showthread.php?t=95797)

cikjam 06-27-2009 11:30

Blockmaker - New Mad Water Block |H |E |L |P - Is this possible? Any help? +karma
 
Hey,

I was just thinking of a water block, like in some maps where there is water and u hold space to water strafe in it.

But i want this in blockmaker with no fall damage as well like usual. I want to replace the original NoFallDamage block with this. I don't want this to be a solid block I want you to be able to fall straight through it like normal water.

Thankyou,
Any help will be greatly appreciated and
+karma

cikjam 06-28-2009 02:17

Re: Blockmaker - Water Block |H |E |L |P
 
Is this possible? Any help?

xPaw 06-28-2009 08:31

Re: Blockmaker - Water Block |H |E |L |P
 
set_pev( ent, pev_contents, CONTENTS_WATER );

cikjam 06-28-2009 11:02

Re: Blockmaker - Water Block |H |E |L |P
 
Ok cool, so thats the action id?

And do i need to do something to make it not solid? Could you tell me that please, I'm only use to adding solid stuff. And like this has to be always not solid.

cikjam 06-29-2009 00:19

Re: Blockmaker - Water Block |H |E |L |P
 
I tried putting it as action id, that didn't work, then i tried putting where bhop and make it not solid or wateva and that didn't work.
I got no clue, what else do i have to do?

micke1101 06-29-2009 01:34

Re: Blockmaker - Water Block |H |E |L |P
 
Correct me if im wrong (which i probably have :P)
but i think here is where you have to add the code

Code:

public pfn_touch(ent, id)
{
    //if touch event involves a player
    if (id > 0 && id <= 32)
    {
        //if player is alive
        if (is_user_alive(id))
        {
            //if entity involved is a block
            if (isBlock(ent))
            {
                //get the blocktype
                new blockType = entity_get_int(ent, EV_INT_body);
               
                //if blocktype is a bunnyhop block or barrier
                if (blockType == BM_BHOP || blockType == BM_BARRIER_CT || blockType == BM_BARRIER_T || blockType == BM_BHOP_NOSLOW)
                {
                    //if task does not already exist for bunnyhop block
                    if (!task_exists(TASK_BHOPSOLIDNOT + ent) && !task_exists(TASK_BHOPSOLID + ent))
                    {
                        //get the players team
                        new CsTeams:team = cs_get_user_team(id);
                       
                        //if players team is different to barrier
                        if (blockType == BM_BARRIER_CT && team == CS_TEAM_T)
                        {
                            //make block SOLID_NOT without any delay
                            taskSolidNot(TASK_BHOPSOLIDNOT + ent);
                        }
                        else if (blockType == BM_BARRIER_T && team == CS_TEAM_CT)
                        {
                            //make block SOLID_NOT without any delay
                            taskSolidNot(TASK_BHOPSOLIDNOT + ent);
                        }
                        else if (blockType == BM_BHOP || blockType == BM_BHOP_NOSLOW)
                        {
                            //set bhop block to be SOLID_NOT after 0.1 seconds
                            set_task(0.1, "taskSolidNot", TASK_BHOPSOLIDNOT + ent);
                        }
                    }
                }
            }
        }
    }
   
    return PLUGIN_CONTINUE;
}


xPaw 06-29-2009 02:14

Re: Blockmaker - Water Block |H |E |L |P
 
I though making block not solid and contents water, but you could not grab it, and maybe swim in it too =D

cikjam 06-29-2009 02:36

Re: Blockmaker - Water Block |H |E |L |P
 
Xpaw could you tell me what do I add and on which lines? Please

I tried what mickey said,
I tried
PHP Code:

       else if (blockType == BM_WATER)
       {
            
//water
            
set_pev(entpev_contentsCONTENTS_WATER); 

and i tried
PHP Code:

       else if (blockType == BM_WATER)
       {
            
//water
             
set_task(0"taskSolidNot"TASK_BHOPSOLIDNOT ent);
             
set_pev(entpev_contentsCONTENTS_WATER); 

I dont even know what I am doing, i get like 26 errors and stuff.

xPaw 06-29-2009 02:39

Re: Blockmaker - Water Block |H |E |L |P
 
Just stop coding.

cikjam 06-29-2009 02:40

Re: Blockmaker - Water Block |H |E |L |P
 
I want this water block =[
I dont know how to code, i just trying to add blocks, no one tells me where to put stuff


All times are GMT -4. The time now is 15:30.

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