Author |
Message |
Guest
Offline
|
Posted: Fri Feb 10, 2006 3:12 pm Post subject: help with my plugin |
 |
|
|
|
this is an MERVbot plugin i wanted to write but i dont have any clue HOW!
well here are some file from a plugin i wanted to create
the meaning of it:
Gives a certain amount of creds for the won jp to the players of the winning team.
Amount of creds given is determend with: jackpot:50
i wrote it in command.cpp with // declaration where i tryed to write it.
errors i get:
E:\MERVBOT\TUTORIAL\backup\command.cpp(143) : error C2065: 'event' : undeclared identifier
E:\MERVBOT\TUTORIAL\backup\command.cpp(143) : error C2228: left of '.p' must have class/struct/union type
E:\MERVBOT\TUTORIAL\backup\command.cpp(144) : error C2228: left of '.p' must have class/struct/union type
E:\MERVBOT\TUTORIAL\backup\command.cpp(145) : error C2143: syntax error : missing ';' before ':'
E:\MERVBOT\TUTORIAL\backup\command.cpp(145) : error C2143: syntax error : missing ';' before ':'
Error executing cl.exe.
speaks for itself...
spawn.h - 2.41 KB
File downloaded or viewed 14 time(s)
speaks for itself...
spawn.cpp - 11.07 KB
File downloaded or viewed 13 time(s)
here i wrote everything in.
command.cpp - 4.65 KB
File downloaded or viewed 21 time(s)
|
|
Back to top |
|
 |
Witchie NL Seasoned Helper
Age:35 Gender: Joined: Jul 24 2005 Posts: 112 Location: Veere, Zeeland, Netherlands Offline
|
Posted: Fri Feb 10, 2006 3:13 pm Post subject: ohh oops |
 |
|
|
|
oh forgot to login deleted my cookies
that was me who posted it..
|
|
Back to top |
|
 |
Purge Episode I > Eposide III Jar-Jar is kool

Age:35 Gender: Joined: Sep 08 2004 Posts: 2019 Offline
|
Posted: Fri Feb 10, 2006 4:02 pm Post subject: |
 |
|
|
|
Uhh, that's not supposed to be in command.cpp. Add code into your spawn.cpp under EVENT_FlagVictory, not in a random place in command.cpp.
Also, your declaration of "credreward" is wrong because you're not really assigning a number to it (what is reward : 50?). To cgive those creds to the entire team that won, you'll have to cycle through the playerlist and check for the team that won (using the declaration of "team"), then give the amount of creds needed as your "credreward" declaration.
You should also use sendRemotePrivate(p, "msg"); instead of the sendPublic way that you've used.
|
|
Back to top |
|
 |
Witchie NL Seasoned Helper
Age:35 Gender: Joined: Jul 24 2005 Posts: 112 Location: Veere, Zeeland, Netherlands Offline
|
Posted: Fri Feb 10, 2006 4:34 pm Post subject: Lol |
 |
|
|
|
well bout that in spawn.cpp i already thought that but i dont get the rest you told me im dutch not verry good in such english words. well i realy think i can go further with this...
|
|
Back to top |
|
 |
Solo Ace Yeah, I'm in touch with reality...we correspond from time to time.

Age:37 Gender: Joined: Feb 06 2004 Posts: 2583 Location: The Netherlands Offline
|
Posted: Fri Feb 10, 2006 5:36 pm Post subject: |
 |
|
|
|
Let me tell this guy something he will actually understand.
Witchie NL wrote: | im dutch not verry good in such english words. |
Blijkbaar, wat voor onderwijs volg je, speciaal onderwijs ofzo? Wat een kutexcuus om laksheid te kunnen rechtvaardigen.
Je hebt duidelijk geen enkel idee waar je mee bezig bent en de aangeboden hulp begrijp je ook niet, waarom denk je dat je hiermee door kunt gaan?
Leer werken met een simpele plugin en lees daarna de code. Stap door de code met je debugger, zoek uit wat de code precies doet.
Uiteindelijk, na een behoorlijk lange tijd, wat jou betreft, zul je het gaan snappen en ben je er klaar voor om een plugin te schrijven. In dit stadium ben je beter af met iemand die wel kundig genoeg is op dit gebied.
|
|
Back to top |
|
 |
