- Joined
- Apr 10, 2008
- Messages
- 4,093
- Reaction score
- 1,270
Spiceal Thanks to : C-Servers.
Intructions :
1). Make a new CPP file and call it ShipEvent.cpp or just replace the scrpt with your own ShipEvent.cpp
2). Paste the script below in 5.
3). Save, Open npcsscripts.h
4). Haev fun.
5). The script for ShipEvent.cpp
6. Open npcsscripts.h, And paste that :
7. Open your MySql / Navicat.
Download the Batch File below :
Excute that file,
Tick Continue Errors!!!
And have fun!!!
Working fine,
Any errors post here.
Intructions :
1). Make a new CPP file and call it ShipEvent.cpp or just replace the scrpt with your own ShipEvent.cpp
2). Paste the script below in 5.
3). Save, Open npcsscripts.h
4). Haev fun.
5). The script for ShipEvent.cpp
#include "NPCs.h"
#include "NPCsScripts.h"
#include "Levels.h"
#include "Player.h"
#include "MySQLM.h"
#include "shipevent.h"
#include "maps.h"
#include <vector>
void NPCsScripts::npc_1032008(NPC* npc){
Player* player = npc->getPlayer();
int state = npc->getState();
int playersmax = MySQL::getInt("shipevent",1,"aplayers");
int playersride = MySQL::getInt("shipevent",1,"aonride");
int playerswait = MySQL::getInt("shipevent",1,"awaiting");
if(player->getLevel() >= 10 && player->getLevel() <= 200){
if(state == 0){
if(playersmax == 0){
npc->addText("There are currently already 20 people on the ship. Please wait.");
npc->end();
}
}
else if(playersmax == 1){
npc->addText("There is currently 1 player in the Ship. Would you like to enter the Ship?");
npc->sendYesNo();
}
else if(playersmax == 2){
npc->addText("There are currently 2 players in the Ship. Would you like to enter the Ship?");
npc->sendYesNo();
}
else if(playersmax == 3){
npc->addText("There are currently 3 players in the Ship. Would you like to enter the Ship?");
npc->sendYesNo();
}
else if(playersmax == 4){
npc->addText("There are currently 4 players in the Ship. Would you like to enter the Ship?");
npc->sendSimple();
npc->end();
}
else if(playersmax == 5){
npc->addText("There are currently 5 players in the Ship. Would you like to enter the Ship?");
npc->sendSimple();
npc->end();
}
else if(playersmax == 6){
npc->addText("There are currently 6 players in the Ship. Would you like to enter the Ship?");
npc->sendSimple();
npc->end();
}
else if(playersmax == 7){
npc->addText("There are currently 7 players in the Ship. Would you like to enter the Ship?");
npc->sendSimple();
npc->end();
}
else if(playersmax == 8){
npc->addText("There are currently 8 players in the Ship. Would you like to enter the Ship?");
npc->sendSimple();
npc->end();
}
else if(playersmax == 9){
npc->addText("There are currently 9 players in the Ship. Would you like to enter the Ship?");
npc->sendSimple();
npc->end();
}
else if(playersmax == 10){
npc->addText("There are currently 10 players in the Ship. Would you like to enter the Ship?");
npc->sendSimple();
npc->end();
}
else if(playersmax == 11){
npc->addText("There are currently 11 players in the Ship. Would you like to enter the Ship?");
npc->sendSimple();
npc->end();
}
else if(playersmax == 12){
npc->addText("There are currently 12 players in the Ship. Would you like to enter the Ship?");
npc->sendSimple();
npc->end();
}
else if(playersmax == 13){
npc->addText("There are currently 13 players in the Ship. Would you like to enter the Ship?");
npc->sendSimple();
npc->end();
}
else if(playersmax == 14){
npc->addText("There are currently 14 players in the Ship. Would you like to enter the Ship?");
npc->sendSimple();
npc->end();
}
else if(playersmax == 15){
npc->addText("There are currently 15 players in the Ship. Would you like to enter the Ship?");
npc->sendSimple();
npc->end();
}
else if(playersmax == 16){
npc->addText("There are currently 16 players in the Ship. Would you like to enter the Ship?");
npc->sendSimple();
npc->end();
}
else if(playersmax == 17){
npc->addText("There are currently 17 players in the Ship. Would you like to enter the Ship?");
npc->sendSimple();
npc->end();
}
else if(playersmax == 18){
npc->addText("There are currently 18 players in the Ship. Would you like to enter the Ship?");
npc->sendSimple();
npc->end();
}
else if(playersmax == 19){
npc->addText("There are currently 19 players in the Ship. Would you like to enter the Ship?");
npc->sendSimple();
npc->end();
}
else if(playersmax == 20){
npc->addText("There are currently 20 players in the Ship. Would you like to enter the Ship?");
npc->sendSimple();
npc->end();
}
else if(playersmax == -1){
npc->addText("The Ship is currenlty disabled.");
npc->sendSimple();
npc->end();
}
}
else if(state == 1){
if(npc->getSelected() == YES){
MySQL::setInt("shipevent","playersmax",1,playersmax+1) ;
npc->teleport(101000301);
vector<Player*> players=Maps::info[101000301].Players;
for(unsigned int i=0;i<players.size();i++){
Maps::changeMap(players ,200090000, 0);
}
}
else if(npc->getSelected() == NO){
npc->addText("Oh, Then, I will see you later.");
npc->end();
}
else{
npc->addText("It seems that something is worng with the ship. Contact your admin.");
npc->sendSimple();
npc->end();
}
}
}
6. Open npcsscripts.h, And paste that :
case 1032008: npc_1032008(npc); break;
static void npc_1032008(NPC* npc);
7. Open your MySql / Navicat.
Download the Batch File below :
To view the content, you need to sign in or register
Excute that file,
Tick Continue Errors!!!
And have fun!!!
Working fine,
Any errors post here.
Last edited:

