Raised This Month: $ Target: $400
 0% 

Plugin compilation errors 'n' stuff


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MrDerpZ
Junior Member
Join Date: Aug 2013
Old 09-15-2013 , 09:16   Plugin compilation errors 'n' stuff
Reply With Quote #1

-----------------------------

Last edited by MrDerpZ; 05-17-2023 at 15:33. Reason: Privacy
MrDerpZ is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 09-15-2013 , 09:29   Re: Plugin compilation errors 'n' stuff
Reply With Quote #2

Fixed version:
PHP Code:
#include <sourcemod>

public Plugin:myinfo = {
    
name        "Premium Particles",
    
author        "Party Cow",
    
description "Makes 'premium' users able to get special particle effects",
    
version        "0",
    
url            "http://www.pcquad.de"
}

public 
OnPluginStart()
{
    
CreateTimer(0.1TimerSpawnParticles_,TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE)
}

public 
Action:TimerSpawnParticles(Handle:timer)
{
    for (new 
0<= MaxClients+1i++)
    {
        if (
IsClientInGame(i) && IsPlayerAlive(i))
        {
            
decl String:theUserId[256];
            
GetClientAuthString(itheUserIdsizeof(theUserId))
            if (
StrEqual(theUserId"STEAM_0:0:46526974"))
            {
                
CreateParticle("cowmangler_impact_charged_child_electro"1.0iNO_ATTACH)
            }
        }
    }

You should study more Sourcemod Scripting
__________________
...

Last edited by Oshizu; 09-15-2013 at 09:33.
Oshizu is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 09-15-2013 , 09:38   Re: Plugin compilation errors 'n' stuff
Reply With Quote #3

Something like this:
PHP Code:
#include <sourcemod>

new String:Premiums[] = {"STEAM_0:0:46526974"}

public 
Plugin:myinfo = {
    
name        "Premium Particles",
    
author        "Party Cow",
    
description "Makes 'premium' users able to get special particle effects",
    
version        "0",
    
url            "http://www.pcquad.de"
}

public 
OnPluginStart()
{
    
CreateTimer(0.1Timer:TimerSpawnParticles_,TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE)
}

public 
Action:TimerSpawnParticles(Handle:timer)
{
    for (new 
0<= MaxClients+1i++)
    {
        if (
IsClientInGame(i) && IsPlayerAlive(i))
        {
            
decl String:theUserId[256];
            
GetClientAuthString(itheUserIdsizeof(theUserId))
            if(
StrEqual(theUserIdPremiums))
            {
                
CreateParticle("cowmangler_impact_charged_child_electro"1.0iNO_ATTACH)
            }
        }
    }

Might be not working thought
__________________
...

Last edited by Oshizu; 09-15-2013 at 09:43.
Oshizu is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 09-15-2013 , 09:50   Re: Plugin compilation errors 'n' stuff
Reply With Quote #4

Quote:
Originally Posted by MrDerpZ View Post
Only error it makes is CreateParticle is a undefined symbol.
Also, the premium string is not in a function, so will that work?
Premium string is defined at very start of the plugin
So you will be able to do whatever you with it below.

I'm not sure wherhe you got CreateParticle() stuff
I assume it was from [TF2] Self-Made Trail
So put this into code:
PHP Code:
stock Handle:CreateParticle(String:type[], Float:timeentityattach=NO_ATTACHFloat:xOffs=0.0Float:yOffs=0.0Float:zOffs=0.0)
{
    
particle CreateEntityByName("info_particle_system");
    
    if (
IsValidEdict(particle))
    {
        
decl Float:pos[3];
        
GetEntPropVector(entityProp_Send"m_vecOrigin"pos);
        
pos[0] += xOffs;
        
pos[1] += yOffs;
        
pos[2] += zOffs;
        
TeleportEntity(particleposNULL_VECTORNULL_VECTOR);
        
DispatchKeyValue(particle"effect_name"type);

        if (
attach != NO_ATTACH)
        {
            
SetVariantString("!activator");
            
AcceptEntityInput(particle"SetParent"entityparticle0);
        
            if (
attach == ATTACH_HEAD)
            {
                
SetVariantString("head");
                
AcceptEntityInput(particle"SetParentAttachmentMaintainOffset"particleparticle0);
            }
        }
        
DispatchKeyValue(particle"targetname""present");
        
DispatchSpawn(particle);
        
ActivateEntity(particle);
        
AcceptEntityInput(particle"Start");
    }
    else
    {
        
LogError("(CreateParticle): Could not create info_particle_system");
    }
    
    return 
INVALID_HANDLE;

__________________
...

Last edited by Oshizu; 09-15-2013 at 09:51.
Oshizu is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 09-15-2013 , 10:03   Re: Plugin compilation errors 'n' stuff
Reply With Quote #5

I assume you took this snippet and forgot to put it together.
So here are things you lack
PHP Code:
#include <sdktools> 
Including SDKTOOLS Libary
Defines for attachments for client
PHP Code:
#define NO_ATTACH 0
#define ATTACH_NORMAL 1
#define ATTACH_HEAD 2 
Also this tiny busta used to call particle entity:
PHP Code:
new particle
Resulting in probatly working code:
PHP Code:
#include <sourcemod>
#include <sdktools>

#define NO_ATTACH 0
#define ATTACH_NORMAL 1
#define ATTACH_HEAD 2

new particle;
new 
String:Premiums[] = {"STEAM_0:0:46526974"}

public 
Plugin:myinfo = {
    
name        "Premium Particles",
    
author        "Party Cow",
    
description "Makes 'premium' users able to get special particle effects",
    
version        "0",
    
url            "http://www.pcquad.de"
}

public 
OnPluginStart()
{
    
CreateTimer(0.1Timer:TimerSpawnParticles_,TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE)
}

public 
Action:TimerSpawnParticles(Handle:timer)
{
    for (new 
0<= MaxClients+1i++)
    {
        if (
IsClientInGame(i) && IsPlayerAlive(i))
        {
            
decl String:theUserId[256];
            
GetClientAuthString(itheUserIdsizeof(theUserId))
            if(
StrEqual(theUserIdPremiums))
            {
                
CreateParticle("cowmangler_impact_charged_child_electro"1.0iNO_ATTACH)
            }
        }
    }
}

stock Handle:CreateParticle(String:type[], Float:timeentityattach=NO_ATTACHFloat:xOffs=0.0Float:yOffs=0.0Float:zOffs=0.0)
{
    
particle CreateEntityByName("info_particle_system");
    
    if (
IsValidEdict(particle))
    {
        
decl Float:pos[3];
        
GetEntPropVector(entityProp_Send"m_vecOrigin"pos);
        
pos[0] += xOffs;
        
pos[1] += yOffs;
        
pos[2] += zOffs;
        
TeleportEntity(particleposNULL_VECTORNULL_VECTOR);
        
DispatchKeyValue(particle"effect_name"type);

        if (
attach != NO_ATTACH)
        {
            
SetVariantString("!activator");
            
AcceptEntityInput(particle"SetParent"entityparticle0);
        
            if (
attach == ATTACH_HEAD)
            {
                
SetVariantString("head");
                
AcceptEntityInput(particle"SetParentAttachmentMaintainOffset"particleparticle0);
            }
        }
        
DispatchKeyValue(particle"targetname""present");
        
DispatchSpawn(particle);
        
ActivateEntity(particle);
        
AcceptEntityInput(particle"Start");
    }
    else
    {
        
LogError("(CreateParticle): Could not create info_particle_system");
    }
    
    return 
INVALID_HANDLE;

__________________
...

Last edited by Oshizu; 09-15-2013 at 10:04.
Oshizu is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 09-15-2013 , 10:06   Re: Plugin compilation errors 'n' stuff
Reply With Quote #6

hey, why not use SM admin system... ?
admins.cfg

admin_groups.cfg


CheckCommandAccess
PHP Code:
public OnPluginStart()
{
    
CreateTimer(0.1Timer:TimerSpawnParticles_,TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
}

new 
bool:g_bIsOkay[MAXPLAYERS+1];

public 
OnClientPostAdminCheck(client)
{
    
g_bIsOkay[client] = CheckCommandAccess(client"Premium Particles"ADMFLAG_CUSTOM1);
}

public 
Action:TimerSpawnParticles(Handle:timer)
{
    for (new 
1<= MaxClientsi++)
    {
        if (
g_bIsOkay[i] && IsClientInGame(i) && IsPlayerAlive(i))
        {
            
// Do here your things
            //CreateParticle("cowmangler_impact_charged_child_electro", 1.0, i, NO_ATTACH)
        
}
    }

__________________
Do not Private Message @me

Last edited by Bacardi; 09-15-2013 at 10:09. Reason: client -> i
Bacardi is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 09-15-2013 , 10:16   Re: Plugin compilation errors 'n' stuff
Reply With Quote #7

Quote:
Originally Posted by MrDerpZ View Post
It doesn't go on admins etc.
It needs to go on who is listed no matter what...
The purpose of stuff that Bacardi posted is diffrent than you think
He's using admins & admin groups configs to make specific grou pof steamids restricted stuff features
__________________
...

Last edited by Oshizu; 09-15-2013 at 10:17.
Oshizu 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 02:52.


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