Author Topic: brazilian mod  (Read 2330 times)

can someone make a mod where you can say /br (player) and everything they type becomes "br?" and "uma delicia" and sometimes "ooo oo ah ahh" thank you


$BrazilianLaws[0] = "br?";
$BrazilianLaws[1] = "uma delicia";
$BrazilianLaws[2] = "kool kids klubkool kids klubkk";
$BrazilianLaws[3] = "come to brazil";
$BrazilianLaws[4] = "ooo oo ah ahh";
$BrazilianLawCount = 5;

function serverCmdBrazil(%client, %n1, %n2, %n3, %n4, %n5, %n6) {
    if (!%client.isAdmin) return;
    %name = trim(%n1 SPC %n2 SPC %n3 SPC %n4 SPC %n5 SPC %n6);
    if (isObject(%target = findClientByName(%name))) {
        %target.isBrazilian = true;
    }
}
function serverCmdBR(%client, %n1, %n2, %n3, %n4, %n5, %n6) {
    serverCmdBrazil(%client, %n1, %n2, %n3, %n4, %n5, %n6);
}

package SopaDeMacaco {
    function serverCmdMessageSent(%client, %text) {
        if (%client.isBrazilian)
            %text = $BrazilianLaws[getRandom(0, $BrazilianLawCount-1)];
        Parent::serverCmdMessageSent(%client, %text);
    }
};
activatePackage(SopaDeMacaco);

kool kids klubkool kids klubkk
k lindo


$BrazilianLaws[0] = "br?";
$BrazilianLaws[1] = "uma delicia";
$BrazilianLaws[2] = "kool kids klubkool kids klubkk";
$BrazilianLaws[3] = "come to brazil";
$BrazilianLaws[4] = "ooo oo ah ahh";
$BrazilianLawCount = 5;

function serverCmdBrazil(%client, %n1, %n2, %n3, %n4, %n5, %n6) {
    if (!%client.isAdmin) return;
    %name = trim(%n1 SPC %n2 SPC %n3 SPC %n4 SPC %n5 SPC %n6);
    if (isObject(%target = findClientByName(%name))) {
        %target.isBrazilian = true;
    }
}
function serverCmdBR(%client, %n1, %n2, %n3, %n4, %n5, %n6) {
    serverCmdBrazil(%client, %n1, %n2, %n3, %n4, %n5, %n6);
}

package SopaDeMacaco {
    function serverCmdMessageSent(%client, %text) {
        if (%client.isBrazilian)
            %text = $BrazilianLaws[getRandom(0, $BrazilianLawCount-1)];
        Parent::serverCmdMessageSent(%client, %text);
    }
};
activatePackage(SopaDeMacaco);


What is the purpose of the %n1 - %n6 variables that you use? I'm assuming it's so you don't have to type out the player's entire name, but how does it work exactly?

What is the purpose of the %n1 - %n6 variables that you use? I'm assuming it's so you don't have to type out the player's entire name, but how does it work exactly?
lets you use multiple words to define someone's name

ex:
/brazil The Brighter Dark

lets you use multiple words to define someone's name

ex:
/brazil The Brighter Dark
Excellent, thank you

can someone make it into addon im stupid

All you've got to do is copy and paste the code into a server.cs.
Put that server.cs into a .zip. Include, in the .zip, an appropriate description.txt and namecheck.txt. You can look at the relevant files in default addons for an example on how it's done. I would name the .zip something like Server_BrazilianMod

According to some people on here, you don't actually need the namecheck.txt, but my stuff never runs without it, so include it anyway.

dont include namecheck. its only needed if your addon uses fixed file paths and thus needs the addon to be named a certain way. after putting it into a zip (along with a description.txt, can be empty) and putting it in addons, restart bl and it will show up

https://cdn.discordapp.com/attachments/332359375698264064/385492283182546944/Script_Brazil.zip


dont include namecheck. its only needed if your addon uses fixed file paths and thus needs the addon to be named a certain way. after putting it into a zip (along with a description.txt, can be empty) and putting it in addons, restart bl and it will show up
whoops

like its not a bad thing to include it, but its unnecessary, and if you rename the file it wont show up in the addons list unless you change the namecheck
« Last Edit: November 29, 2017, 01:52:56 PM by Conan »


just download all of filipes cars, there should be a hidden addon activated