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

Help end this plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DaN1kyM
Junior Member
Join Date: Apr 2012
Location: Russia =)
Old 05-06-2012 , 09:25   Help end this plugin
Reply With Quote #1

Here is my small plugin but I did not finish as the team can keep_save only works for admins I make so that it is reset and all living clients? before their transfer to the Spector =) Big thanks for help !

PHP Code:
public Action:Event_finale_win(Handle:event, const String:name[], bool:dontBroadcast)    
{  
    for (new 
1<= MaxClientsi++){  
        if (
IsClientInGame(i) && IsPlayerAlive(i))  
        {  
            
FakeClientCommand(i"say !keep_save");  
            
ChangeClientTeam(i1); 
        }    
    }    

P.S sorry my ENG bad =(
DaN1kyM is offline
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 05-06-2012 , 09:57   Re: Help end this plugin
Reply With Quote #2

use CheckAccess or CheckCommandAccess
__________________
Leonardo is offline
DaN1kyM
Junior Member
Join Date: Apr 2012
Location: Russia =)
Old 05-06-2012 , 10:34   Re: Help end this plugin
Reply With Quote #3

Please show me an example of using these functions, I am weak in the scripting =(
DaN1kyM is offline
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 05-06-2012 , 10:57   Re: Help end this plugin
Reply With Quote #4

http://forums.alliedmods.net/showpos...84&postcount=5
PHP Code:
if( CheckCommandAccessclient"keep_save"ADMFLAG_GENERIC ) )
{

string ("keep_save") can be used here for overriding admin flags

"do I have enough rights to run this command?"
__________________

Last edited by Leonardo; 05-06-2012 at 10:57.
Leonardo is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 05-06-2012 , 11:19   Re: Help end this plugin
Reply With Quote #5

Shouldn't it be
PHP Code:
if( CheckCommandAccessclient"sm_keep_save"ADMFLAG_GENERIC ) )
{

?
Dr. Greg House is offline
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 05-06-2012 , 11:35   Re: Help end this plugin
Reply With Quote #6

it can be any word.
__________________
Leonardo is offline
DaN1kyM
Junior Member
Join Date: Apr 2012
Location: Russia =)
Old 05-06-2012 , 11:40   Re: Help end this plugin
Reply With Quote #7

PHP Code:
#include <sourcemod>
#include <sdktools>

#define PLUGIN_VERSION "0.0"

public Plugin:myinfo 
{
    
name "",
    
author "DaN1k",
    
description "",
    
version PLUGIN_VERSION,
    
url ""
}

public 
OnPluginStart() 
{
    
HookEvent("finale_win"Event_finale_win)
    
RegConsoleCmd("sm_saveweapon"keep_save);
}

public 
Action:keep_save(clientargs)
{
    
ClientCommand(client,"keep_save");return Plugin_Handled;
}

public 
Action:Event_finale_win(Handle:event, const String:name[], bool:dontBroadcast)     
{   
    for (new 
1<= MaxClientsi++){   
        if (
IsClientInGame(i) && IsPlayerAlive(i)) && ( CheckCommandAccessclient"sm_saveweapon"ADMFLAG_GENERIC ) )
        {   
            
ChangeClientTeam(i1);  
        }     
    }

Where did I go wrong? = (
DaN1kyM is offline
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 05-06-2012 , 11:43   Re: Help end this plugin
Reply With Quote #8

Quote:
Originally Posted by DaN1kyM View Post
PHP Code:
if (IsClientInGame(i) && IsPlayerAlive(i)) && ( CheckCommandAccessclient"sm_saveweapon"ADMFLAG_GENERIC ) ) 
PHP Code:
if( IsClientInGame(i) && IsPlayerAlive(i) && CheckCommandAccessi"sm_saveweapon"ADMFLAG_GENERIC ) ) 
__________________
Leonardo is offline
DaN1kyM
Junior Member
Join Date: Apr 2012
Location: Russia =)
Old 05-06-2012 , 11:49   Re: Help end this plugin
Reply With Quote #9

Quote:
#include <sourcemod>
#include <sdktools>

#define PLUGIN_VERSION "0.0"

public Plugin:myinfo =
{
name = "",
author = "DaN1k",
description = "",
version = PLUGIN_VERSION,
url = ""
}

public OnPluginStart()
{
HookEvent("finale_win", Event_finale_win)
RegConsoleCmd("sm_saveweapon", keep_save);
}

public Action:keep_save(client, args)
{
ClientCommand(client,"keep_save");return Plugin_Handled;
}

public Action:Event_finale_win(Handle:event, const String:name[], bool:dontBroadcast)
{
for (new i = 1; i <= MaxClients; i++){
if (IsClientInGame(i) && IsPlayerAlive(i)) && ( CheckCommandAccess( i, "sm_saveweapon", ADMFLAG_GENERIC ) )
{
ChangeClientTeam(i, 1);
}
}
}
SourcePawn Compiler 1.4.0
Copyright (c) 1997-2006, ITB CompuPhase, (C)2004-2008 AlliedModders, LLC

/home/groups/sourcemod/upload_tmp/phpjVFFhF.sp(29) : error 029: invalid expression, assumed zero
/home/groups/sourcemod/upload_tmp/phpjVFFhF.sp(29 -- 30) : error 028: invalid subscript (not an array or too many subscripts): "CheckCommandAccess"
/home/groups/sourcemod/upload_tmp/phpjVFFhF.sp(31) : warning 217: loose indentation
/home/groups/sourcemod/upload_tmp/phpjVFFhF.sp(34) : error 054: unmatched closing brace ("}")

3 Errors.

Thats say's me compiler...

Last edited by DaN1kyM; 05-06-2012 at 11:50.
DaN1kyM is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 05-06-2012 , 12:46   Re: Help end this plugin
Reply With Quote #10

LoL - you still have
if (IsClientInGame(i) && IsPlayerAlive(i)) && ( CheckCommandAccess( i, "sm_saveweapon", ADMFLAG_GENERIC ) )

should be
if (IsClientInGame(i) && IsPlayerAlive(i) && CheckCommandAccess( i, "sm_saveweapon", ADMFLAG_GENERIC ) )

notice the one less ) after IsPlayerAlive(i) and one less ( before CheckCommandAccess

and you can drop the Action part since it's a normal hook:
public Action:Event_finale_win(Handle:event, const String:name[], bool:dontBroadcast)
to
public Event_finale_win(Handle:event, const String:name[], bool:dontBroadcast)

This compiles, but plugin doesn't make sense
__________________
View my Plugins | Donate

Last edited by TnTSCS; 05-06-2012 at 12:53.
TnTSCS is offline
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 19:03.


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