freeze
Posted: 2011 Jun 16 17:39
Kaip padaryti, kad zaidejai sustingtu kokiom 5sec, jei kazkoks kintamasis yra true?
KamiN wrote:Gal gali pavizdi duot? Dar gerai butu kad ta sustingus komanda negaletu ir saudyt.
Code: Select all
new bool:kazkas if(kazkas){ if(cs_get_user_team(id) == CS_TEAM_T) set_user_maxspeed(id, 0.1) set_task(5.0, "kazkas1", id)} public kazkas1{set_user_maxspeed(id, 250.0)}
Tai jei sitas veikia, tada kodas atrodytu taip?// How to freeze:
set_pev(id, pev_flags, (pev(id, pev_flags) | FL_FROZEN));
// How to unfreeze:
set_pev(id, pev_flags, (pev(id, pev_flags) & ~FL_FROZEN));
Code: Select all
new bool:kazkas if(kazkas){ if(cs_get_user_team(id) == CS_TEAM_T) set_pev(id, pev_flags, (pev(id, pev_flags) | FL_FROZEN)); set_task(5.0, "kazkas1", id)} public kazkas1{set_pev(id, pev_flags, (pev(id, pev_flags) & ~FL_FROZEN));}
Code: Select all
new bool:HasTurn register_forward(FM_PlayerPreThink, "fwdPlayerPreThink", 0); public fwdPlayerPreThink(id){ if(HasTurn) { if(is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T) { set_pev(id, pev_flags, (pev(id, pev_flags) | FL_FROZEN)); set_task(5.0, "unfreeze") } }} public unfreeze(id){ set_pev(id, pev_flags, (pev(id, pev_flags) & ~FL_FROZEN));}
Code: Select all
new bool:HasTurn register_forward(FM_PlayerPreThink, "fwdPlayerPreThink", 0); public fwdPlayerPreThink(id){ if(HasTurn) { if(is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T && ~pev(id, pev_flags) & FL_FROZEN) { set_pev(id, pev_flags, (pev(id, pev_flags) | FL_FROZEN)); set_task(5.0, "unfreeze", id) } }} public unfreeze(id){ if(!is_user_connected(id)) return set_pev(id, pev_flags, (pev(id, pev_flags) & ~FL_FROZEN));}