Raised This Month: $ Target: $400
 0% 

Solved [CSGO]How i can write plugin which will turn of and on plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Danielej1
Senior Member
Join Date: Jul 2022
Location: Poland
Old 01-28-2023 , 13:47   [CSGO]How i can write plugin which will turn of and on plugin
Reply With Quote #1

How can I make the sm_thunder command display an example of this plugin being disabled/enabled in chat?
Attached Files
File Type: sp Get Plugin or Get Source (lightingpower.sp - 195 views - 4.4 KB)

Last edited by Danielej1; 02-01-2023 at 11:26.
Danielej1 is offline
Alex Taylor
Junior Member
Join Date: Jan 2023
Location: Hungary
Old 01-28-2023 , 14:19   Re: [CSGO]How i can write plugin which will turn of and on plugin
Reply With Quote #2

I don't know what you want to do with this plugin, maybe you could give me a more understandable description.

And for the second time, you are working with old syntax. Which is not exactly the best
Alex Taylor is offline
Danielej1
Senior Member
Join Date: Jul 2022
Location: Poland
Old 01-28-2023 , 14:27   Re: [CSGO]How i can write plugin which will turn of and on plugin
Reply With Quote #3

Quote:
Originally Posted by Alex Taylor View Post
I don't know what you want to do with this plugin, maybe you could give me a more understandable description.

And for the second time, you are working with old syntax. Which is not exactly the best
simply if I type the sm_thunder command to pop up the information on the chat was turned on or off
Danielej1 is offline
Alex Taylor
Junior Member
Join Date: Jan 2023
Location: Hungary
Old 01-28-2023 , 14:37   Re: [CSGO]How i can write plugin which will turn of and on plugin
Reply With Quote #4

Quote:
Originally Posted by Danielej1 View Post
simply if I type the sm_thunder command to pop up the information on the chat was turned on or off

Exactly, if you want sm_thunder to turn off HookEvents on command, or to write to you in chat, then command.

EDIT: Unfortunately, the plugin returns with a warning, so enter this at the top like this: #pragma tabsize 0
Attached Files
File Type: sp Get Plugin or Get Source (lightingpowerEDITED.sp - 154 views - 4.8 KB)

Last edited by Alex Taylor; 01-28-2023 at 14:40.
Alex Taylor is offline
Danielej1
Senior Member
Join Date: Jul 2022
Location: Poland
Old 01-28-2023 , 14:45   Re: [CSGO]How i can write plugin which will turn of and on plugin
Reply With Quote #5

Quote:
Originally Posted by Alex Taylor View Post
Exactly, if you want sm_thunder to turn off HookEvents on command, or to write to you in chat, then command.

EDIT: Unfortunately, the plugin returns with a warning, so enter this at the top like this: #pragma tabsize 0
i cant compile :

Code:
//// lightingpowerEDITED.sp
//
// C:\Users\danie\OneDrive\Pulpit\Nowy folder\lightingpowerEDITED.sp(43) : error 001: expected token: ",", but found "{"
// C:\Users\danie\OneDrive\Pulpit\Nowy folder\lightingpowerEDITED.sp(43) : error 001: expected token: ";", but found "}"
// C:\Users\danie\OneDrive\Pulpit\Nowy folder\lightingpowerEDITED.sp(43) : error 001: expected token: ";", but found "{"
//
// 3 Errors.
//
// Compilation Time: 0,3 sec
// ----------------------------------------
Danielej1 is offline
Alex Taylor
Junior Member
Join Date: Jan 2023
Location: Hungary
Old 01-28-2023 , 14:50   Re: [CSGO]How i can write plugin which will turn of and on plugin
Reply With Quote #6

Quote:
Originally Posted by Danielej1 View Post
i cant compile :

