AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   roundsound error (https://forums.alliedmods.net/showthread.php?t=321002)

MrGarfield 01-19-2020 13:27

roundsound error
 
good evening

I just toruver this plugin https://forums.alliedmods.net/showthread.php?p=1136844
and modify like this

Code:

#include <amxmodx>

public plugin_init()
{
    register_plugin(0, "1.0", "PaintLancer");
    register_event("SendAudio", "t_win", "a", "2&%!MRAD_terwin");
    register_event("SendAudio", "ct_win", "a", "2&%!MRAD_ctwin");
    return 0;
}

public t_win()
{
    new rand = random_num(0, 2);
    client_cmd(0, "stopsound");
    switch (rand)
    {
        case 0:
        {
            client_cmd(0, "spk LTBJail/T_Winnar_1");
        }
        case 1:
        {
            client_cmd(0, "spk LTBJail/T_Winnar_2");
        }
        case 2:
        {
            client_cmd(0, "spk LTBJail/T_Winnar_3");
        }
        default:
        {
        }
    }
    return 1;
}

public ct_win()
{
    new rand = random_num(0, 2);
    client_cmd(0, "stopsound");
    switch (rand)
    {
        case 0:
        {
            client_cmd(0, "spk LTBJail/CT_Winnar_1");
        }
        case 1:
        {
            client_cmd(0, "spk LTBJail/CT_Winnar_3");
        }
        case 2:
        {
            client_cmd(0, "spk LTBJail/CT_Winnar_4");
        }
        default:
        {
        }
    }
    return 1;
}

public plugin_precache()
{
    precache_sound("LTBJail/CT_Winnar_1.wav");
    precache_sound("LTBJail/CT_Winnar_3.wav");
    precache_sound("LTBJail/CT_Winnar_4.wav");
    precache_sound("LTBJail/T_Winnar_1.wav");
    precache_sound("LTBJail/T_Winnar_2.wav");
    precache_sound("LTBJail/T_Winnar_1.wav");
    return 0;
}

but it does not want compilet?

thank you

Napoleon_be 01-19-2020 13:31

Re: roundsound error
 
this
PHP Code:

register_plugin(0"1.0""PaintLancer"); 

Plugin name shouldn't be an integer, but a string.

MrGarfield 01-19-2020 16:42

Re: roundsound error
 
roundsound.sma(5) : error 035: argument type mismatch (argument 1)

1 Error.
Could not locate output file roundsound.amx (compile failed)

DOES NOT WORK

OciXCrom 01-19-2020 18:20

Re: roundsound error
 
You clearly didn't change anything. Use the requests section if you have no clue what's happening.

MrGarfield 01-20-2020 10:36

Re: roundsound error
 
I'm sorry we with a friend we don't know much about the plugin, I would like to know where to post for the modification?

Napoleon_be 01-20-2020 11:17

Re: roundsound error
 
Just change this line
register_plugin(0, "1.0", "PaintLancer")

To this
register_plugin("Sounds", "1.0", "PaintLancer")

Next time post in suggestions/requests

MrGarfield 01-20-2020 11:46

Re: roundsound error
 
great thanks a lot

thEsp 01-20-2020 13:57

Re: roundsound error
 
Quote:

Originally Posted by Napoleon_be (Post 2680913)
Plugin name shouldn't be an integer, but a string.

Fun (off-topic) fact: Pawn is a type-less scripting language and for this matter, a string is a character array, not a true string (as in C++) per see. So, integers and chars are virtually the same.
Code:
register_plugin(0, 0, 0); // error! register_plugin("...", "...", "..."); // success! register_plugin({0}, {0}, {0}); // success!
And yes, as Hamlet said chars are encoded as integers. "ABC" would translate to {65, 66, 67, 0} whereas 0 (ASCII - '\0') is EOS (end of string). This of course may consume less power or at least time, hence Pawn is lightweight.
https://ostermiller.org/calc/ascii.html

OciXCrom 01-20-2020 15:12

Re: roundsound error
 
Quote:

Originally Posted by MrGarfield (Post 2681001)
I'm sorry we with a friend we don't know much about the plugin, I would like to know where to post for the modification?

Quote:

Originally Posted by OciXCrom (Post 2680944)
You clearly didn't change anything. Use the requests section if you have no clue what's happening.


Napoleon_be 01-21-2020 07:07

Re: roundsound error
 
Quote:

Originally Posted by thEsp (Post 2681038)
Fun (off-topic) fact: Pawn is a type-less scripting language and for this matter, a string is a character array, not a true string (as in C++) per see. So, integers and chars are virtually the same.
Code:
register_plugin(0, 0, 0); // error! register_plugin("...", "...", "..."); // success! register_plugin({0}, {0}, {0}); // success!

I wasn't aware of that, thanks


All times are GMT -4. The time now is 02:58.

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