Quote:
Originally Posted by HamletEagle
I didn't mean this. Use pause ( "a") if the map is not a surf map, nothing more. This will pause the plugin, it will be paused until a map has surf_ prefix.
PHP Code:
if( ! contain( map, "surf_" ) ) pause ( "a")
|
oh ok idid it like this :
thanks for the help.
PHP Code:
/* Plugin generated by AMXX-Studio */
#include < amxmodx >
#include < hamsandwich >
#include < fun >
#define TASK_ID 1923
enum _: iCvars
{
szPrefix,
protectTime
}
new pCvar[ iCvars ];
new szTimer;
public plugin_init()
{
register_plugin( "Spawn Protection ", "1.0", "Xdoctor" );
RegisterHam( Ham_Respawn, "player", "HamClientSpawn" );
pCvar[ szPrefix ] = register_cvar( "spawn_prefix", "Spawn Protection" );
pCvar[ protectTime ] = register_cvar( "spawn_time", "10" );
new map[ 32 ];
get_mapname( map, 31 );
if( !contain( map, "surf_" ) )
pause ( "a" )
}
public HamClientSpawn( client )
{
szTimer = get_pcvar_num( pCvar[ protectTime ] );
set_user_godmode( client, 1 );
ColorChat( client, "Spawn^4 Protection^1 has started for^4 %i Seconds^3 !", szTimer );
set_task( 1.0, "CmdTask", client + TASK_ID, _,_, "b" );
return 1;
}
public CmdTask( client )
{
if( szTimer <= 0 )
{
set_user_godmode( client, 0 );
ColorChat( client, "Spawn^4 Protection^1 time in now over^3 !" );
remove_task( client + TASK_ID );
}
set_hudmessage( 0, 85, 255, 0.28, 0.33, 0, 6.0, 1.0 )
show_hudmessage( client, "You'r spawn protection will be expeird : %i Seconds !", szTimer );
szTimer -= 1;
}
stock ColorChat(const id, const string[], {Float, Sql, Resul,_}:...)
{
new msg[191], players[32], count = 1
static len
len = formatex(msg, charsmax(msg), "^1[ ^4%s ^1] ", get_pcvar_num( pCvar[ szPrefix ] ) )
vformat(msg[len], charsmax(msg) - len, string, 3)
if(id) players[0] = id
else get_players(players,count,"ch")
for (new i = 0; i < count; i++)
{
if(is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"),_, players[i])
write_byte(players[i])
write_string(msg)
message_end()
}
}
return 1;
}