AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Prokreedz , checkpoint while ducking (https://forums.alliedmods.net/showthread.php?t=50652)

aDr. 01-31-2007 07:54

Prokreedz , checkpoint while ducking
 
1 Attachment(s)
Please sombody who know to make amxx plugins , help me and make prokreedz to suport checkpoint while ducking , 10x

[ --<-@ ] Black Rose 01-31-2007 09:32

Re: Prokreedz , checkpoint while ducking
 
There is a reason its disabled...
When you load that checkpoint you will probably get stucked to the ground.
But if you wanna edit it anyway:

lines 258-261:
Code:
            if(entity_get_int(id,EV_INT_flags)&FL_DUCKING) {                 client_print(id,print_chat,"[ProKreedz] You can not create a checkpoint while ducking")                 return PLUGIN_HANDLED             }
Delete them.

aDr. 01-31-2007 09:50

Re: Prokreedz , checkpoint while ducking
 
10x , but like u have say, i get stuck when i teleport to a duck checkpoint , there must be another way , like in kz jump plugin

[ --<-@ ] Black Rose 01-31-2007 10:06

Re: Prokreedz , checkpoint while ducking
 
but if you duck when you teleport to that checkpoint and then get up you wont get stuck...

EDIT:
This code forces the people to duck when teleporting to a(ny) checkpoint.

line 400 somewhere.
Replace "entity_set_origin(id,checkpoints[id-1][cp])" with this code.
Code:
if ( entity_get_int(id, EV_INT_flags) & FL_DUCKING ) {     // First check, maby they're allready ducking.     entity_set_origin(id,checkpoints[id-1][cp]) } else {     client_cmd(id, "+duck")     entity_set_origin(id,checkpoints[id-1][cp])     client_cmd(id, "-duck") }
Though, I don't know if it will work. The player might not duck fast enough. But I think that won't happen.

aDr. 01-31-2007 10:44

Re: Prokreedz , checkpoint while ducking
 
The players dont duck fast enought , and get stuck in the wall , like u have say

aDr. 01-31-2007 10:54

Re: Prokreedz , checkpoint while ducking
 
}

set_pev(id, pev_velocity, {0, 0, 0}); // Reset velocity
set_pev(id, pev_origin, cp_origin);
kz_show_hud(id, 128, 0, 128, 0.29, 0.89, "You have been teleported to your checkpoint.");
delay_duck(id);

gc_count[id]++;
}

return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}

delay_duck(id)
{
set_task(0.01, "force_duck", id);
_fm_set_entity_flags(id, FL_DUCKING, 1);
}

public force_duck(id)
{
_fm_set_entity_flags(id, FL_DUCKING, 1);
}

This is in Kz Jump Plugin , but i dont know what i have to do , where to put these code , or what to change

aDr. 01-31-2007 11:33

Re: Prokreedz , checkpoint while ducking
 
I think the delay_duck(id) its important , but i dont know how to make these to work :( i am not a amxx coder :cry:

[ --<-@ ] Black Rose 01-31-2007 11:41

Re: Prokreedz , checkpoint while ducking
 
Replace the whole function goto_cp with this.
Code:
public goto_cp(id,cp) {     new semiclip = get_pcvar_num(kz_semiclip)     if(semiclip == -1 || (!noblock[id-1] && semiclip == 0)) {         new Float:origin[3]         for(new i=1;i<=get_maxplayers();i++) {             if(id != i && is_user_connected(i) && is_user_alive(id)) {                 if(semiclip == -1 || (!noblock[i-1] && semiclip == 0)) {                     entity_get_vector(i,EV_VEC_origin,origin)                     if(get_distance_f(checkpoints[id-1][cp],origin) <= CP_DISTANCE) {                         client_print(id,print_chat,"[ProKreedz] Somebody is too close to your checkpoint")                         return false                     }                 }             }         }     }     if ( entity_get_int(id, EV_INT_flags) & FL_DUCKING )         delay_teleport(id)     else {         client_cmd(id, "+duck")         set_task(1.0, "delay_teleport", id)         set_task(1.2, "stop_duck", id)     }     return true } public delay_teleport(id) {     entity_set_origin(id,checkpoints[id-1][cp])     entity_set_vector(id,EV_VEC_velocity,Float:{0.0,0.0,0.0})     spawnsprite(checkpoints[id-1][cp])     set_user_gravity(id) // to fix the low gravity bug on kz_man_redrock (thanks to NoEx)     noblock_task() } public stop_duck(id)     client_cmd(id, "-duck")

aDr. 01-31-2007 12:35

Re: Prokreedz , checkpoint while ducking
 
Big Thanx , i will try soon

aDr. 01-31-2007 12:44

Re: Prokreedz , checkpoint while ducking
 
1 Attachment(s)
I dont know what i do wrong ,

/home/groups/alliedmodders/forums/files/2/1/5/0/3/13591.attach(221) : warning 217: loose indentation
/home/groups/alliedmodders/forums/files/2/1/5/0/3/13591.attach(323) : error 017: undefined symbol "cp"
/home/groups/alliedmodders/forums/files/2/1/5/0/3/13591.attach(325) : error 017: undefined symbol "cp"
/home/groups/alliedmodders/forums/files/2/1/5/0/3/13591.attach(386) : error 021: symbol already defined: "goto_cp"

3 Errors.
Could not locate output file /home/groups/amxmodx/public_html/compiled3/13591.amx (compile failed).


All times are GMT -4. The time now is 00:41.

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