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

Getting some odd errors...


Post New Thread Reply   
 
Thread Tools Display Modes
xXDeathreusXx
Veteran Member
Join Date: Mar 2013
Location: pPlayer->GetOrigin();
Old 04-11-2014 , 18:58   Re: Getting some odd errors...
Reply With Quote #11

Quote:
Originally Posted by 11530 View Post
First section: Change the && to ||. Some odd indentation too.

Second section: Wouldn't recommend setting pitch to 100. Leave it at whatever it already was otherwise you may get conflicts.

Third section: Hopefully this isn't being run every time a sound is emitted.
1. What odd indentation? It's 1 space per word, and is tabbed in to indent, notepad++ keeps previus indentations

2. It was set to something else earlier, it was a randomint between 95 and 100

3. It is
__________________
Plugins|Profile
Requests closed

I'm a smartass by nature, get used to it
xXDeathreusXx is online now
xXDeathreusXx
Veteran Member
Join Date: Mar 2013
Location: pPlayer->GetOrigin();
Old 04-11-2014 , 18:59   Re: Getting some odd errors...
Reply With Quote #12

Quote:
Originally Posted by Bacardi View Post
Just quick look and fix...

Code:
if (!GetConVarBool(cvarSounds)) return Plugin_Continue;

if (!IsValidClient(Ent)) return Plugin_Continue;

if (StrContains(sound, "vo/announcer_", false) != -1)
    return Plugin_Continue;
    /*if (StrContains(sound, "weapons/", false) != -1) 
CPrintToChatAll("{red}Played: %s %d %f %d %d %d", sound, channel, volume, level, pitch, flags);*/

new client = Ent;
new TFClassType:class = TF2_GetPlayerClass(client);
I hadn't touched that, that's how it was in the original plugin. Will probably make it an or statement
__________________
Plugins|Profile
Requests closed

I'm a smartass by nature, get used to it
xXDeathreusXx is online now
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 04-11-2014 , 20:36   Re: Getting some odd errors...
Reply With Quote #13

Quote:
Originally Posted by xXDeathreusXx View Post
1. What odd indentation? It's 1 space per word, and is tabbed in to indent, notepad++ keeps previus indentations

2. It was set to something else earlier, it was a randomint between 95 and 100

3. It is
1. Your second if-statement there starts in one tab, though isn't nested. Remember if-statements without brackets only apply to the next line.

PHP Code:
if (!GetConVarBool(cvarSounds) && !IsValidClient(Ent)) 
        return 
Plugin_Continue;
    if (
StrContains(sound"vo/announcer_"false) != -1)
        return 
Plugin_Continue;
    
/*if (StrContains(sound, "weapons/", false) != -1) 
        CPrintToChatAll("{red}Played: %s %d %f %d %d %d", sound, channel, volume, level, pitch, flags);*/

    
new client Ent;
    new 
TFClassType:class = TF2_GetPlayerClass(client); 
Should be this. As Bacardi also shows.
PHP Code:
if (!GetConVarBool(cvarSounds) || !IsValidClient(Ent))
        return 
Plugin_Continue;
if (
StrContains(sound"vo/announcer_"false) != -1)
        return 
Plugin_Continue;
/*if (StrContains(sound, "weapons/", false) != -1) 
        CPrintToChatAll("{red}Played: %s %d %f %d %d %d", sound, channel, volume, level, pitch, flags);*/

new client Ent;
new 
TFClassType:class = TF2_GetPlayerClass(client); 
2. Randomints setting the pitch would still conflict with certain plugins *pokes sig*

3. Checking the sounds exist earlier may be better than checking it every time it plays. Same for the convar.
__________________
11530 is offline
xXDeathreusXx
Veteran Member
Join Date: Mar 2013
Location: pPlayer->GetOrigin();
Old 04-11-2014 , 22:01   Re: Getting some odd errors...
Reply With Quote #14

Quote:
Originally Posted by 11530 View Post
1. Your second if-statement there starts in one tab, though isn't nested. Remember if-statements without brackets only apply to the next line.

PHP Code:
if (!GetConVarBool(cvarSounds) && !IsValidClient(Ent)) 
        return 
Plugin_Continue;
    if (
StrContains(sound"vo/announcer_"false) != -1)
        return 
Plugin_Continue;
    
/*if (StrContains(sound, "weapons/", false) != -1) 
        CPrintToChatAll("{red}Played: %s %d %f %d %d %d", sound, channel, volume, level, pitch, flags);*/

    
new client Ent;
    new 