Witchie NL Seasoned Helper
Age:35 Gender: Joined: Jul 24 2005 Posts: 112 Location: Veere, Zeeland, Netherlands Offline
|
Posted: Sat Feb 11, 2006 3:13 am Post subject: ... |
 |
|
|
|
dit is ook precies hoe ik het aan het doen was, en nee ik zit op de middelbare 4e klas maar me engels is kut... (sta er een 4 voor) maar het is al gefixd en nee ik weet soms idd niet precies waar ik me bezig ben ...
|
|
Back to top |
|
 |
Solo Ace Yeah, I'm in touch with reality...we correspond from time to time.

Age:37 Gender: Joined: Feb 06 2004 Posts: 2583 Location: The Netherlands Offline
|
Posted: Sat Feb 11, 2006 6:25 am Post subject: |
 |
|
|
|
Ik zat je maar wat te stangen, maar toch.
Ik zal je eerst even wat basisprincipes uitleggen, laten we daarna eens kijken wat je gedaan hebt.
Een variabele, is een soort van "doosje", om het simpel uit te leggen. In een doosje kun je iets bewaren, bijvoorbeeld de doosje met de naam "nummer".
Wat je erin kunt bewaren ligt aan het type en de grootte van het doosje. Als je in de variabele nummer een nummer wilt kunnen opslaan zul je er een type aan toe moeten kennen. Voor nummers gebruikt men "int".
Als je een declaratie doet (een variabele aanmaakt) zet je het datatype ervoor en sluit af met een ';'.
Dit zou er zo uitzien:
Hierin kun je nu je nummer opslaan. Als je tijdens de declaratie al een nummer toe wilt kennen aan de variabele, dan kun je dat gewoon doen op deze manier:
dit is hetzelfde als dit:
Een variabele moet bestaan voordat je er iets mee kunt gaan doen, en een variabele bestaat niet overal in het programma. Het bereik van een variabele noemen we "scope".
Een voorbeeld:
void functie()
{
int nummer = 2;
if (nummer < 3)
{
char letter; // <-- Dit is een letter variabele ("character"). Deze bestaat alleen tussen de { } van dit if-statement.
printf("Het nummer is lager dan 3!\n");
}
// Hier bestaat onze variabele genaamd 'letter' niet meer, daarentegen bestaat de variabele 'nummer' wel.
} |
In de code voor de plugin die je probeert te maken maak jij gebruik van variabelen die helemaal niet bestaan op die plaats.
Het zal ook niet de bedoeling zijn om die variabelen op die plaats te gebruiken, zoals Purge+ al zei: "Uhh, het is niet de bedoeling dat je dat in command.cpp plaats. Voeg de code toe onder EVENT_FlagVictory, niet een willekeurige plaats in command.cpp.", dat zul je inderdaad op die andere plaats moeten doen.
Ik wil je best proberen te helpen (als je dat zou willen), mits je geduldig genoeg bent. In je profiel op deze forums staat een hotmail adres, wil je dat ik het toevoeg?
|
|
Back to top |
|
 |
Witchie NL Seasoned Helper
Age:35 Gender: Joined: Jul 24 2005 Posts: 112 Location: Veere, Zeeland, Netherlands Offline
|
Posted: Sat Feb 11, 2006 8:03 am Post subject: oke |
 |
|
|
|
tuurlijk voeg maar toe en geduld heb ik zeker wel maar purge+ had die plugin gemaakt (veel van geleerd btw) maar voer tog maar toe want kan alteid handig zijn
|
|
Back to top |
|
 |
Witchie NL Seasoned Helper
Age:35 Gender: Joined: Jul 24 2005 Posts: 112 Location: Veere, Zeeland, Netherlands Offline
|
|
Back to top |
|
 |
D1st0rt Miss Directed Wannabe

