Ok thanks. Now I figured out that the function only hangs till it executes the code inside it and the goes on, does not wait for any other set_task or function calls inside that code.
Code:
public concmd_screen(id, level, cid)
{
..............
a_poze = true;
a_poze1[player] = true;
..............
increment = 0;
help = 4;
set_task(2.0, "SS_propriuzis", player, _, _, "a", screens)
log_amx("Screenshot: Admin ^"%s<%d><%s><%s>^" took %d+1 ss on ^"%s<%d><%s><%s>^"", adminname, get_user_userid(id), authid, ip2, screens, name, get_user_userid(player), authid2, ip);
return PLUGIN_HANDLED;
}
public SS_propriuzis(player)
{
increment++;
get_time("%m/%d/%Y - %H:%M:%S", timestamp, 31);
set_hudmessage(player, 255, 0, -1.0, 0.3, 0, 0.25, 1.0, 0.0, 0.0, 4);
format(timestampmsg, 127, "** PLAYER %s ORA: - %s **",name,timestamp);
show_hudmessage(player, timestampmsg);
client_print(0, print_chat, "** Screenshot taken on player ^"%s^" by admin ^"%s^" (%s) **", name, adminname, timestamp);
client_print(player, print_chat, "IP-ul tau: %s | %s | Screenshot %d", ip, authid2, pula);
client_cmd(player, "wait;snapshot");
if(increment > screens-1) set_task(0.20, "SS_sigil", player, _, _, "a",4)
}
public SS_sigil(player)
{
if(help == 4)
do something;
if(help == 3)
{
do something;
}
if(help == 2)
do something;
help--;
if(help == 0)
{
do something;
set_task(0.30, "SS_finish", player);
}
}
public SS_finish(player)
{
client_print(player, print_chat, "Posteaza Pozele pe: <a href="http://www.***.***" target="_blank" rel="nofollow noopener">www.***.***</a> pentru unban!");
client_print(player, print_chat, "Posteaza Pozele pe: <a href="http://www.***.***" target="_blank" rel="nofollow noopener">www.***.***</a> pentru unban!");
a_poze = false;
a_poze1[player] = false;
}
public client_disconnect(id)
{
if(a_poze1[id])
{
a_poze = false;
a_poze1[id] = false;
set_user_godmode(id);
remove_task(id);
PrintActivity(name, "^x04[Screenshot]^x01: ^x03$name disconnected!");
}
}
public show_ip(id)
{
console_print(id, "Last Stored IP: %s!",ip);
}
PrintActivity(const admin_name[], const message_fmt[], any:...)
{
if( !get_playersnum() ) return;
static message[192], temp[192];
vformat(message, sizeof(message) - 1, message_fmt, 3);
for( new client = 1; client <= get_maxplayers(); client++ )
{
if( !is_user_connected(client) ) continue;
copy(temp, sizeof(temp) - 1, message);
replace(temp, sizeof(temp) - 1, "$name", admin_name);
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, client);
write_byte(client);
write_string(temp);
message_end();
}
log_amx("Screenshot: ^"%s^" disconnected after screenshot %d!", name, increment);
}