TFClassType:class = TF2_GetPlayerClass(client); 
Should be this. As Bacardi also shows.
PHP Code:
if (!GetConVarBool(cvarSounds) || !IsValidClient(Ent))
        return 
Plugin_Continue;
if (
StrContains(sound"vo/announcer_"false) != -1)
        return 
Plugin_Continue;
/*if (StrContains(sound, "weapons/", false) != -1) 
        CPrintToChatAll("{red}Played: %s %d %f %d %d %d", sound, channel, volume, level, pitch, flags);*/

new client Ent;
new 
TFClassType:class = TF2_GetPlayerClass(client); 
2. Randomints setting the pitch would still conflict with certain plugins *pokes sig*

3. Checking the sounds exist earlier may be better than checking it every time it plays. Same for the convar.
2 and 3. Like I said, this is how the plugin was when I got it

As for 1, still not seeing it, and I have changed the and statement to an or
__________________
Plugins|Profile
Requests closed

I'm a smartass by nature, get used to it
xXDeathreusXx is online now
xXDeathreusXx
Veteran Member
Join Date: Mar 2013
Location: pPlayer->GetOrigin();
Old 04-11-2014 , 22:34   Re: Getting some odd errors...
Reply With Quote #15

After changing that one thing, it seems to have been fixed

All thats left is this:
Code:
[SM] Native "CreateNative" reported: Fatal error creating dynamic native!
L 04/11/2014 - 22:29:06: [SM] Displaying call stack trace for plugin "betherobot.smx":
L 04/11/2014 - 22:29:06: [SM]   [0]  Line 56, betherobot.sp::AskPluginLoad2()
And this is the APL code
Code:
public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max)
{
    CreateNative("BeTheRobot_GetRobotStatus", Native_GetRobotStatus);
    CreateNative("BeTheRobot_SetRobot", Native_SetRobot);
    CreateNative("BeTheRobot_CheckRules", Native_CheckRules);
    RegPluginLibrary("betherobot");
    return APLRes_Success;
}
And the natives:
Code:
public Native_GetRobotStatus(Handle:plugin, args)
    return _:Status[GetNativeCell(1)];

public Native_SetRobot(Handle:plugin, args)
    ToggleRobot(GetNativeCell(1), bool:GetNativeCell(2));

public Native_CheckRules(Handle:plugin, args)
    return CheckTheRules(GetNativeCell(1));
__________________
Plugins|Profile
Requests closed

I'm a smartass by nature, get used to it
xXDeathreusXx is online now
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-12-2014 , 02:47   Re: Getting some odd errors...
Reply With Quote #16

Quote:
Originally Posted by xXDeathreusXx View Post
I hadn't touched that, that's how it was in the original plugin. Will probably make it an or statement
look again
[TF2] Be the Robot (1.3, December 22 2012)

it have updated, fixed those errors etc. etc.
Bacardi is offline
xXDeathreusXx
Veteran Member
Join Date: Mar 2013
Location: pPlayer->GetOrigin();
Old 04-12-2014 , 11:51   Re: Getting some odd errors...
Reply With Quote #17

Quote:
Originally Posted by Bacardi View Post
look again
[TF2] Be the Robot (1.3, December 22 2012)

it have updated, fixed those errors etc. etc.
Useing that

Unless he made an update and is hidden somewhere in the threads replies?
__________________
Plugins|Profile
Requests closed

I'm a smartass by nature, get used to it

Last edited by xXDeathreusXx; 04-12-2014 at 11:56.
xXDeathreusXx is online now
xXDeathreusXx
Veteran Member
Join Date: Mar 2013
Location: pPlayer->GetOrigin();
Old 04-13-2014 , 01:42   Re: Getting some odd errors...
Reply With Quote #18

Oh, the native thing, I'm fairly certain it's to do with the same native being added in Bethegiant, GetRobotStatus, but I need this native in that, is there a way around this?
__________________
Plugins|Profile
Requests closed

I'm a smartass by nature, get used to it
xXDeathreusXx is online now
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-13-2014 , 03:32   Re: Getting some odd errors...
Reply With Quote #19

Quote:
Originally Posted by xXDeathreusXx View Post
Oh, the native thing, I'm fairly certain it's to do with the same native being added in Bethegiant, GetRobotStatus, but I need this native in that, is there a way around this?
Problem is, that Bethegiant is copy of Betherobot with few change. And creates also sam natives.
It should not.

Post whole Bethegiant or link to it.

*edit
or you need run only Bethegiant plugin, not Betherobot

Last edited by Bacardi; 04-13-2014 at 03:34.
Bacardi 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 22:21.


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