10.06.2012, 01:32
Hello guys i was implementing Torran's Flight System into my server in of my faction LSAIR. I got the script compiling without any errors but when i type /flight /takeoff /land no dialog or message is poping up also when i do "=something" is not showing the Pilot Radio thingy. I don't know what is the error can you please help me ? this is my code.
pawn Код:
#define ID_FLIGHT1 2598
#define ID_FLIGHT2 2599
new FlightDepart[MAX_PLAYERS];
new FlightArrive[MAX_PLAYERS];
public OnPlayerText(playerid, text[]){
if(PlayerInfo[playerid][pLeader] == 15 && PlayerInfo[playerid][pRank] == 2 && PlayerInfo[playerid][pRank] == 3 && PlayerInfo[playerid][pRank] == 4)
{
if(text[0] == '=') {
new string[128];
format(string, sizeof string, "Pilot Radio: (%s): %s", PlayersName(playerid), text[1]);
SendClientMessageToAll(COLOR_GREY, string);
return 0;
}
}
}
//LSAIR CMDS
CMD:takeoff(playerid, params[]) {
if (PlayerInfo[playerid][pMember] == 15 && PlayerInfo[playerid][pRank] == 2 && PlayerInfo[playerid][pRank] == 3 && PlayerInfo[playerid][pRank] == 6){
new vehicleid = GetPlayerVehicleID(playerid); new string[128];
if(!IsAircraft(vehicleid)) return SendClientMessage(playerid, COLOR_RED, "You need to be in a plane to use this command");
if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "Usage: /takeoff [ls/lv/sf]");
if(strcmp(params, "ls", true) == 0) {
format(string, sizeof string, "%s is taking off from LS Airport", PlayersName(playerid));
SendClientMessageToAll(COLOR_WHITE, string);
format(string, sizeof string, "~w~%s is taking off from~n~LS Airport", PlayersName(playerid));
GameTextForAll(string, 1000, 1);
return 1;
}
if(strcmp(params, "lv", true) == 0) {
format(string, sizeof string, "%s is taking off from LV Airport", PlayersName(playerid));
SendClientMessageToAll(COLOR_WHITE, string);
format(string, sizeof string, "~w~%s is taking off from~n~LV Airport", PlayersName(playerid));
GameTextForAll(string, 1000, 1);
return 1;
}
if(strcmp(params, "sf", true) == 0) {
format(string, sizeof string, "%s is taking off from SF Airport", PlayersName(playerid));
SendClientMessageToAll(COLOR_WHITE, string);
format(string, sizeof string, "~w~%s is taking off from~n~SF Airport", PlayersName(playerid));
GameTextForAll(string, 1000, 1);
return 1;
}
return SendClientMessage(playerid, COLOR_RED, "Invalid airport");
}
return 1;
}
CMD:land(playerid, params[]) {
if (PlayerInfo[playerid][pMember] == 15 && PlayerInfo[playerid][pRank] == 2 && PlayerInfo[playerid][pRank] == 3 && PlayerInfo[playerid][pRank] == 6){
new vehicleid = GetPlayerVehicleID(playerid); new string[128];
if(!IsAircraft(vehicleid)) return SendClientMessage(playerid, COLOR_RED, "You need to be in a plane to use this command");
if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "Usage: /land [ls/lv/sf]");
if(strcmp(params, "ls", true) == 0) {
format(string, sizeof string, "%s is landing at LS Airport", PlayersName(playerid));
SendClientMessageToAll(COLOR_WHITE, string);
format(string, sizeof string, "~w~%s is landing at~n~LS Airport", PlayersName(playerid));
GameTextForAll(string, 1000, 1);
return 1;
}
if(strcmp(params, "lv", true) == 0) {
format(string, sizeof string, "%s is landing at LV Airport", PlayersName(playerid));
SendClientMessageToAll(COLOR_WHITE, string);
format(string, sizeof string, "~w~%s is landing at~n~LV Airport", PlayersName(playerid));
GameTextForAll(string, 1000, 1);
return 1;
}
if(strcmp(params, "sf", true) == 0) {
format(string, sizeof string, "%s is landing at SF Airport", PlayersName(playerid));
SendClientMessageToAll(COLOR_WHITE, string);
format(string, sizeof string, "~w~%s is landing at~n~SF Airport", PlayersName(playerid));
GameTextForAll(string, 1000, 1);
return 1;
}
return SendClientMessage(playerid, COLOR_RED, "Invalid airport");
}
return 1;
}
CMD:flight(playerid, params[]) {
if (PlayerInfo[playerid][pMember] == 15 && PlayerInfo[playerid][pRank] == 2 && PlayerInfo[playerid][pRank] == 3 && PlayerInfo[playerid][pRank] == 6){
new vehicleid = GetPlayerVehicleID(playerid);
if(!IsAircraft(vehicleid)) return SendClientMessage(playerid, COLOR_RED, "You need to be in a plane to use this command");
ShowPlayerDialog(playerid, ID_FLIGHT1, DIALOG_STYLE_INPUT, "Departing from", "Please input the airport you're departing from", "Continue", "Cancel");
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == ID_FLIGHT1) {
if(response) {
ShowPlayerDialog(playerid, ID_FLIGHT1, DIALOG_STYLE_INPUT, "Departing from", "Please fill in the field \n\nPlease input the airport you're departing from", "Continue", "Cancel");
ShowPlayerDialog(playerid, ID_FLIGHT2, DIALOG_STYLE_INPUT, "Arriving at", "Please input the airport you're arriving at", "Done", "Cancel");
format(FlightDepart[playerid], sizeof(FlightDepart), "%s", inputtext);
}
}
if(dialogid == ID_FLIGHT2) {
if(response) {
new string[128];
ShowPlayerDialog(playerid, ID_FLIGHT2, DIALOG_STYLE_INPUT, "Arriving at", "~r~Please fill in the field ~w~\n\nPlease input the airport you're arriving at", "Done", "Cancel");
format(FlightArrive[playerid], sizeof(FlightArrive), "%s", inputtext);
format(string, sizeof string, "Flight by %s: Departing From: %s: Arriving At: %s:", PlayersName(playerid), FlightDepart[playerid], FlightArrive[playerid]);
SendClientMessageToAll(COLOR_WHITE, string);
}
}
}