Raised This Month: $51 Target: $400
 12% 

Surf Spawn Protection


Post New Thread Reply   
 
Thread Tools Display Modes
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-12-2014 , 10:46   Re: Surf Spawn Protection
Reply With Quote #11

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( ! containmap"surf_" ) ) 
                
pause "a"

Last edited by HamletEagle; 06-12-2014 at 10:47.
HamletEagle is offline
xDoctor
Member
Join Date: Jul 2013
Old 06-12-2014 , 10:58   Re: Surf Spawn Protection
Reply With Quote #12

Quote:
Originally Posted by HamletEagle View Post
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( ! containmap"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 
pCvariCvars ];

new 
szTimer;

public 
plugin_init()
{
    
register_plugin"Spawn Protection ""1.0""Xdoctor" );
    
    
RegisterHamHam_Respawn"player""HamClientSpawn" );
    
    
pCvarszPrefix ] =         register_cvar"spawn_prefix""Spawn Protection" );

    
pCvarprotectTime ] =        register_cvar"spawn_time""10" );
    
    new 
map32 ];
    
    
get_mapnamemap31 );
    
    if( !
containmap"surf_" ) )
        
pause "a" )
        
}

public 
HamClientSpawnclient )
{
    
szTimer get_pcvar_numpCvarprotectTime ] );
    
    
set_user_godmodeclient);
    
    
ColorChatclient"Spawn^4 Protection^1 has started for^4 %i Seconds^3 !"szTimer );
    
    
set_task1.0"CmdTask"client TASK_ID_,_"b" );
    
    return 
1;
}

public 
CmdTaskclient )
{
    if( 
szTimer <= )
    {

        
set_user_godmodeclient);
        
        
ColorChatclient"Spawn^4 Protection^1 time in now over^3 !" );
        
        
remove_taskclient TASK_ID );
    }
    
    
set_hudmessage0852550.280.3306.01.0 )
    
    
show_hudmessageclient"You'r spawn protection will be expeird : %i Seconds !"szTimer );
    
    
szTimer -= 1;
    
}

stock ColorChat(const id, const string[], {FloatSqlResul,_}:...)
{
    new 
msg[191], players[32], count 1
    
static len
    len 
formatex(msgcharsmax(msg), "^1[ ^4%s ^1] "get_pcvar_numpCvarszPrefix ] ) )
    
vformat(msg[len], charsmax(msg) - lenstring3)
    if(
id)    players[0] = id
    
else    get_players(players,count,"ch")
    
    for (new 
0counti++)
    {
        if(
is_user_connected(players[i]))
        {
            
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"),_players[i])
            
write_byte(players[i])
            
write_string(msg)
            
message_end()
        }
    }
    
    return 
1;


Last edited by xDoctor; 06-12-2014 at 10:58.
xDoctor is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-12-2014 , 11:17   Re: Surf Spawn Protection
Reply With Quote #13

Please attach the source file here, you have no reason to link it to another site. Edit -> Go advanced -> manage attachemets -> add file ( or choose file ) - > select your sma file -> upload -> save. You are done, the forum will automatically compile the source for you. If you don't do this your topic may be trashed.
HamletEagle is offline
xDoctor
Member
Join Date: Jul 2013
Old 06-12-2014 , 14:56   Re: Surf Spawn Protection
Reply With Quote #14

Download added.

Plugin has been fixed..


there was allot of bugs.

enjoy from the plugin guys !!
xDoctor is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-12-2014 , 18:20   Re: Surf Spawn Protection
Reply With Quote #15

This is redundant, there are already plugins which offer such functionalities.
Also, you don't know really what you're doing. Take your time to learn pawn.

Unapproved.
__________________
Arkshine is offline
Old 09-09-2014, 15:57
Strick3n
This message has been deleted by YamiKaitou. Reason: spam/rude
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:28.


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