Age:37 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Sun Feb 12, 2006 3:49 pm Post subject: |
 |
|
|
|
First of all, there is no double-to-string conversion in MERVBot. You don't need to use a double anyway, just say (reward / 50), and it'll end up as an integer.
But the major problem is that EVENT_Tick doesn't have any parameters associated with it. You can't just do this:
int team = *(int*)&event.p[0];
int reward = *(int*)&event.p[1]; |
and expect them to magically appear. You're going to have to store the current jp somewhere or look it up when you need to display it.
And now for an optimization: there's no need to set conditions for 60, 120, 180, etc. Just use if (countdown[1] % 60 == 0). The modulus operator (%), in case you don't know, gives the remainder from a division operation. Thus, if a number divides evenly, it will return zero.
And finally, MERVBot is outdated and obsolete. Use ASSS. _________________ This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him.
|
|
Back to top |
|
 |
freakmonger Novice
Joined: Jan 07 2005 Posts: 45 Location: Arlington, VA Offline
|
Posted: Sun Feb 12, 2006 4:20 pm Post subject: |
 |
|
|
|
More zones use Bots than ASSS so its not 'obsolete'. And he doesnt have the option of using ASSS anyways.
|
|
Back to top |
|
 |
D1st0rt Miss Directed Wannabe

Age:37 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: Sun Feb 12, 2006 8:19 pm Post subject: |
 |
|
|
|
Obsolescence from Wikipedia:
When a new, more functional product or technology supersedes the old
|
|
Back to top |
|
 |
Dr Brain Flip-flopping like a wind surfer

Age:39 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Sun Feb 12, 2006 11:21 pm Post subject: |
 |
|
|
|
ASSS is an option to everyone but Trench Wars. If you don't program for Trench Wars, it's an option. _________________ Hyperspace Owner
Smong> so long as 99% deaths feel lame it will always be hyperspace to me
|
|
Back to top |
|
 |
Witchie NL Seasoned Helper
Age:35 Gender: Joined: Jul 24 2005 Posts: 112 Location: Veere, Zeeland, Netherlands Offline
|
Posted: Mon Feb 13, 2006 11:16 am Post subject: |
 |
|
|
|
i dont go use ASSS coz this plugin is for desert storm (explains the !cgive part)
|
|
Back to top |
|
 |
freakmonger Novice
Joined: Jan 07 2005 Posts: 45 Location: Arlington, VA Offline
|
Posted: Mon Feb 13, 2006 11:22 am Post subject: |
 |
|
|
|
Witchie NL wrote: | i dont go use ASSS coz this plugin is for desert storm (explains the !cgive part) |
Like I said, ASSS is not an opition for him. He's not the sysop/owner of that zone and the owner isnt going to use ASSS hence my first statement.......
Obsolete from dictionary.com
No longer in use
last I checked zones still use bots...
|
|
Back to top |
|
 |
D1st0rt Miss Directed Wannabe

Age:37 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: Mon Feb 13, 2006 3:10 pm Post subject: |
 |
|
|
|
You would be correct if the context of the word called for the first definition. Unfortunately it does not, try the second definition:
"Outmoded in design, style, or construction"
The first definition is not always right in context
|
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Mon Feb 13, 2006 9:48 pm Post subject: |
 |
|
|
|
Convince your boss to switch to asss.
|
|
Back to top |
|
 |
Witchie NL Seasoned Helper
Age:35 Gender: Joined: Jul 24 2005 Posts: 112 Location: Veere, Zeeland, Netherlands Offline
|
Posted: Tue Feb 14, 2006 8:43 am Post subject: hehe |
 |
|
|
|
wow if you can get that happen your my big idol and freakmonger knows what i mean with that...
|
|
Back to top |
|
 |
freakmonger Novice
Joined: Jan 07 2005 Posts: 45 Location: Arlington, VA Offline
|
Posted: Tue Feb 14, 2006 4:50 pm Post subject: |
 |
|
|
|
lol yea witchie, switch to ASSS....good luck with that
|
|
Back to top |
|
 |
|