Code:
//// lightingpowerEDITED.sp
//
// C:\Users\danie\OneDrive\Pulpit\Nowy folder\lightingpowerEDITED.sp(43) : error 001: expected token: ",", but found "{"
// C:\Users\danie\OneDrive\Pulpit\Nowy folder\lightingpowerEDITED.sp(43) : error 001: expected token: ";", but found "}"
// C:\Users\danie\OneDrive\Pulpit\Nowy folder\lightingpowerEDITED.sp(43) : error 001: expected token: ";", but found "{"
//
// 3 Errors.
//
// Compilation Time: 0,3 sec
// ----------------------------------------
Your Complier is bad.
Click To "Get Plugin" (not "Get Source") or Go to this website, and copmlie here https://spider.limetech.io/
__________________
if ( me.IsAlive() )
{
me.Coding();
}
[HUN] Taylor'sense Server Group Owner
Discord Community>| https://discord.com/invite/njumUg3 |
Discord Name>| Alex Taylor#1988 |

Last edited by Alex Taylor; 01-28-2023 at 14:52.
Alex Taylor is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 02-01-2023 , 06:59   Re: [CSGO]How i can write plugin which will turn of and on plugin
Reply With Quote #7

I would do something like this:
PHP Code:
#pragma semicolon 1
#pragma newdecls required

#include <sdktools_engine>
#include <sdktools_entinput>
#include <sdktools_functions>

bool
    bShow
[MAXPLAYERS+1];
int
    iTesla 
= -1,
    
iFade = -1;

public 
void OnPluginStart()
{
    
RegAdminCmd("sm_thunder"Cmd_ThunderADMFLAG_SLAY);

    
HookEvent("player_death"Event_Death);
    
HookEvent("round_freeze_end"Event_StartEventHookMode_PostNoCopy);
}

public 
void OnMapStart()
{
    
iTesla iFade = -1;
    
PrecacheGeneric("sprites/physbeam.vmt");
}

public 
void OnClientDisconnect(int client)
{
    
bShow[client] = false;
}

public 
Action Cmd_Thunder(int clientint args)
{
    
bShow[client] ^= true;
    
PrintToChat(client"Thunder shot is %abled"bShow[client] ? "en" "dis");
    return 
Plugin_Handled;
}

public 
void Event_Start(Event event, const char[] namebool dontBroadcast)
{
    
int entity;
    if((
iTesla == -|| EntRefToEntIndex(iTesla) == -1) && (entity CreateEntityByName("point_tesla")) != -1)
    {
        
DispatchKeyValue(entity"beamcount_max""8");
        
DispatchKeyValue(entity"beamcount_min""6");
        
DispatchKeyValue(entity"interval_max""2");
        
DispatchKeyValue(entity"interval_min""0.5");
        
DispatchKeyValue(entity"lifetime_max""0.3");
        
DispatchKeyValue(entity"lifetime_min""0.3");
        
DispatchKeyValue(entity"m_Color""255 255 255");
        
DispatchKeyValue(entity"m_flRadius""200");
        
DispatchKeyValue(entity"m_SoundName""DoSpark");
        
DispatchKeyValue(entity"texture""sprites/physbeam.vmt");
        
DispatchKeyValue(entity"thick_max""5");
        
DispatchKeyValue(entity"thick_min""4");

        if(
DispatchSpawn(entity)) iTesla EntIndexToEntRef(entity);
    }

    if((
iFade == -|| EntRefToEntIndex(iFade) == -1) && (entity CreateEntityByName("env_fade")) != -1)
    {
        
DispatchKeyValue(entity"duration""0");
        
DispatchKeyValue(entity"renderamt""255");
        
DispatchKeyValue(entity"rendercolor""29 211 222");
        
DispatchKeyValue(entity"ReverseFadeDuration""0");
        
DispatchKeyValue(entity"spawnflags""0");

        if(
DispatchSpawn(entity)) iFade  EntIndexToEntRef(entity);
    }
}

public 
void Event_Death(Event event, const char[] namebool dontBroadcast)
{
    if(!
event.GetBool("headshot"))
        return;

    
int attacker GetClientOfUserId(event.GetInt("attacker"));
    if(!
attacker || !IsClientInGame(attacker) || !bShow[attacker])
        return;

    
int victim GetClientOfUserId(event.GetInt("userid"));
    if(!
victim || !IsClientInGame(victim))
        return;

    
AcceptEntityInput(iFade"Fade"attacker);

    static 
float pos[3];
    
GetClientEyePosition(victimpos);
    
TeleportEntity(iTeslaposNULL_VECTORNULL_VECTOR);
    
AcceptEntityInput(iTesla"DoSpark");

__________________
Grey83 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 03:23.


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