How a player can create a checkpoint on ladder?
I have this code, but when you try create CP on a ladder it's says "
You can't make a checkpoint in the air" That's because of "
FL_ONGROUND2 "
PHP Code:
public CheckPoint(id)
{
if(get_pcvar_num(kz_checkpoints) == 1)
{
if( !is_user_alive( id ) )
{
switch (get_pcvar_num(kz_chatorhud))
{
case 1: ColorChat(id, GREEN, "You must be alive to use this command.")
case 2: kz_hud_message(id, "You must be alive to use this command")
}
return PLUGIN_HANDLED
}
if( !( pev( id, pev_flags ) & FL_ONGROUND2 ) )
{
switch (get_pcvar_num(kz_chatorhud))
{
case 1: ColorChat(id, GREEN, "You can't make a checkpoint in the air.")
case 2: kz_hud_message(id, "You can't make a checkpoint in the air")
}
return PLUGIN_HANDLED
}
if( IsPaused[id] )
{
switch (get_pcvar_num(kz_chatorhud))
{
case 1: ColorChat(id, GREEN, "You can't make a checkpoint in pause.")
case 2: kz_hud_message(id, "You can't make a checkpoint in pause")
}
return PLUGIN_HANDLED
}
pev(id, pev_origin, Checkpoints[id][g_bCpAlternate[id] ? 1 : 0])
g_bCpAlternate[id] = !g_bCpAlternate[id]
checknumbers[id]++
switch (get_pcvar_num(kz_chatorhud))
{
case 1: ColorChat(id, GREEN, "^1Checkpoint ^3#%d ^1created",checknumbers[id])
case 2: kz_hud_message(id, "Checkpoint #%d",checknumbers[id])
}
}
else
{
switch (get_pcvar_num(kz_chatorhud))
{
case 1: ColorChat(id, GREEN, "Checkpoints are off.")
case 2: kz_hud_message(id, "Checkpoints are off")
}
}
return PLUGIN_HANDLED
}