Era Developer
|
 |
Join Date: Mar 2005
Location: Pennsylvania
Posts: 1,589
|
|
Quote:
Originally Posted by KuJi
Hey.. who is ready to see the script of outbreak by hachi?
You are in NO position to EVER EVER talk about scripting.. and you must not know me because I just work 24/7 to not profit myself on guns to kill others k? And I already said I didn't make majority of it... Rapid did.
PHP Code:
function onActionServerside(mode) {
if (mode == "TurnZombie") {
if (params[1] != "default") {
}
}
}
What was the point of putting mode there? You should have just used params[0] or:
PHP Code:
function onActionServerSide(mode)
{
switch (mode)
{
case "TurnZombie";
{
// BLAH
break;
}
}
}
And theres tons more in there too =p.
Hey.. also whats timevar?
AND EVEN BETTER:
PHP Code:
//#CLIENTSIDE
function onCreated() {
if (player.ismale)
this.zombieheads = {{"head222.png", "cynober"}, {"head11.gif", "white"}, {"head257.png", "gray"}, {"head302.png", "gray"}};
else
this.zombieheads = {{"head306.gif", "cynober"}};
this.levelslist = {
"era_event-rooftopsred-1.nw",
"era_event-rooftops2.nw",
"era_event-rooftopsred-2.nw",
"era_event-rooftopsred-3.nw",
"era_event-rooftopsred-4.nw",
"era_event-rooftopsred-5.nw",
"era_event-rooftopsred-6.nw",
"era_event-rooftopsred-7.nw",
"era_event-rooftopsred-8.nw",
"era_event-rooftopsred-9.nw",
"era_event-rooftopsred-library.nw",
"era_event-rooftopsred-elevator.nw",
"era_event-rooftops3.nw",
"era_event-rooftops2a.nw",
"era_event-rooftops2b.nw",
"era_event-rooftopsblack-1.nw",
"era_event-rooftopsblack-2.nw",
"era_event-rooftopsblack-3.nw",
"era_event-rooftopsblack-4.nw",
"era_event-rooftopsblack-5.nw",
"era_event-rooftopsblack-6.nw",
"era_event-rooftopsblack-7.nw",
"era_event-rooftopsblack-8.nw",
"era_event-rooftopsblack-moffice.nw"
};
triggeraction(0, 0, "serverside", "*Outbreak", "startgame");
triggeraction(0, 0, "serverside", "*Outbreak", "transfer", this.levelslist);
onTimeout();
}
So you double-trigger to the server on the creation of the weapon (and you should use:
PHP Code:
triggerserver("gui", this.name, "startgame");
And on top of that why didn't you just do:
PHP Code:
if (player.level.starts("era_event-rooftops"))
{
}
Heres another good one:
PHP Code:
if (mode == "eliminate") {
player.addMessage("Eliminated by" SPC params[1] @ ".", "b", 0);
updateEliminates(params[1], player.account);
player.guild = "";
setlevel2("era_present_00-00.nw", 7.5, 46);
client.freeze = 0;
onActionServerside("remove");
}
Calling it's own function.. genious!
|
1.
I used "mode" to classify the "mode" the action is going through. Starting the game, ending the game, removing the weapon, etc...
Simple as that.
2.
I used a level list in an array since I was considering making that mansion that was in SR into part of the event. The level names in it had no specific order or similarity.
3.
Yeah, I called the "remove" function in its own triggeraction, considering I wanted to perform everything that happened in that particular block. Sure beats the hell out of random code stacking.
Btw, you spelled genius wrong. |
|