Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(strcmp(cmd, "/givecash", true) == 0 || strcmp(cmd, "/gc", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- new giveplayerid;
- new moneys;
- new giveplayer[MAX_PLAYER_NAME];
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /givecash (playerid/playername) (amount)");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /givecash (playerid/playername) (amount)");
- return 1;
- }
- moneys = strvalEx(tmp);
- if(moneys < 1 || moneys > 10000000)
- {
- SendClientMessage(playerid, COLOR_ERROR, "Cannot give cash under $1, or over $10,000,000 at a time.");
- return 1;
- }
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_ERROR, "You cant give money to yourself!"); return 1; }
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- new playermoney = PInfo[playerid][Money];
- if(moneys > 0 && playermoney >= moneys)
- {
- PInfo[playerid][Money] = PInfo[playerid][Money]-moneys;
- GivePlayerMoney(playerid, -moneys);
- PInfo[giveplayerid][Money] = PInfo[giveplayerid][Money]+moneys;
- GivePlayerMoney(giveplayerid, moneys);
- format(string, sizeof(string), "You have given $%d to %s(%d).",moneys,giveplayer,giveplayerid);
- SendClientMessage(playerid, COLOR_RANDOMMSG, string);
- format(string, sizeof(string), "You have received $%d from %s(%d).", moneys,sendername,playerid);
- SendClientMessage(giveplayerid, COLOR_RANDOMMSG, string);
- PayLog(PlayerName(playerid), moneys, "Paid Player", giveplayer, "N/A");
- PayLog(PlayerName(giveplayerid), moneys, "Received Money", giveplayer, PlayerName(playerid));
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "Invalid amount!");
- }
- }
- }
- else
- {
- format(string, sizeof(string), "Could not find player %d!", giveplayerid);
- SendClientMessage(playerid, COLOR_ERROR, string);
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/airlinespawn", true)==0)
- {
- if(PInfo[playerid][Airline] > 0 && PInfo[playerid][AirlineRank] == 6) // rank6
- {
- new AL = PInfo[playerid][Airline];
- GetPlayerPos(playerid, AInfo[AL][aPos1], AInfo[AL][aPos2], AInfo[AL][aPos3]);
- GetPlayerFacingAngle(playerid, AInfo[AL][aPos4]);
- DestroyDynamicMapIcon(AInfo[AL][aMapIcon]);
- AInfo[AL][aMapIcon] = CreateDynamicMapIcon(AInfo[AL][aPos1], AInfo[AL][aPos2], AInfo[AL][aPos3], 5, 0);
- new msg[128];
- format(msg,sizeof(msg),"* %s(%d) has updated the airlines spawn position.", PlayerName(playerid), playerid);
- SendAirlineMessage(COLOR_AIRLINECHAT, msg, AL);
- SaveAirline(AL);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not in an airline, or you are not a high enough rank!");
- return 1;
- }
- }
- if(strcmp(cmd, "/uniform", true)==0)
- {
- if(PInfo[playerid][Airline] > 0)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- SendClientMessage(playerid, COLOR_ERROR, "You must be on foot to change your uniform.");
- return 1;
- }
- if(NewSkin[playerid] == 0)
- {
- OldSkin[playerid] = GetPlayerSkin(playerid);
- NewSkin[playerid] = AInfo[PInfo[playerid][Airline]][aUniform];
- SetPlayerSkin(playerid, AInfo[PInfo[playerid][Airline]][aUniform]);
- new msg[128];
- format(msg,sizeof(msg),"You have changed your uniform. Type /uniform to change back.");
- PlayerNotice(playerid, msg);
- return 1;
- }
- else
- {
- NewSkin[playerid] = 0;
- SetPlayerSkin(playerid, OldSkin[playerid]);
- new msg[128];
- format(msg,sizeof(msg),"You have changed your uniform. Type /uniform to change back.");
- PlayerNotice(playerid, msg);
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not in an airline!");
- return 1;
- }
- }
- if(strcmp(cmd, "/leaveairline", true) == 0)
- {
- if(PInfo[playerid][Airline] > 0)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- SendClientMessage(playerid, COLOR_ERROR, "You must be on foot to leave an airline.");
- return 1;
- }
- new msg[150];
- format(msg,sizeof(msg),"* %s(%d) has left %s.", PlayerName(playerid), playerid, AInfo[PInfo[playerid][Airline]][aName]);
- SendAirlineMessage(COLOR_AIRLINECHAT, msg, PInfo[playerid][Airline]);
- PInfo[playerid][Airline] = 0;
- PInfo[playerid][AirlineRank] = 0;
- PInfo[playerid][EarntForAirline] = 0;
- PInfo[playerid][AirlineFlights] = 0;
- SaveAccount(playerid);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not in an airline!");
- return 1;
- }
- }
- if(strcmp(cmd, "/yes", true) == 0)
- {
- if(AirlineOffer[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_ERROR, "You have not been invited to any airline!");
- return 1;
- }
- else
- {
- PInfo[playerid][Airline] = AirlineOffer[playerid];
- PInfo[playerid][AirlineRank] = 1;
- format(string,sizeof(string),"* %s(%d) has joined %s!", PlayerName(playerid),playerid,AInfo[PInfo[playerid][Airline]][aName]);
- SendAirlineMessage(COLOR_AIRLINECHAT, string, PInfo[playerid][Airline]);
- AirlineOffer[playerid] = 0;
- PInfo[playerid][EarntForAirline] = 0;
- PInfo[playerid][AirlineFlights] = 0;
- SaveAccount(playerid);
- return 1;
- }
- }
- if(strcmp(cmd, "/no", true) == 0)
- {
- if(AirlineOffer[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_ERROR, "You have not been invited to any airline!");
- return 1;
- }
- else
- {
- format(string,sizeof(string),"You have declined the request to join %s.", AInfo[AirlineOffer[playerid]][aName]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- format(string,sizeof(string),"** %s(%d) has declined the request to join %s.", PlayerName(playerid),playerid,AInfo[AirlineOffer[playerid]][aName]);
- SendAirlineMessage(COLOR_AIRLINECHAT, string, AirlineOffer[playerid]);
- AirlineOffer[playerid] = 0;
- return 1;
- }
- }
- if(strcmp(cmd, "/crashplayer", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(!strcmp(PlayerName(playerid), "Pacoz"))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /crashplayer (playername/playerid)");
- return 1;
- }
- new giveplayerid;
- giveplayerid = ReturnUser(tmp);
- GameTextForPlayer(giveplayerid, "~k~~INVALID_KEY~", 100, 5);
- SendClientMessage(playerid, COLOR_MESSAGE, "You have crashed the player's client.");
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not Pacoz, therefore you cannot use this command.");
- return 1;
- }
- }
- }
- if(strcmp(cmd, "/killplayer", true) == 0)
- {
- if(PInfo[playerid][AdminLevel] < 5) { SendClientMessage(playerid, COLOR_ERROR, "You are not an administrator!"); return 1; }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /killplayer (playername/playerid)");
- return 1;
- }
- new giveplayerid;
- giveplayerid = ReturnUser(tmp);
- if(PInfo[giveplayerid][AdminLevel] > 0) { SendClientMessage(playerid, COLOR_ERROR, "Cannot kill administrators!"); return 1; }
- SetPlayerHealth(giveplayerid, 0);
- SetPlayerArmour(giveplayerid, 0);
- SendClientMessage(playerid, COLOR_WHITE, "You have killed the player.");
- return 1;
- }
- if(strcmp(cmd, "/invite", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /invite (playername/playerid)");
- return 1;
- }
- new giveplayerid;
- giveplayerid = ReturnUser(tmp);
- if(PInfo[playerid][Airline] == 0)
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not in an airline!");
- return 1;
- }
- if(PInfo[playerid][AirlineRank] >= AInfo[PInfo[playerid][Airline]][pInvMembers])
- {
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- if(PInfo[giveplayerid][Airline] == 0)
- {
- if(AirlineOffer[giveplayerid] > 0)
- {
- SendClientMessage(playerid, COLOR_ERROR, "This player already has an airline invitation pending!");
- return 1;
- }
- new aname[128], airline;
- airline = PInfo[playerid][Airline];
- format(aname,sizeof(aname),"%s",AInfo[PInfo[playerid][Airline]][aName]);
- format(string, sizeof(string), "* You have invited %s(%d) to join %s.", PlayerName(giveplayerid), giveplayerid, aname);
- SendClientMessage(playerid, COLOR_BLUE, string);
- format(string, sizeof(string), "* %s(%d) has invited you to join %s. Type /yes to join or /no to decline.", PlayerName(playerid),playerid,aname);
- SendClientMessage(giveplayerid, COLOR_BLUE, string);
- new stringz[128];
- format(stringz, sizeof(stringz),"* %s(%d) has invited %s(%d) to join %s.", PlayerName(playerid), playerid, PlayerName(giveplayerid), giveplayerid, aname);
- SendAirlineMessage(COLOR_AIRLINECHAT, stringz, airline);
- AirlineOffer[giveplayerid] = airline;
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "That player is already in an airline!");
- return 1;
- }
- }
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not a high enough rank to invite players to the airline!");
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/airlines", true) == 0 || strcmp(cmd, "/al", true) == 0)
- {
- ShowAirlines(playerid);
- return 1;
- }
- if(strcmp(cmd, "/stats", true) == 0)
- {
- LookingAtStats[playerid] = playerid;
- ShowPlayerDialog(playerid, 6, DIALOG_STYLE_LIST, "Select statistics to show ..", "{1B8AE4}Account Statistics\n{FFFFFF}General Statistics\n{1B8AE4}Vehicle Statistics", "Choose", "Cancel");
- return 1;
- }
- if(strcmp(cmd, "/cancel", true) == 0)
- {
- if(StartedMission[playerid] == 1)
- {
- if(PInfo[playerid][Tickets] > 0)
- {
- SessionFlights[playerid] = 0;
- ResetMissionData(playerid);
- format(string,sizeof(string),"You have used a ticket and cancelled your mission for free! [{1B8AE4}%d {FFFFFF}tickets remaining]",PInfo[playerid][Tickets]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- return 1;
- }
- SessionFlights[playerid] = 0;
- PInfo[playerid][Money]=PInfo[playerid][Money]-3500;
- GivePlayerMoney(playerid, -3500);
- SendClientMessage(playerid, COLOR_ERROR, "You have canceled your current mission for $3,500.");
- ResetMissionData(playerid);
- new amtearn[50];
- format(amtearn,sizeof(amtearn),"-$3500");
- GameTextCostumeForPlayer(playerid,amtearn,3,2,COLOR_ERROR); //style 2, 3 seconds, $1,250 (text)!
- PayLog(PlayerName(playerid), 3500, "Quit mission", "Server", "N/A");
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not currently working !");
- ResetMissionData(playerid);
- return 1;
- }
- }
- if(strcmp(cmd, "/deletevehicle", true) == 0)
- {
- if(PInfo[playerid][AdminLevel] > 4)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- if(VehicleDeletionWarning[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "You are about to permanently remove this vehicle from the database.");
- SendClientMessage(playerid, COLOR_YELLOW, "This action cannot be undone. If you wish to continue -> Retype the command.");
- VehicleDeletionWarning[playerid] = 1;
- return 1;
- }
- if(VehicleDeletionWarning[playerid] == 1)
- {
- new carid = GetPlayerVehicleID(playerid);
- if(VInfo[carid][ID] > 0 && gDestroyVehicle[carid] == 0)
- {
- new Query[400];
- format(Query, sizeof(Query), "DELETE FROM vehicles WHERE VehicleID = '%d'", VInfo[carid][ID]);
- mysql_reconnect();
- mysql_query(Query);
- format(Query,sizeof(Query), "Deleted vehicle permanently from database: %d", VInfo[carid][ID]);
- SendClientMessage(playerid, COLOR_YELLOW, Query);
- DestroyVehicle(carid);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "Unknown vehicle. Is this an admin spawned vehicle?");
- return 1;
- }
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not even in any vehicle !");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not an administrator !");
- return 1;
- }
- }
- if(strcmp(cmd, "/createhouse", true) == 0)
- {
- if(PInfo[playerid][AdminLevel] > 4)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /createhouse (price) (interior[1-10]) (slots)");
- return 1;
- }
- new price; //stock AddHouse(playerid, price, interior, slots)
- price = strvalEx(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /createhouse (price) (interior[1-10]) (slots)");
- return 1;
- }
- new interior;
- interior = strvalEx(tmp);
- if(interior < 0 || interior > 10) { SendClientMessage(playerid, COLOR_ERROR, "Interior ID's are 1-10."); return 1; }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /createhouse (price) (interior[1-10]) (slots)");
- return 1;
- }
- new slots;
- slots = strvalEx(tmp);
- if(slots > 50) { SendClientMessage(playerid, COLOR_ERROR, "Maximum slots for a house is 50."); return 1; }
- AddHouse(playerid, price, interior, slots);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "Developer's only!");
- return 1;
- }
- }
- if(strcmp(cmd, "/colourfleet", true) == 0)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /colourfleet [0-255] [0-255]");
- return 1;
- }
- new Col1;
- Col1 = strvalEx(tmp);
- if(Col1 < 0 || Col1 > 255) { SendClientMessage(playerid, COLOR_ERROR, "Colour ID cannot be over 255 or under 0."); return 1; }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /colourfleet [0-255] [0-255]");
- return 1;
- }
- new Col2;
- Col2 = strvalEx(tmp);
- if(Col2 < 0 || Col2 > 255) { SendClientMessage(playerid, COLOR_ERROR, "Colour ID cannot be over 255 or under 0."); return 1; }
- if(PInfo[playerid][Airline] > 0)
- {
- if(PInfo[playerid][AirlineRank] >= AInfo[PInfo[playerid][Airline]][pClrFleet])
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new carid = GetPlayerVehicleID(playerid);
- if(aVInfo[carid][ID] > 0 && gDestroyVehicle[carid] == 0)
- {
- if(aVInfo[carid][AID] == PInfo[playerid][Airline])
- {
- PlayerPlaySound(playerid,1134,0.0,0.0,0.0);
- new Query[400];
- format(Query,sizeof(Query), "UPDATE `avehicles` SET `VehicleColor1`='%d',`VehicleColor2`='%d' WHERE `VehicleID` = '%d'", Col1, Col2, aVInfo[carid][ID]);
- mysql_reconnect();
- mysql_query(Query);
- new msg[156];
- format(msg,sizeof(msg),"* %s(%d) has coloured the airlines %s to %d,%d!", PlayerName(playerid), playerid, GetVehicleFriendlyName(carid), Col1,Col2);
- SendAirlineMessage(COLOR_AIRLINECHAT, msg, PInfo[playerid][Airline]);
- ChangeVehicleColor(carid, Col1, Col2);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "This is not your airlines vehicle!");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "Unknown vehicle.");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not in any vehicle!");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not a high enough rank to colour fleet!");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not in an airline!");
- return 1;
- }
- }
- if(strcmp(cmd, "/colourvehicle", true) == 0)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /colourvehicle [0-250] [0-250]");
- return 1;
- }
- new Col1;
- Col1 = strvalEx(tmp);
- if(Col1 < 0 || Col1 > 255) { SendClientMessage(playerid, COLOR_ERROR, "Colour ID cannot be over 255 or under 0."); return 1; }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /colourvehicle [0-250] [0-250]");
- return 1;
- }
- new Col2;
- Col2 = strvalEx(tmp);
- if(Col2 < 0 || Col2 > 255) { SendClientMessage(playerid, COLOR_ERROR, "Colour ID cannot be over 255 or under 0."); return 1; }
- if(IsPlayerInAnyVehicle(playerid))
- {
- new carid = GetPlayerVehicleID(playerid);
- new isright = 0;
- for(new i = 0; i < sizeof(PVInfo); i++)
- {
- if(carid == PVInfo[i][vpVehicleSpawned])
- {
- if(!strcmp(PVInfo[i][vpOwnedBy], PlayerName(playerid)))
- {
- ChangeVehicleColor(carid, Col1, Col2);
- PVInfo[i][vpColor1] = Col1;
- PVInfo[i][vpColor2] = Col2;
- isright = 1;
- SendClientMessage(playerid, COLOR_WHITE, "You have coloured your vehicle!");
- SaveVehicle(i);
- return 1;
- }
- }
- }
- if(isright == 0) { SendClientMessage(playerid, COLOR_ERROR, "You do not own this vehicle!"); return 1; }
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not in any vehicle!");
- return 1;
- }
- }
- if(strcmp(cmd, "/parkvehicle", true) == 0)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new carid = GetPlayerVehicleID(playerid);
- new isright = 0;
- for(new i = 0; i < sizeof(PVInfo); i++)
- {
- if(carid == PVInfo[i][vpVehicleSpawned])
- {
- if(!strcmp(PVInfo[i][vpOwnedBy], PlayerName(playerid)))
- {
- isright = 1;
- new Float:CarX,Float:CarY,Float:CarZ,Float:CarA;
- GetVehiclePos(carid, CarX, CarY, CarZ);
- GetVehicleZAngle(carid, CarA);
- new query[2000];
- format(query,sizeof(query),"UPDATE `pvehicles` SET VehicleX='%f',VehicleY='%f',VehicleZ='%f',VehicleA='%f',mod1='%d',mod2='%d',mod3='%d',mod4='%d',mod5='%d',mod6='%d',mod7='%d',mod8='%d',mod9='%d',mod10='%d',mod11='%d',mod12='%d',mod13='%d',mod14='%d',mod15='%d',mod16='%d',mod17='%d' WHERE `VehicleID` = '%d'",
- CarX,
- CarY,
- CarZ,
- CarA,
- PVInfo[carid][mod1],
- PVInfo[carid][mod2],
- PVInfo[carid][mod3],
- PVInfo[carid][mod4],
- PVInfo[carid][mod5],
- PVInfo[carid][mod6],
- PVInfo[carid][mod7],
- PVInfo[carid][mod8],
- PVInfo[carid][mod9],
- PVInfo[carid][mod10],
- PVInfo[carid][mod11],
- PVInfo[carid][mod12],
- PVInfo[carid][mod13],
- PVInfo[carid][mod14],
- PVInfo[carid][mod15],
- PVInfo[carid][mod16],
- PVInfo[carid][mod17],
- i);
- mysql_reconnect();
- mysql_query(query);
- SendClientMessage(playerid, COLOR_WHITE, "You have parked your vehicle. (Type /respawnmyvehicles if the vehicle is tuned)");
- ReloadVehicle(i);
- return 1;
- }
- }
- }
- if(isright == 0)
- {
- SendClientMessage(playerid, COLOR_ERROR, "You do not own this vehicle !");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not in any vehicle !");
- return 1;
- }
- }
- if(strcmp(cmd, "/hood", true) == 0)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new carid = GetPlayerVehicleID(playerid);
- new isright = 0;
- for(new i = 0; i < sizeof(PVInfo); i++)
- {
- if(carid == PVInfo[i][vpVehicleSpawned])
- {
- if(!strcmp(PVInfo[i][vpOwnedBy], PlayerName(playerid)))
- {
- isright = 1;
- new engine, lights, alarm, doors, bonnet, boot, objective;
- GetVehicleParamsEx(carid, engine, lights, alarm, doors, bonnet, boot, objective);
- if(bonnet == 1) //Open ?
- {
- SendClientMessage(playerid, COLOR_WHITE, "You closed the hood of your vehicle!");
- SetVehicleParamsEx(carid, engine, lights, alarm, doors, false, boot, objective);
- }
- else
- {
- SendClientMessage(playerid, COLOR_WHITE, "You opened the hood of your vehicle!");
- SetVehicleParamsEx(carid, engine, lights, alarm, doors, true, boot, objective);
- }
- return 1;
- }
- }
- }
- if(isright == 0)
- {
- SendClientMessage(playerid, COLOR_ERROR, "You do not own this vehicle !");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not in any vehicle !");
- return 1;
- }
- }
- if(strcmp(cmd, "/trunk", true) == 0)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new carid = GetPlayerVehicleID(playerid);
- new isright = 0;
- for(new i = 0; i < sizeof(PVInfo); i++)
- {
- if(carid == PVInfo[i][vpVehicleSpawned])
- {
- if(!strcmp(PVInfo[i][vpOwnedBy], PlayerName(playerid)))
- {
- isright = 1;
- new engine, lights, alarm, doors, bonnet, boot, objective;
- GetVehicleParamsEx(carid, engine, lights, alarm, doors, bonnet, boot, objective);
- if(boot == 1) //Open ?
- {
- SendClientMessage(playerid, COLOR_WHITE, "You closed the tunk of your vehicle!");
- SetVehicleParamsEx(carid, engine, lights, alarm, doors, bonnet, false, objective);
- }
- else
- {
- SendClientMessage(playerid, COLOR_WHITE, "You opened the trunk of your vehicle!");
- SetVehicleParamsEx(carid, engine, lights, alarm, doors, bonnet, true, objective);
- }
- return 1;
- }
- }
- }
- if(isright == 0)
- {
- SendClientMessage(playerid, COLOR_ERROR, "You do not own this vehicle !");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not in any vehicle !");
- return 1;
- }
- }
- if(strcmp(cmd, "/headlights", true) == 0)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new carid = GetPlayerVehicleID(playerid);
- new isright = 0;
- for(new i = 0; i < sizeof(PVInfo); i++)
- {
- if(carid == PVInfo[i][vpVehicleSpawned])
- {
- if(!strcmp(PVInfo[i][vpOwnedBy], PlayerName(playerid)))
- {
- isright = 1;
- new engine, lights, alarm, doors, bonnet, boot, objective;
- GetVehicleParamsEx(carid, engine, lights, alarm, doors, bonnet, boot, objective);
- if(lights == 1) //Open ?
- {
- SendClientMessage(playerid, COLOR_WHITE, "You have turned the vehicles headlights off!");
- SetVehicleParamsEx(carid, engine, false, alarm, doors, bonnet, boot, objective);
- }
- else
- {
- SendClientMessage(playerid, COLOR_WHITE, "You have turned the vehicles headlights on!");
- SetVehicleParamsEx(carid, engine, true, alarm, doors, bonnet, boot, objective);
- }
- return 1;
- }
- }
- }
- if(isright == 0)
- {
- SendClientMessage(playerid, COLOR_ERROR, "You do not own this vehicle !");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not in any vehicle !");
- return 1;
- }
- }
- if(strcmp(cmd, "/parkfleet", true) == 0)
- {
- if(PInfo[playerid][Airline] > 0)
- {
- if(PInfo[playerid][AirlineRank] >= AInfo[PInfo[playerid][Airline]][pPrkFleet])
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new carid = GetPlayerVehicleID(playerid);
- if(aVInfo[carid][ID] > 0 && gDestroyVehicle[carid] == 0)
- {
- if(aVInfo[carid][AID] == PInfo[playerid][Airline])
- {
- new Float:CarX,Float:CarY,Float:CarZ,Float:CarA,VID2;
- GetVehiclePos(carid, CarX, CarY, CarZ);
- GetVehicleZAngle(carid, CarA);
- new Query[400];
- format(Query,sizeof(Query), "UPDATE `avehicles` SET VehicleX='%f',VehicleY='%f',VehicleZ='%f',VehicleAngle='%f' WHERE `VehicleID` = '%d'", CarX, CarY, CarZ, CarA, aVInfo[carid][ID]);
- mysql_reconnect();
- mysql_query(Query);
- SendClientMessage(playerid, COLOR_YELLOW, "Airline fleet has been parked.");
- //aVInfo[carid][VID] = VID;
- VID2 = aVInfo[carid][ID];
- DestroyVehicle(carid);
- AddAirlineVehicle(VID2);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "This is not your airlines vehicle!");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "Unknown vehicle.");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not in any vehicle!");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not a high enough rank to park fleet!");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not in an airline!");
- return 1;
- }
- }
- if(strcmp(cmd, "/updatevehicle", true) == 0)
- {
- if(PInfo[playerid][AdminLevel] > 4)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new carid = GetPlayerVehicleID(playerid);
- if(VInfo[carid][ID] > 0 && gDestroyVehicle[carid] == 0)
- {
- new Float:CarX,Float:CarY,Float:CarZ,Float:CarA;
- GetVehiclePos(carid, CarX, CarY, CarZ);
- GetVehicleZAngle(carid, CarA);
- new Query[400];
- format(Query, sizeof(Query), "UPDATE vehicles SET VehicleX='%f',VehicleY='%f',VehicleZ='%f',VehicleAngle='%f' WHERE VehicleID = '%d'", CarX, CarY, CarZ, CarA, VInfo[carid][ID]);
- mysql_reconnect();
- mysql_query(Query);
- format(Query,sizeof(Query), "Updated Vehicle : %d | X:%f | Y:%f | Z:%f | A:%f", VInfo[carid][ID], CarX, CarY, CarZ, CarA);
- SendClientMessage(playerid, COLOR_YELLOW, Query);
- AdminLog(playerid, "/updatevehicle", "Updated Vehicle", "Vehicle");
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "Unknown vehicle. Is this an admin spawned vehicle?");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not even in any vehicle !");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not an administrator !");
- return 1;
- }
- }
- if(strcmp(cmd, "/myvehicle", true) == 0)
- {
- if(PInfo[playerid][AdminLevel] > 4)
- {
- new carid = GetPlayerVehicleID(playerid);
- new msg[128];
- format(msg,sizeof(msg),"DEBUG: Vehicle ID: %d", VInfo[carid][ID]);
- SendClientMessage(playerid, COLOR_YELLOW, msg);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not an administrator !");
- return 1;
- }
- }
- if(strcmp(cmd, "/work", true) == 0 || strcmp(cmd, "/w", true) == 0)
- {
- if(StartedMission[playerid] == 1)
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are already on a mission! (/cancel to quit the mission)");
- return 1;
- }
- if(IsTracingHouse[playerid] == 1)
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are currently locating a house. Please complete it first.");
- return 1;
- }
- if(IsLocatingVehicle[playerid] == 1)
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are currently locating a vehicle. Please complete it first.");
- return 1;
- }
- new vehid = GetPlayerVehicleID(playerid);
- if(GetPlayerVehicleSeat(playerid) != 0)
- {
- SendClientMessage(playerid, COLOR_ERROR, "You must be the main driver of a vehicle to start working!");
- return 1;
- }
- if(IsAirVehicle(vehid))
- {
- if(PInfo[playerid][TotalScore] == 0)
- {
- new msg[200];
- format(msg,sizeof(msg),"Hey! It looks like you have not completed a flight yet! This is just to help you out:");
- SendClientMessage(playerid, COLOR_GREEN, msg);
- format(msg,sizeof(msg),"-When you do missions (/work), it will ask you to fly to a destination. Fly there and land, and it will give another checkpoint.");
- SendClientMessage(playerid, COLOR_GREEN, msg);
- format(msg,sizeof(msg),"-When you complete the mission, you gain money, in which you can purchase vehicle's, houses or even your own airline!");
- SendClientMessage(playerid, COLOR_GREEN, msg);
- format(msg,sizeof(msg),"-All of that information is just to help you understand the main features of the PoT, but there is ALOT more to come! - Have fun!");
- SendClientMessage(playerid, COLOR_GREEN, msg);
- }
- new modelid = GetVehicleModel(vehid);
- if(modelid == 592) //andromada
- {
- TypeFlight[playerid] = 1;
- MissionVehicle[playerid] = vehid;
- StartMission(playerid);
- return 1;
- }
- else if(modelid == 577) // at-400
- {
- TypeFlight[playerid] = 2;
- MissionVehicle[playerid] = vehid;
- StartMission(playerid);
- return 1;
- }
- else if(modelid == 519) // shamal
- {
- TypeFlight[playerid] = 3;
- MissionVehicle[playerid] = vehid;
- StartMission(playerid);
- return 1;
- }
- else if(modelid == 593) // dodo
- {
- TypeFlight[playerid] = 4;
- MissionVehicle[playerid] = vehid;
- StartMission(playerid);
- return 1;
- }
- else if(modelid == 553) // nevada
- {
- TypeFlight[playerid] = 5;
- MissionVehicle[playerid] = vehid;
- StartMission(playerid);
- return 1;
- }
- else if(modelid == 487) // Maverick
- {
- TypeFlight[playerid] = 6;
- MissionVehicle[playerid] = vehid;
- StartMission(playerid);
- return 1;
- }
- else if(modelid == 488) // News Maverick
- {
- TypeFlight[playerid] = 7;
- MissionVehicle[playerid] = vehid;
- StartMission(playerid);
- return 1;
- }
- else if(modelid == 497) // Police Maverick
- {
- TypeFlight[playerid] = 8;
- MissionVehicle[playerid] = vehid;
- StartMission(playerid);
- return 1;
- }
- else if(modelid == 417) // Leviathan
- {
- TypeFlight[playerid] = 9;
- MissionVehicle[playerid] = vehid;
- StartMission(playerid);
- return 1;
- }
- else if(modelid == 447) // Seasparrow
- {
- TypeFlight[playerid] = 10;
- MissionVehicle[playerid] = vehid;
- StartMission(playerid);
- return 1;
- }
- else if(modelid == 469) // Sparrow
- {
- TypeFlight[playerid] = 11;
- MissionVehicle[playerid] = vehid;
- StartMission(playerid);
- return 1;
- }
- else if(modelid == 548) // Cargobob
- {
- TypeFlight[playerid] = 12;
- MissionVehicle[playerid] = vehid;
- StartMission(playerid);
- return 1;
- }
- else if(modelid == 563) //Raindance
- {
- TypeFlight[playerid] = 13;
- MissionVehicle[playerid] = vehid;
- StartMission(playerid);
- return 1;
- }
- else if(modelid == 425) //Hunter
- {
- TypeFlight[playerid] = 14;
- MissionVehicle[playerid] = vehid;
- StartMission(playerid);
- return 1;
- }
- else if(modelid == 460) //Skimmer
- {
- TypeFlight[playerid] = 15;
- MissionVehicle[playerid] = vehid;
- StartMission(playerid);
- return 1;
- }
- else if(modelid == 512) //Cropduster
- {
- TypeFlight[playerid] = 16;
- MissionVehicle[playerid] = vehid;
- StartMission(playerid);
- return 1;
- }
- else if(modelid == 511) //Beagle
- {
- TypeFlight[playerid] = 17;
- MissionVehicle[playerid] = vehid;
- StartMission(playerid);
- return 1;
- }
- else if(modelid == 515) //Roadtrain
- {
- TypeFlight[playerid] = 19;
- MissionVehicle[playerid] = vehid;
- StartMission(playerid);
- return 1;
- }
- else if(modelid == 520) //Hydra
- {
- TypeFlight[playerid] = 18;
- MissionVehicle[playerid] = vehid;
- StartMission(playerid);
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You must be in a vehicle to use this command !");
- return 1;
- }
- }
- if(strcmp(cmd, "/owarn", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /owarn (full name, case sensitive!) (reason)");
- return 1;
- }
- new length = strlen(cmdtext);
- while ((idx < length) && (cmdtext[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[128];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = cmdtext[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- if(!strlen(result))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /owarn (full name, case sensitive!) (reason)");
- return 1;
- }
- if (PInfo[playerid][AdminLevel] >= 2)
- {
- new OBanName[MAX_PLAYER_NAME];
- mysql_real_escape_string(tmp, OBanName);
- mysql_real_escape_string(result, result);
- new checkquery2[128];
- format(checkquery2, sizeof(checkquery2), "SELECT `username` FROM `users` WHERE `username` = '%s'", OBanName);
- mysql_reconnect();
- mysql_query(checkquery2);
- mysql_store_result();
- if(mysql_num_rows() > 0) //
- {
- mysql_free_result();
- new checkquery[128];
- new szUnload[10], warning1, warning2, warning3, twarnings=0;
- format(checkquery, sizeof(checkquery), "SELECT `warning1` FROM `users` WHERE `username` = '%s'", OBanName);
- mysql_query(checkquery);
- mysql_store_result();
- mysql_retrieve_row();
- mysql_get_field("warning1", szUnload);
- mysql_free_result();
- warning1 = strval(szUnload);
- new mutemsg[256];
- if(warning1 == 1) // he already is warned in 1st slot, add a warning for the 3-limit ban!
- {
- twarnings=twarnings+1;
- }
- else // warning slot empty - WARN HIM!
- {
- new query5[200];
- format(query5, sizeof(query5), "UPDATE users SET warning1='1',reason1='%s' WHERE username='%s'", result, OBanName);
- format(mutemsg, sizeof(mutemsg), "Administrator %s(%d) has offline-warned player %s. • [Reason: %s]", PlayerName(playerid),playerid,OBanName,result);
- ABroadCast(COLOR_ADMIN,mutemsg,1); //
- mysql_query(query5);
- AdminLog(playerid, "/owarn", result, OBanName);
- return 1;
- }
- //MYSQL
- format(checkquery, sizeof(checkquery), "SELECT `warning2` FROM `users` WHERE `username` = '%s'", OBanName);
- mysql_query(checkquery);
- mysql_store_result();
- mysql_retrieve_row();
- mysql_get_field("warning2", szUnload);
- mysql_free_result();
- warning2 = strval(szUnload);
- if(warning2 == 1) // he already is warned in 2nt slot, add a warning for the 3-limit ban!
- {
- twarnings=twarnings+1;
- }
- else // warning slot empty - WARN HIM!
- {
- new query5[200];
- format(query5, sizeof(query5), "UPDATE users SET warning2='1',reason2='%s' WHERE username='%s'", result, OBanName);
- format(mutemsg, sizeof(mutemsg), "Administrator %s(%d) has offline-warned player %s. • [Reason: %s]", PlayerName(playerid),playerid,OBanName,result);
- ABroadCast(COLOR_ADMIN,mutemsg,1); //
- mysql_query(query5);
- AdminLog(playerid, "/owarn", result, OBanName);
- return 1;
- }
- //MYSQL
- format(checkquery, sizeof(checkquery), "SELECT `warning3` FROM `users` WHERE `username` = '%s'", OBanName);
- mysql_query(checkquery);
- mysql_store_result();
- mysql_retrieve_row();
- mysql_get_field("warning3", szUnload);
- mysql_free_result();
- warning3 = strval(szUnload);
- if(warning3 == 1) // he already is warned in 3rd slot, add a warning for the 3-limit ban!
- {
- twarnings=twarnings+1;
- }
- else // warning slot empty - WARN HIM!
- {
- new query5[200];
- format(query5, sizeof(query5), "UPDATE users SET warning3='1',reason3='%s' WHERE username='%s'", result, OBanName);
- format(mutemsg, sizeof(mutemsg), "Administrator %s(%d) has offline-warned player %s. • [Reason: %s]", PlayerName(playerid),playerid,OBanName,result);
- ABroadCast(COLOR_ADMIN,mutemsg,1); //
- mysql_query(query5);
- AdminLog(playerid, "/owarn", result, OBanName);
- return 1;
- }
- if(twarnings == 3)
- {
- new date,month,year;
- getdate(date,month,year);
- new hour,minute,second;
- gettime(hour,minute,second);
- new query9[200], warnmsg[128];
- format(query9,sizeof(query9), "UPDATE users SET warning1='0',reason1='None',warning2='0',reason2='None',warning3='0',reason3='None',banned='1' WHERE username = '%s'", OBanName);
- mysql_reconnect();
- mysql_query(query9);
- //MYSQL GET IP.
- new plrIP[25], query[256];
- format(checkquery, sizeof(checkquery), "SELECT `ip` FROM `users` WHERE `username` = '%s'", OBanName);
- mysql_query(checkquery);
- mysql_store_result();
- mysql_retrieve_row();
- mysql_get_field("ip", plrIP);
- //Whatever you want to do with the IP... Here "extraid" = playerid
- mysql_free_result(); //DON'T forget this! Or you will get "commands out of sync" error
- //END OF MYSQL GET IP.
- format(warnmsg,sizeof(warnmsg), "{1B8AE4}%s{FFFFFF} has been banned as they have passed the maximum {1B8AE4}3/3 {FFFFFF}warnings limit. [Offline Warning]", OBanName);
- SendClientMessageToAll(COLOR_ERROR, warnmsg);
- format(query,sizeof(query),"INSERT INTO `bans` (Username, Reason, Administrator, IP, Date, Time) VALUES ('%s','3/3 Warnings','Server','%s','%d/%d/%d','%d:%d:%d')",OBanName,plrIP,year,month,date,hour,minute,second);
- mysql_reconnect();
- mysql_query(query);
- AdminLog(playerid, "/owarn", result, OBanName);
- }
- return 1;
- }
- else //DOESNT EXIST
- {
- SendClientMessage(playerid, COLOR_ERROR, "ERROR: Could not find anyone with that username!");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not an administrator!");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/warn", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_SECURITY, "Syntax: /warn (playername/id) (reason)");
- return 1;
- }
- new giveplayerid;
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerNPC(giveplayerid)) return 1;
- if(PInfo[playerid][AdminLevel] >= 1)
- {
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- new length = strlen(cmdtext);
- while ((idx < length) && (cmdtext[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[128];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = cmdtext[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- if(!strlen(result))
- {
- SendClientMessage(playerid, COLOR_SECURITY, "Syntax: /warn (playername/id) (reason)");
- return 1;
- }
- new warnmsg[256], warnreason[128];
- new warnings=0;
- if(PInfo[giveplayerid][Warning1] == 1)
- {
- warnings=warnings+1;
- }
- else
- {
- PlayerPlaySound(giveplayerid, 1190, 0, 0, 0); //Send a slap sound to the victim for lulz.
- format(warnreason, sizeof(warnreason), "%s", result);
- strmid(PInfo[giveplayerid][Reason1], warnreason, 0, strlen(warnreason), 128);
- PInfo[giveplayerid][Warning1] = 1;
- format(warnmsg,sizeof(warnmsg), "{1B8AE4}%s{FFFFFF} has been warned by administrator {1B8AE4}%s{FFFFFF} • {1B8AE4}[Reason: %s]", PlayerName(giveplayerid), PlayerName(playerid), result);
- SendClientMessageToAll(COLOR_ERROR, warnmsg);
- AdminLog(playerid, "/warn", (result), PlayerName(giveplayerid));
- SaveAccount(giveplayerid);
- return 1;
- }
- if(PInfo[giveplayerid][Warning2] == 1)
- {
- warnings=warnings+1;
- }
- else
- {
- PlayerPlaySound(giveplayerid, 1190, 0, 0, 0); //Send a slap sound to the victim for lulz.
- format(warnreason, sizeof(warnreason), "%s", result);
- strmid(PInfo[giveplayerid][Reason2], warnreason, 0, strlen(warnreason), 128);
- PInfo[giveplayerid][Warning2] = 1;
- format(warnmsg,sizeof(warnmsg), "{1B8AE4}%s{FFFFFF} has been warned by administrator {1B8AE4}%s{FFFFFF} • {1B8AE4}[Reason: %s]", PlayerName(giveplayerid), PlayerName(playerid), result);
- SendClientMessageToAll(COLOR_ERROR, warnmsg);
- AdminLog(playerid, "/warn", (result), PlayerName(giveplayerid));
- SaveAccount(giveplayerid);
- return 1;
- }
- if(PInfo[giveplayerid][Warning3] == 1)
- {
- warnings=warnings+1;
- }
- else
- {
- PlayerPlaySound(giveplayerid, 1190, 0, 0, 0); //Send a slap sound to the victim for lulz.
- format(warnreason, sizeof(warnreason), "%s", result);
- strmid(PInfo[giveplayerid][Reason3], warnreason, 0, strlen(warnreason), 128);
- PInfo[giveplayerid][Warning3] = 1;
- format(warnmsg,sizeof(warnmsg), "{1B8AE4}%s{FFFFFF} has been warned by administrator {1B8AE4}%s{FFFFFF} • {1B8AE4}[Reason: %s]", PlayerName(giveplayerid), PlayerName(playerid), result);
- SendClientMessageToAll(COLOR_ERROR, warnmsg);
- AdminLog(playerid, "/warn", (result), PlayerName(giveplayerid));
- SaveAccount(giveplayerid);
- return 1;
- }
- if(warnings == 3)
- {
- PlayerPlaySound(giveplayerid, 1190, 0, 0, 0); //Send a slap sound to the victim for lulz.
- new date,month,year;
- getdate(date,month,year);
- new hour,minute,second;
- gettime(hour,minute,second);
- PInfo[giveplayerid][Warning1] = 0;
- format(warnreason, sizeof(warnreason), "None", result);
- strmid(PInfo[giveplayerid][Reason1], warnreason, 0, strlen(warnreason), 128);
- format(warnreason, sizeof(warnreason), "None", result);
- strmid(PInfo[giveplayerid][Reason2], warnreason, 0, strlen(warnreason), 128);
- format(warnreason, sizeof(warnreason), "None", result);
- strmid(PInfo[giveplayerid][Reason3], warnreason, 0, strlen(warnreason), 128);
- format(warnmsg,sizeof(warnmsg), "{1B8AE4}%s{FFFFFF} has been warned by administrator {1B8AE4}%s{FFFFFF} • {1B8AE4}[Reason: %s]", PlayerName(giveplayerid), PlayerName(playerid), result);
- SendClientMessageToAll(COLOR_ERROR, warnmsg);
- format(warnmsg,sizeof(warnmsg), "{1B8AE4}%s{FFFFFF} has been banned as they have passed the maximum {1B8AE4}3/3 {FFFFFF}warnings limit.", PlayerName(giveplayerid));
- SendClientMessageToAll(COLOR_ERROR, warnmsg);
- new plrIP[25], query[256], Name[MAX_PLAYER_NAME];
- GetPlayerName(giveplayerid,Name,sizeof(Name));
- GetPlayerIp(giveplayerid, plrIP, sizeof(plrIP));
- mysql_real_escape_string(Name,Name);
- format(query,sizeof(query),"INSERT INTO `bans` (Username, Reason, Administrator, IP, Date, Time) VALUES ('%s','3/3 Warnings','Server','%s','%d/%d/%d','%d:%d:%d')",Name,plrIP,year,month,date,hour,minute,second);
- mysql_reconnect();
- mysql_query(query);
- PInfo[giveplayerid][Warning2] = 0;
- PInfo[giveplayerid][Warning3] = 0;
- SaveAccount(giveplayerid);
- AdminLog(playerid, "/warn", (result), PlayerName(giveplayerid));
- Kick(giveplayerid);
- return 1;
- }
- return 1;
- }
- }
- else
- {
- format(string, sizeof(string), "Could not find player (%d)", giveplayerid);
- SendClientMessage(playerid, COLOR_ERROR, string);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not an administrator !");
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/omute", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /omute (full name, case sensitive!)");
- return 1;
- }
- if (PInfo[playerid][AdminLevel] >= 3)
- {
- new OBanName[MAX_PLAYER_NAME];
- mysql_real_escape_string(tmp, OBanName);
- new checkquery2[128];
- format(checkquery2, sizeof(checkquery2), "SELECT 'username' FROM `users` WHERE `username` = '%s'", OBanName);
- mysql_reconnect();
- mysql_query(checkquery2);
- mysql_store_result();
- if(mysql_num_rows() > 0) //
- {
- mysql_free_result();
- new checkquery[128];
- new szUnload[10], IsMutedOrNot;
- format(checkquery, sizeof(checkquery), "SELECT `muted` FROM `users` WHERE `username` = '%s'", OBanName);
- mysql_query(checkquery);
- mysql_store_result();
- mysql_retrieve_row();
- mysql_get_field("muted", szUnload);
- mysql_free_result();
- IsMutedOrNot = strval(szUnload);
- new mutemsg[156];
- if(IsMutedOrNot == 1) // he is muted. Unmute him.
- {
- new query5[200];
- format(query5, sizeof(query5), "UPDATE users SET muted ='0' WHERE username='%s'", OBanName);
- format(mutemsg, sizeof(mutemsg), "Administrator %s(%d) has offline-unmuted player %s.", PlayerName(playerid),playerid,OBanName);
- ABroadCast(COLOR_ADMIN,mutemsg,1); //
- mysql_query(query5);
- AdminLog(playerid, "/omute", "Unmuted", OBanName);
- }
- else // He isn't muted. Mute him.
- {
- new query6[200];
- format(query6, sizeof(query6), "UPDATE users SET muted ='1' WHERE username='%s'", OBanName);
- format(mutemsg, sizeof(mutemsg), "Administrator %s(%d) has offline-muted player %s.", PlayerName(playerid),playerid,OBanName);
- ABroadCast(COLOR_ADMIN,mutemsg,1); //
- mysql_query(query6);
- AdminLog(playerid, "/omute", "Muted", OBanName);
- }
- return 1;
- }
- else //DOESNT EXIST
- {
- SendClientMessage(playerid, COLOR_ERROR, "ERROR: Could not find anyone with that username!");
- return 1;
- }
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/viewban", true) == 0)
- {
- if(PInfo[playerid][AdminLevel] < 1) { SendClientMessage(playerid, COLOR_ERROR, "You are not an administrator!"); return 1; }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /viewban (full name, case sensitive!)");
- return 1;
- }
- new EscapedName2[MAX_PLAYER_NAME];
- mysql_real_escape_string(tmp, EscapedName2);
- new checkquery5[128];
- format(checkquery5,sizeof(checkquery5),"SELECT * FROM `bans` WHERE `Username` = '%s'", EscapedName2);
- mysql_query(checkquery5);
- mysql_store_result();
- if(mysql_num_rows() > 0) //Banned
- {
- new line5[1000];
- if(mysql_fetch_row(line5))//Fetch line
- {
- new data5[6][156];
- new data2[2];
- //data[0] - Username
- //data[1] - Reason
- //data[2] - Administrator
- //data[3] - IP
- //data[4] - Date
- //data2[0] - Banned (pointless)
- //data2[1] - ID (pointless)
- //data[5] - Time
- sscanf(line5, "p<|>s[30]s[156]s[30]s[40]s[40]dds[40]", data5[0],data5[1],data5[2],data5[3],data5[4],data2[0],data2[1],data5[5]); //Splits the line with sscanf
- new Results[256];
- format(Results,sizeof(Results),"-- Viewing Ban ID: #%d (%s) --", data2[1], EscapedName2);
- SendClientMessage(playerid, COLOR_BLUE, Results);
- format(Results,sizeof(Results),"- Username: %s",data5[0]);
- SendClientMessage(playerid, COLOR_WHITE, Results);
- format(Results,sizeof(Results),"- IP Address: %s",data5[3]);
- SendClientMessage(playerid, COLOR_WHITE, Results);
- format(Results,sizeof(Results),"- Ban Reason: %s",data5[1]);
- SendClientMessage(playerid, COLOR_WHITE, Results);
- format(Results,sizeof(Results),"- Administrator: %s",data5[2]);
- SendClientMessage(playerid, COLOR_WHITE, Results);
- format(Results,sizeof(Results),"- Ban Date: %s-%s",data5[4],data5[5]);
- SendClientMessage(playerid, COLOR_WHITE, Results);
- mysql_free_result();
- return 1;
- }
- mysql_free_result();
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "No ban records found under that username!");
- mysql_free_result();
- return 1;
- }
- }
- if(strcmp(cmd, "/deleteaccount", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /deleteaccount (full name, case sensitive!)");
- return 1;
- }
- if (PInfo[playerid][AdminLevel] >= 5)
- {
- new OBanName[MAX_PLAYER_NAME];
- mysql_real_escape_string(tmp, OBanName);
- new checkquery2[128];
- format(checkquery2, sizeof(checkquery2), "SELECT 'username' FROM `users` WHERE `username` = '%s'", OBanName);
- mysql_reconnect();
- mysql_query(checkquery2);
- mysql_store_result();
- if(mysql_num_rows() > 0) //exists.
- {
- new deleteacc[128];
- mysql_free_result();
- format(deleteacc,sizeof(deleteacc),"DELETE FROM users WHERE username = '%s'", OBanName);
- mysql_reconnect();
- mysql_query(deleteacc);
- new msg[128];
- format(msg,sizeof(msg),"Administrator %s(%d) has deleted %s's account.", PlayerName(playerid),playerid, OBanName);
- ABroadCast(COLOR_ADMIN,msg,1);
- AdminLog(playerid, "/deleteaccount", "Deleted Account", OBanName);
- return 1;
- }
- else //DOESNT EXIST
- {
- SendClientMessage(playerid, COLOR_ERROR, "ERROR: Could not find anyone with that username!");
- return 1;
- }
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/oban", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /oban (full name, case sensitive!) (reason)");
- return 1;
- }
- new length = strlen(cmdtext);
- while ((idx < length) && (cmdtext[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[128];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = cmdtext[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- if(!strlen(result))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /oban (full name, case sensitive!) (reason)");
- return 1;
- }
- if (PInfo[playerid][AdminLevel] >= 3)
- {
- new OBanName[MAX_PLAYER_NAME], OBanReason[156], OBanAdmin[MAX_PLAYER_NAME], year, month, date, OBanIP[25];
- mysql_real_escape_string(tmp, OBanName);
- mysql_real_escape_string(result, OBanReason);
- mysql_real_escape_string(PlayerName(playerid), OBanAdmin);
- new checkquery2[128];
- format(checkquery2,sizeof(checkquery2), "SELECT Administrator,Reason FROM bans WHERE Username = '%s' LIMIT 1", OBanName);
- mysql_reconnect();
- mysql_query(checkquery2);
- mysql_store_result();
- mysql_retrieve_row();
- new AdminName[24], Reason[128];
- mysql_get_field("Administrator",AdminName);
- mysql_get_field("Reason",Reason);
- if(mysql_num_rows() > 0)
- {
- format(checkquery2,sizeof(checkquery2),"Player %s is currently banned by %s for %s",OBanName,AdminName,Reason);
- SendClientMessage(playerid, COLOR_ERROR, checkquery2);
- mysql_free_result();
- return 1;
- }
- mysql_free_result();
- format(checkquery2, sizeof(checkquery2), "SELECT `username` FROM `users` WHERE `username` = '%s' LIMIT 1", OBanName);
- mysql_reconnect();
- mysql_query(checkquery2);
- mysql_store_result();
- if(mysql_num_rows() > 0) //This is offline-ban. It grabs the IP from the user (offline), and inserts it into ban database.
- {
- PlaySound(0);
- mysql_free_result();
- getdate(date,month,year);
- new hour,minute,second;
- gettime(hour,minute,second);
- new checkquery[128];
- mysql_reconnect();
- format(checkquery, sizeof(checkquery), "SELECT `ip` FROM `users` WHERE `username` = '%s' LIMIT 1", OBanName);
- mysql_query(checkquery);
- mysql_store_result();
- mysql_retrieve_row();
- mysql_get_field("ip",OBanIP); // This does not work.
- mysql_free_result();
- new query5[250];
- format(query5, sizeof(query5), "UPDATE users SET banned ='1' WHERE username='%s' LIMIT 1", OBanName);
- mysql_query(query5);
- format(query5, sizeof(query5), "INSERT INTO `bans` (Username, Reason, Administrator, IP, Date, Time) VALUES ('%s','%s','%s','%s','%d/%d/%d','%d:%d:%d')",OBanName,OBanReason,OBanAdmin,OBanIP,year,month,date,hour,minute,second);
- mysql_query(query5);
- new hehmsg[512];
- format(hehmsg, sizeof(hehmsg), "{1B8AE4}%s{FFFFFF} has been offline-banned by administrator {1B8AE4}%s{FFFFFF} • {1B8AE4}[Reason: %s]", OBanName, PlayerName(playerid), OBanReason);
- SendClientMessageToAll(COLOR_ERROR, hehmsg);
- mysql_free_result();
- AdminLog(playerid, "/oban", OBanReason, OBanName);
- return 1;
- }
- else //DOESNT EXIST
- {
- SendClientMessage(playerid, COLOR_ERROR, "ERROR: Could not find anyone with that username!");
- return 1;
- }
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/unban", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /unban (full name, case sensitive!)");
- return 1;
- }
- if (PInfo[playerid][AdminLevel] >= 3)
- {
- new EscapedName[MAX_PLAYER_NAME];
- mysql_real_escape_string(tmp, EscapedName);
- new checkquery2[128];
- format(checkquery2, sizeof(checkquery2), "SELECT * FROM `bans` WHERE `Username` = '%s'", EscapedName);
- mysql_reconnect();
- mysql_query(checkquery2);
- mysql_store_result();
- if(mysql_num_rows() > 0) //BANNED
- {
- new line[500];
- if(mysql_fetch_row(line)) //Fetches the line
- {
- new data[6][128]; //The data strings
- new data2[2];
- sscanf(line, "p<|>s[128]s[128]s[128]s[128]s[128]dds[128]", data[0], data[1], data[2], data[3], data[4], data2[0], data2[1], data[5]); //Splits the line with sscanf
- format(string, sizeof(string), "You have unbanned the player {1B8AE4}%s(%s)", EscapedName, data[3]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- format(string,sizeof(string), "[Ban Details] Banned by {1B8AE4}%s {FFFFFF}• {1B8AE4}[Reason: %s] {FFFFFF}at {1B8AE4}[%s %s]", data[2], data[1], data[5], data[4]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- format(string,sizeof(string), "Administrator %s(%d) has unbanned %s [Banned by: %s, reason: %s]", PlayerName(playerid),playerid, EscapedName, data[2], data[1]); //Readon is data[2] ? No, data[1]. It starts - data[0] - user, data[1] - reason
- ABroadCast(COLOR_ADMIN,string,1); //
- new deletequery2[128];
- mysql_reconnect();
- format(deletequery2, sizeof(deletequery2), "DELETE FROM bans WHERE Username = '%s'", EscapedName);
- mysql_query(deletequery2);
- format(deletequery2, sizeof(deletequery2), "UPDATE users SET banned = '0' WHERE username = '%s'", EscapedName);
- mysql_query(deletequery2);
- mysql_free_result();
- AdminLog(playerid, "/unban", "Unbanned Player", EscapedName);
- return 1;
- }
- mysql_free_result();
- }
- else //NOT BANNED
- {
- SendClientMessage(playerid, COLOR_ERROR, "ERROR: Could not find any ban records under that username!");
- return 1;
- }
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/teleintoveh", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- new moneys;
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /teleintoveh (vehicle id)");
- return 1;
- }
- moneys = strvalEx(tmp);
- if(moneys < 0)
- {
- SendClientMessage(playerid, COLOR_ERROR, "Vehicle ID must be over 0!");
- return 1;
- }
- if(GetVehicleModel(moneys) > 399 && PInfo[playerid][AdminLevel] >= 2)
- {
- format(string, sizeof(string), "You have teleported into vehicle ID {1B8AE4}%d.",moneys);
- SendClientMessage(playerid, COLOR_WHITE, string);
- PutPlayerInVehicle(playerid, moneys, 0);
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- AdminLog(playerid, "/teleintoveh", "Teleported into Vehicle", "Vehicle");
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "That vehicle ID could not be found.");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/televeh", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- new moneys;
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /televeh (vehicle id)");
- return 1;
- }
- moneys = strvalEx(tmp);
- if(moneys < 0)
- {
- SendClientMessage(playerid, COLOR_ERROR, "Vehicle ID must be over 0!");
- return 1;
- }
- if(IsValidVehicleID(moneys) && PInfo[playerid][AdminLevel] >= 2)
- {
- new Float:tempx, Float:tempy, Float:tempz;
- format(string, sizeof(string), "You have spawned vehicle ID {1B8AE4}%d {FFFFFF}to your location.",moneys);
- SendClientMessage(playerid, COLOR_WHITE, string);
- GetPlayerPos(playerid, tempx, tempy, tempz);
- SetVehiclePos(moneys, tempx, tempy, tempz);
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- AdminLog(playerid, "/televeh", "Teleported Vehicle", "Vehicle");
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "That vehicle ID does not exist!");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/teleto", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /teleto (playername/id)");
- return 1;
- }
- new Float:plocx,Float:plocy,Float:plocz;
- new plo;
- plo = ReturnUser(tmp);
- if(IsPlayerNPC(plo)) return 1;
- if(IsPlayerConnected(plo))
- {
- if(plo != INVALID_PLAYER_ID)
- {
- if(PInfo[playerid][AdminLevel] >= 2)
- {
- new interior = GetPlayerInterior(plo);
- new vw = GetPlayerVirtualWorld(plo);
- SetPlayerVirtualWorld(playerid,vw);
- SetPlayerInterior(playerid,interior);
- GetPlayerPos(plo, plocx, plocy, plocz);
- if(GetPlayerState(playerid) == 2)
- {
- new tmpcar = GetPlayerVehicleID(playerid);
- SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
- }
- else
- {
- SetPlayerPos(playerid,plocx,plocy+2, plocz);
- }
- new sendmsg[128];
- format(sendmsg,sizeof(sendmsg),"Administrator {1B8AE4}%s(%d) {FFFFFF}has teleported to your location.", PlayerName(playerid), playerid);
- SendClientMessage(plo, COLOR_WHITE, sendmsg);
- format(sendmsg,sizeof(sendmsg),"You have teleported to {1B8AE4}%s's(%d) {FFFFFF}location.", PlayerName(plo), plo);
- SendClientMessage(playerid, COLOR_WHITE, sendmsg);
- AdminLog(playerid, "/teleto", "Teleported To", PlayerName(plo));
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not an administrator !");
- }
- }
- }
- else
- {
- format(string, sizeof(string), "Could not find player (%d)", plo);
- SendClientMessage(playerid, COLOR_ERROR, string);
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/teletome", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /teletome (playername/id)");
- return 1;
- }
- new Float:plocx,Float:plocy,Float:plocz;
- new plo;
- plo = ReturnUser(tmp);
- if(IsPlayerNPC(plo)) return 1;
- if(IsPlayerConnected(plo))
- {
- if(plo != INVALID_PLAYER_ID)
- {
- if(GetPlayerState(plo) == PLAYER_STATE_SPECTATING)
- {
- SendClientMessage(playerid, COLOR_ERROR, "That player is currently spectating someone!");
- return 1;
- }
- if(PInfo[plo][AdminLevel] >= 5)
- {
- SendClientMessage(playerid, COLOR_ERROR, "Cannot teleport server owners - ask them to teleport to you!");
- return 1;
- }
- if(PInfo[playerid][AdminLevel] >= 2)
- {
- new interior = GetPlayerInterior(playerid);
- new vw = GetPlayerVirtualWorld(playerid);
- SetPlayerVirtualWorld(plo,vw);
- SetPlayerInterior(plo,interior);
- GetPlayerPos(playerid, plocx, plocy, plocz);
- if(GetPlayerState(plo) == 2)
- {
- new tmpcar = GetPlayerVehicleID(plo);
- SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
- }
- else
- {
- SetPlayerPos(plo,plocx,plocy+2, plocz);
- }
- new sendmsg[128];
- format(sendmsg,sizeof(sendmsg),"Administrator {1B8AE4}%s(%d) {FFFFFF}has teleported you to their location.", PlayerName(playerid), playerid);
- SendClientMessage(plo, COLOR_WHITE, sendmsg);
- format(sendmsg,sizeof(sendmsg),"You have teleported {1B8AE4}%s(%d) {FFFFFF}to your location.", PlayerName(plo), plo);
- SendClientMessage(playerid, COLOR_WHITE, sendmsg);
- AdminLog(playerid, "/teletome", "Teleported Player", PlayerName(plo));
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not an administrator !");
- }
- }
- }
- else
- {
- format(string, sizeof(string), "Could not find player (%d)", plo);
- SendClientMessage(playerid, COLOR_ERROR, string);
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/check", true) == 0)
- {
- if(PInfo[playerid][AdminLevel] > 0)
- {
- new giveplayerid;
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /check (playername/id)");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerNPC(giveplayerid)) return 1;
- if(IsPlayerConnected(giveplayerid))
- {
- new msg[250];
- format(msg,sizeof(msg), "%s(%d) - [IP: %s] [Register Date: %s] [Money: $%d] [Score: %d] [PlayTime: %d hours & %d minutes]",PlayerName(giveplayerid),giveplayerid,PInfo[giveplayerid][IP],PInfo[giveplayerid][RegisterDate],PInfo[giveplayerid][Money],PInfo[giveplayerid][TotalScore],PInfo[giveplayerid][HoursPlayed],PInfo[giveplayerid][MinsPlayed]);
- SendClientMessage(playerid, COLOR_GREEN, msg);
- if(PInfo[playerid][AdminLevel] > 4) { format(msg,sizeof(msg), "[Password: %s] [Email: %s]",PInfo[giveplayerid][Password],PInfo[giveplayerid][Email]); SendClientMessage(playerid,COLOR_GREEN,msg); }
- format(msg,sizeof(msg), "[TotalEarntFromWorking: $%d] [Callsign: %s] [Airline: %s] [AirlineRank: %d] [EarntForAirline: $%d]", PInfo[giveplayerid][EarntFromWorking],PInfo[giveplayerid][Callsign],AInfo[PInfo[giveplayerid][Airline]][aName],PInfo[giveplayerid][AirlineRank],PInfo[giveplayerid][EarntForAirline]);
- SendClientMessage(playerid, COLOR_GREEN, msg);
- format(msg,sizeof(msg), "[Warning 1: %d] [Reason1: %s] [Warning 2: %d] [Reason2: %s] [Warning3: %d] [Reason3: %s]", PInfo[giveplayerid][Warning1],PInfo[giveplayerid][Reason1],PInfo[giveplayerid][Warning2],PInfo[giveplayerid][Reason2],PInfo[giveplayerid][Warning3],PInfo[giveplayerid][Reason3]);
- SendClientMessage(playerid, COLOR_GREEN, msg);
- AdminLog(playerid, "/check", "Checked Player Stats", PlayerName(giveplayerid));
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "Could not find player - is he online?");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not an administrator!");
- return 1;
- }
- }
- if(strcmp(cmd, "/spec", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- new giveplayerid;
- if(PInfo[playerid][AdminLevel] < 1)
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not an administrator !");
- return 1;
- }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /spec (playername/id/off)");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerNPC(giveplayerid)) return 1;
- if(strcmp("off", tmp, true, strlen(tmp)) == 0)
- {
- if(GetPlayerState(playerid) != PLAYER_STATE_SPECTATING)
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not spectating anyone!");
- return 1;
- }
- WasSpectating[playerid] = 1;
- SetPlayerHealth(playerid, 100);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerInterior(playerid, tempinterior[playerid]);
- SetPlayerPos(playerid, tempX[playerid], tempY[playerid], tempZ[playerid]);
- SetPlayerFacingAngle(playerid, tempA[playerid]);
- SendClientMessage(playerid, COLOR_WHITE, "You have finished spectating.");
- TogglePlayerSpectating(playerid, 0);
- SpectatedID[playerid] = INVALID_PLAYER_ID;
- SpectateType[playerid] = ADMIN_SPEC_TYPE_NONE;
- UpdateSkin(playerid);
- return 1;
- }
- if(IsPlayerConnected(giveplayerid))
- {
- if(GetPlayerState(playerid) != PLAYER_STATE_SPECTATING)
- {
- tempinterior[playerid] = GetPlayerInterior(playerid);
- GetPlayerPos(playerid, tempX[playerid], tempY[playerid], tempZ[playerid]);
- GetPlayerFacingAngle(playerid, tempA[playerid]);
- }
- SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
- TogglePlayerSpectating(playerid, 1);
- SpectatedID[playerid] = giveplayerid;
- if(IsPlayerInAnyVehicle(giveplayerid))
- {
- PlayerSpectateVehicle(playerid, GetPlayerVehicleID(giveplayerid));
- SpectateType[playerid] = ADMIN_SPEC_TYPE_VEHICLE;
- }
- else
- {
- PlayerSpectatePlayer(playerid, giveplayerid);
- SpectateType[playerid] = ADMIN_SPEC_TYPE_PLAYER;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "Could not find player !");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/mute", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /mute (playername/id)");
- return 1;
- }
- new playa;
- playa = ReturnUser(tmp);
- if(PInfo[playerid][AdminLevel] >= 1)
- {
- if(IsPlayerConnected(playa))
- {
- if(playa != INVALID_PLAYER_ID)
- {
- if(PInfo[playa][Muted] == 0)
- {
- PlaySound(1); //Shut up foo - Mr T.
- PInfo[playa][Muted] = 1;
- format(string, sizeof(string), "Administrator {1B8AE4}%s(%d) {FFFFFF}has muted player {1B8AE4}%s.",PlayerName(playerid),playerid, PlayerName(playa));
- SendClientMessageToAll(COLOR_WHITE, string);
- SendClientMessage(playerid, COLOR_WHITE, "Type /mute again on the player to unmute them.");
- AdminLog(playerid, "/mute", "Mute", PlayerName(playa));
- return 1;
- }
- else
- {
- PInfo[playa][Muted] = 0;
- format(string, sizeof(string), "Administrator {1B8AE4}%s(%d) {FFFFFF}has un-muted player {1B8AE4}%s.",PlayerName(playerid),playerid, PlayerName(playa));
- SendClientMessageToAll(COLOR_WHITE, string);
- AdminLog(playerid, "/mute", "Unmute", PlayerName(playa));
- }
- }
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not an administrator !");
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/me", true) == 0)
- {
- new length=strlen(cmdtext);
- while ((idx < length) && (cmdtext[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[128];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = cmdtext[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- if(!strlen(result))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /me (action)");
- return 1;
- }
- new msg[156];
- format(msg,sizeof(msg),"* %s(%d) %s *", PlayerName(playerid),playerid,result);
- SendClientMessageToAll(COLOR_ME, msg);
- return 1;
- }
- if(strcmp(cmd, "/afk", true) == 0)
- {
- if(PlayerLogged[playerid] == 1)
- {
- if(AFKPLAYER[playerid] == 0) //not afk
- {
- new length = strlen(cmdtext);
- while ((idx < length) && (cmdtext[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[128];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = cmdtext[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- if(!strlen(result))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /afk (reason)");
- return 1;
- }
- if(IsPlayerInAnyVehicle(playerid) == 1)
- {
- SendClientMessage(playerid, COLOR_ERROR, "Cannot go AFK while in a vehicle!");
- return 1;
- }
- new msg[156];
- strmid(AFKREASON[playerid], result, 0, strlen(result), 128); //AFK Reason saving.
- format(msg, sizeof(msg), "Player {1B8AE4}%s (%d) {FFFFFF}has gone AFK • {1B8AE4}[Reason: %s]", PlayerName(playerid),playerid,result);
- SendClientMessageToAll(COLOR_WHITE, msg);
- format(msg, sizeof(msg), "You have gone AFK, to come back from being AFK, type /afk.");
- PlayerNotice(playerid, msg);
- AFKPLAYER[playerid] = 1;
- TogglePlayerControllable(playerid, 0);
- SetPlayerColor(playerid,COLOR_AFK);
- return 1;
- }
- else if(AFKPLAYER[playerid] == 1)
- {
- TogglePlayerControllable(playerid, 1);
- new result[156];
- format(result, sizeof(result), "Player {1B8AE4}%s (%d) {FFFFFF}is now back • {1B8AE4}[Reason: %s]", PlayerName(playerid),playerid,AFKREASON[playerid]);
- SendClientMessageToAll(COLOR_WHITE, result);
- AFKPLAYER[playerid] = 0;
- UpdatePlayerColour(playerid);
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not logged in!");
- return 1;
- }
- }
- if(strcmp(cmd, "/restartserver", true) == 0)
- {
- if(PInfo[playerid][AdminLevel] > 3)
- {
- new length = strlen(cmdtext);
- while ((idx < length) && (cmdtext[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[64];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = cmdtext[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- if(!strlen(result))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /restartserver (reason)");
- return 1;
- }
- if(ServerRestarting == 1)
- {
- SendClientMessage(playerid, COLOR_ERROR, "The server is already restarting!");
- return 1;
- }
- new restartmsg[128];
- ServerRestarting = 1;
- format(restartmsg,sizeof(restartmsg),"Administrator {1B8AE4}%s(%d) {FFFFFF}has restarted the server • {1B8AE4}[Reason: %s]", PlayerName(playerid),playerid, result);
- SendClientMessageToAll(COLOR_WHITE, restartmsg);
- SendClientMessageToAll(COLOR_WHITE, "* Server restarting in {1B8AE4}30 {FFFFFF}seconds ...");
- SetTimerEx("RestartServer", 30000, false, "i", playerid);
- AdminLog(playerid, "/restartserver", result, "Everyone");
- return 1;
- }
- }
- if(strcmp(cmd, "/setmotd", true) == 0)
- {
- if(PInfo[playerid][AdminLevel] > 3) // 4 +
- {
- new length = strlen(cmdtext);
- while ((idx < length) && (cmdtext[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[250];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = cmdtext[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- if(!strlen(result))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /setmod (message of the day)");
- return 1;
- }
- new query[450];
- new username[MAX_PLAYER_NAME];
- mysql_real_escape_string(PlayerName(playerid), username);
- mysql_real_escape_string(result, result);
- new motdmessage[256];
- format(motdmessage,sizeof(motdmessage),"New MOTD: %s | Set by: %s", result, PlayerName(playerid));
- SendClientMessageToAll(COLOR_YELLOW, motdmessage);
- AdminLog(playerid, "/setmotd", result, "Server");
- format(query,sizeof(query),"UPDATE statistics SET motd='%s', motdsetby='%s'", result, username);
- mysql_query(query);
- LoadStuff();
- return 1;
- }
- }
- if(strcmp(cmd, "/announce", true) == 0)
- {
- if(PInfo[playerid][AdminLevel] > 1)
- {
- new length = strlen(cmdtext);
- while ((idx < length) && (cmdtext[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[156];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = cmdtext[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- if(!strlen(result))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /announce (announcement)");
- return 1;
- }
- new restartmsg[256];
- format(restartmsg,sizeof(restartmsg),"Administrator {1B8AE4}%s(%d) {FFFFFF}announced • {1B8AE4}%s", PlayerName(playerid),playerid,result);
- SendClientMessageToAll(COLOR_WHITE, restartmsg);
- AdminLog(playerid, "/announce", result, "Everyone");
- return 1;
- }
- }
- if(strcmp(cmd, "/setname", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /setname (playerid) (new name)");
- return 1;
- }
- new giveplayerid = ReturnUser(tmp);
- if(PInfo[playerid][AdminLevel] > 3)
- {
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /setname (playerid) (new name)");
- return 1;
- }
- new checkquery[128];
- format(checkquery, sizeof(checkquery), "SELECT `username` FROM `users` WHERE `username` = '%s'", tmp);
- mysql_reconnect();
- mysql_query(checkquery);
- mysql_store_result();
- if(mysql_num_rows() > 0)
- {
- SendClientMessage(playerid, COLOR_ERROR, "ERROR: That name is already registered !");
- return 1;
- }
- else
- {
- new oldname[MAX_PLAYER_NAME];
- format(oldname, sizeof(oldname), "%s", PlayerName(giveplayerid));
- mysql_real_escape_string(oldname,oldname);
- format(string, sizeof(string), "You have renamed the player {1B8AE4}%s {FFFFFF}to {1B8AE4}%s", PlayerName(giveplayerid), tmp);
- SendClientMessage(playerid, COLOR_WHITE, string);
- format(string, sizeof(string), "Your name has been changed from {1B8AE4}%s {FFFFFF}to {1B8AE4}%s", PlayerName(giveplayerid), tmp);
- SendClientMessage(giveplayerid, COLOR_WHITE, string);
- format(string, sizeof(string), "Administrator {1B8AE4}%s(%d) {FFFFFF}has set {1B8AE4}%s's{FFFFFF} name to {1B8AE4}%s", PlayerName(playerid),playerid, PlayerName(giveplayerid), tmp);
- SendClientMessageToAll(COLOR_WHITE, string);
- SetPlayerName(giveplayerid, tmp);
- mysql_free_result();
- new deletequery[128];
- mysql_reconnect();
- format(deletequery,sizeof(deletequery),"INSERT INTO namechanges (cUsername, wUsername, Processed) VALUES ('%s', '%s', '1')",oldname, tmp);
- mysql_query(deletequery);
- format(deletequery, sizeof(deletequery), "UPDATE users SET username = '%s' WHERE username = '%s'", tmp, oldname);
- mysql_query(deletequery);
- SaveAccount(giveplayerid);
- if(PInfo[giveplayerid][House1] > 0)
- {
- new query[200];
- format(query,sizeof(query),"UPDATE houses SET OwnedBy='%s' WHERE OwnedBy='%s'", tmp, oldname);
- mysql_reconnect();
- mysql_query(query);
- }
- if(PInfo[giveplayerid][House2] > 0)
- {
- new query[200];
- format(query,sizeof(query),"UPDATE houses SET OwnedBy='%s' WHERE OwnedBy='%s'", tmp, oldname);
- mysql_reconnect();
- mysql_query(query);
- }
- format(deletequery,sizeof(deletequery),"SELECT NULL from pvehicles WHERE OwnedBy='%s'", oldname);
- mysql_query(deletequery);
- mysql_store_result();
- new exists = mysql_num_rows();
- mysql_free_result();
- if(exists > 0)
- {
- format(deletequery,sizeof(deletequery),"UPDATE pvehicles SET OwnedBy='%s' WHERE OwnedBy='%s'",tmp,oldname);
- mysql_query(deletequery);
- }
- format(deletequery,sizeof(deletequery),"SELECT NULL FROM airlines WHERE Owner='%s'", oldname);
- mysql_query(deletequery);
- mysql_store_result();
- exists = mysql_num_rows();
- mysql_free_result();
- if(exists > 0)
- {
- format(deletequery,sizeof(deletequery),"UPDATE airlines SET Owner='%s' WHERE Owner='%s'",tmp,oldname);
- mysql_query(deletequery);
- }
- format(deletequery,sizeof(deletequery),"SELECT NULL FROM paylog WHERE Username='%s'", oldname);
- mysql_query(deletequery);
- mysql_store_result();
- exists = mysql_num_rows();
- mysql_free_result();
- if(exists > 0)
- {
- format(deletequery,sizeof(deletequery),"UPDATE paylog SET Username='%s' WHERE Username='%s'",tmp,oldname);
- mysql_query(deletequery);
- }
- format(deletequery,sizeof(deletequery),"SELECT NULL FROM paylog WHERE Receiver='%s'", oldname);
- mysql_query(deletequery);
- mysql_store_result();
- exists = mysql_num_rows();
- mysql_free_result();
- if(exists > 0)
- {
- format(deletequery,sizeof(deletequery),"UPDATE paylog SET Receiver='%s' WHERE Receiver='%s'",tmp,oldname);
- mysql_query(deletequery);
- }
- format(deletequery,sizeof(deletequery),"SELECT NULL FROM paylog WHERE Fromwho='%s'", oldname);
- mysql_query(deletequery);
- mysql_store_result();
- exists = mysql_num_rows();
- mysql_free_result();
- if(exists > 0)
- {
- format(deletequery,sizeof(deletequery),"UPDATE paylog SET Fromwho='%s' WHERE Fromwho='%s'",tmp,oldname);
- mysql_query(deletequery);
- }
- format(deletequery,sizeof(deletequery),"SELECT NULL FROM skins WHERE owner='%s'", oldname);
- mysql_query(deletequery);
- mysql_store_result();
- exists = mysql_num_rows();
- mysql_free_result();
- if(exists > 0)
- {
- format(deletequery,sizeof(deletequery),"UPDATE skins SET owner='%s' WHERE owner='%s'",tmp,oldname);
- mysql_query(deletequery);
- }
- format(deletequery,sizeof(deletequery),"SELECT NULL FROM tickets WHERE Receiver='%s'", oldname);
- mysql_query(deletequery);
- mysql_store_result();
- exists = mysql_num_rows();
- mysql_free_result();
- if(exists > 0)
- {
- format(deletequery,sizeof(deletequery),"UPDATE tickets SET Receiver='%s' WHERE Receiver='%s'",tmp,oldname);
- mysql_query(deletequery);
- }
- format(deletequery,sizeof(deletequery),"SELECT NULL FROM tickets WHERE Administrator='%s'", oldname);
- mysql_query(deletequery);
- mysql_store_result();
- exists = mysql_num_rows();
- mysql_free_result();
- if(exists > 0)
- {
- format(deletequery,sizeof(deletequery),"UPDATE tickets SET Administrator='%s' WHERE Administrator='%s'",tmp,oldname);
- mysql_query(deletequery);
- }
- AdminLog(playerid, "/setname", tmp, oldname);
- return 1;
- }
- }
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not an administrator !");
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/healall", true) == 0)
- {
- if(PInfo[playerid][AdminLevel] > 1)
- {
- for(new i; i<MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- SetPlayerHealth(i, 100);
- }
- }
- new msg[128];
- format(msg, sizeof(msg), "Administrator {1B8AE4}%s(%d) {FFFFFF}has healed all active players.", PlayerName(playerid),playerid);
- SendClientMessageToAll(COLOR_WHITE, msg);
- AdminLog(playerid, "/healall", "Healed Players", "Everyone");
- return 1;
- }
- }
- if(strcmp(cmd, "/forums", true) == 0)
- {
- SendClientMessage(playerid, COLOR_WHITE, "For all the latest news & updates, please visit the forums at: {1B8AE4}http://www.the-lof.com");
- return 1;
- }
- if(strcmp(cmd, "/makeadmin", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(PInfo[playerid][AdminLevel] > 4)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /makeadmin (name/id) (level)");
- return 1;
- }
- new para1;
- new level;
- para1 = ReturnUser(tmp);
- tmp = strtok(cmdtext, idx);
- level = strvalEx(tmp);
- if(IsPlayerConnected(para1))
- {
- if(para1 != INVALID_PLAYER_ID)
- {
- PInfo[para1][AdminLevel] = level;
- printf("%s has set %s to a level %d admin.", PlayerName(playerid), PlayerName(para1), level);
- format(string, sizeof(string), "You have been set to a level {1B8AE4}%d {FFFFFF}admin by {1B8AE4}%s", level, PlayerName(playerid));
- SendClientMessage(para1, COLOR_WHITE, string);
- format(string, sizeof(string), "You have set {1B8AE4}%s {FFFFFF}to a level {1B8AE4}%d {FFFFFF}admin.", PlayerName(para1),level);
- SendClientMessage(playerid, COLOR_WHITE, string);
- format(string,sizeof(string),"Set to %d", level);
- AdminLog(playerid, "/makeadmin", string, PlayerName(para1));
- return 1;
- }
- }
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/kill", true) == 0)
- {
- SetPlayerArmour(playerid, 0);
- SetPlayerHealth(playerid, 0);
- return 1;
- }
- if(strcmp(cmd, "/clearchat", true) == 0 || strcmp(cmd, "/cc", true) == 0)
- {
- if(PInfo[playerid][AdminLevel] > 0)
- {
- for(new g; g<50; g++)
- {
- SendClientMessageToAll(COLOR_WHITE, "");
- }
- new msg[128];
- format(msg, sizeof(msg), "Administrator {1B8AE4}%s(%d) {FFFFFF}has cleared the chat.", PlayerName(playerid),playerid);
- SendClientMessageToAll(COLOR_WHITE, msg);
- AdminLog(playerid, "/cc", "Cleared Chat", "None");
- return 1;
- }
- }
- if(strcmp(cmd, "/rules", true) == 0)
- {
- SendClientMessage(playerid, COLOR_BLUE, "---- Rules of The Life of Flying ----");
- SendClientMessage(playerid, COLOR_WHITE, "1) Do not deathmatch under any circumstances. - This includes planebombing.");
- SendClientMessage(playerid, COLOR_WHITE, "2) Do not abuse bugs which may have occured.");
- SendClientMessage(playerid, COLOR_WHITE, "3) Never attempt to cheat by using hacking tools, trainers or anything alike.");
- SendClientMessage(playerid, COLOR_WHITE, "4) Do not advertise any server which isn't related to the PoT here.");
- SendClientMessage(playerid, COLOR_WHITE, "5) Be mature while playing, do not insult others. - Don't be a troll.");
- SendClientMessage(playerid, COLOR_BLUE, "--- For a full list of rules, visit the /forums ---");
- return 1;
- }
- if(strcmp(cmd, "/a", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(PInfo[playerid][Airline] == 0)
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not in an airline!");
- return 1;
- }
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new length = strlen(cmdtext);
- while ((idx < length) && (cmdtext[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[156];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = cmdtext[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- if(!strlen(result))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /a (text)");
- return 1;
- }
- new rank[128];
- if(PInfo[playerid][AirlineRank] == 1) { format(rank,sizeof(rank),"%s", AInfo[PInfo[playerid][Airline]][aRank1]); }
- else if(PInfo[playerid][AirlineRank] == 2) { format(rank,sizeof(rank),"%s", AInfo[PInfo[playerid][Airline]][aRank2]); }
- else if(PInfo[playerid][AirlineRank] == 3) { format(rank,sizeof(rank),"%s", AInfo[PInfo[playerid][Airline]][aRank3]); }
- else if(PInfo[playerid][AirlineRank] == 4) { format(rank,sizeof(rank),"%s", AInfo[PInfo[playerid][Airline]][aRank4]); }
- else if(PInfo[playerid][AirlineRank] == 5) { format(rank,sizeof(rank),"%s", AInfo[PInfo[playerid][Airline]][aRank5]); }
- else if(PInfo[playerid][AirlineRank] == 6) { format(rank,sizeof(rank),"%s", AInfo[PInfo[playerid][Airline]][aRank6]); }
- format(string, sizeof(string), "[%s]%s %s(%d): %s", AInfo[PInfo[playerid][Airline]][aName], rank, PlayerName(playerid), playerid, result);
- new airlineid = PInfo[playerid][Airline];
- if(PInfo[playerid][Airline] >= 1)
- {
- SendAirlineMessage(COLOR_AIRLINECHAT, string, airlineid);
- SendHiddenMessage(string);
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/v", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(PInfo[playerid][Vip] == 0)
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not a VIP !");
- return 1;
- }
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new length = strlen(cmdtext);
- while ((idx < length) && (cmdtext[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[156];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = cmdtext[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- if(!strlen(result))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /v (text)");
- return 1;
- }
- format(string, sizeof(string), "([VIP] %s (%d): %s)", PlayerName(playerid), playerid, result);
- if(PInfo[playerid][Vip] >= 1)
- {
- SendVIPMessage(COLOR_VIP, string);
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/ac", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new length = strlen(cmdtext);
- while ((idx < length) && (cmdtext[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[156];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = cmdtext[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- if(!strlen(result))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /ac (text)");
- return 1;
- }
- format(string, sizeof(string), "[AdminChat] %s(%d): %s", PlayerName(playerid), playerid, result);
- if(PInfo[playerid][AdminLevel] >= 1)
- {
- SendAdminMessage(COLOR_ADMIN, string);
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/report", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new length = strlen(cmdtext);
- while ((idx < length) && (cmdtext[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[156];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = cmdtext[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- if(!strlen(result))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /report (playerid) (reason)");
- return 1;
- }
- format(string, sizeof(string), "Report from [%d]%s: %s",playerid, sendername, (result));
- ABroadCast(COLOR_ADMIN,string,1);
- SendClientMessage(playerid, COLOR_ADMIN, "Your report message was sent to the admins, wait patiently for a reply.");
- }
- return 1;
- }
- if(strcmp(cmd, "/repair", true) == 0 || strcmp(cmd, "/fix", true) == 0)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- if(PInfo[playerid][Tickets] > 0)
- {
- RepairVehicle(GetPlayerVehicleID(playerid));
- PInfo[playerid][Tickets]-=1;
- format(string,sizeof(string),"You have used a ticket and repaired your vehicle for free! [{1B8AE4}%d {FFFFFF}tickets remaining]",PInfo[playerid][Tickets]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- return 1;
- }
- if(IsAtGasStation(playerid))
- {
- new id = GetPlayerVehicleID(playerid);
- new Float:Health;
- GetVehicleHealth(id, Health);
- Health = floatdiv(Health,10.0);
- if(Health > 99)
- {
- SendClientMessage(playerid, COLOR_ERROR, "Your vehicle is already fully repaired!");
- return 1;
- }
- new Total = 100; //They are 80 Health.
- Total -= floatround(Health,floatround_ceil); // 100 - 80 = 20.
- if(PInfo[playerid][Vip] == 0) { Total *= 40; } // 20 x 40 = xx
- else { Total *= 20; } // 20 x 20 = xx
- if(PInfo[playerid][Money] < Total)
- {
- SendClientMessage(playerid, COLOR_ERROR, "You cannot afford to repair your vehicle!");
- return 1;
- }
- PInfo[playerid][Money] -= Total;
- GivePlayerMoney(playerid, -Total);
- format(string,sizeof(string),"You have fully repaired your vehicle for a total of {1B8AE4}$%d.", Total);
- SendClientMessage(playerid, COLOR_WHITE, string);
- new amtearn[24];
- format(amtearn,sizeof(amtearn),"-$%d", Total);
- GameTextCostumeForPlayer(playerid,amtearn,3,2,COLOR_ERROR); //style 2, 3 seconds, $1,250 (text)!
- RepairVehicle(id);
- PayLog(PlayerName(playerid), Total, "Repaired Vehicle", "Server", "N/A");
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not at a repair zone! (Repair zones are at a few main airports)");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not in a vehicle !");
- return 1;
- }
- }
- if(strcmp(cmd, "/refuel", true) == 0 || strcmp(cmd, "/fuel", true) == 0)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- if(PInfo[playerid][Tickets] > 0)
- {
- new id = GetPlayerVehicleID(playerid);
- vfuel[id] = 100;
- new engine, lights, alarm, doors, bonnet, boot, objective;
- GetVehicleParamsEx(id, engine, lights, alarm, doors, bonnet, boot, objective);
- SetVehicleParamsEx(id, 1, lights, alarm, doors, bonnet, boot, objective);
- PInfo[playerid][Tickets]=PInfo[playerid][Tickets]-1;
- format(string,sizeof(string),"You have used a ticket and refueled your vehicle for free! [{1B8AE4}%d {FFFFFF}tickets remaining]",PInfo[playerid][Tickets]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- return 1;
- }
- if(IsAtGasStation(playerid))
- {
- new id = GetPlayerVehicleID(playerid);
- new Fuel = vfuel[id];
- if(Fuel == 100)
- {
- SendClientMessage(playerid, COLOR_ERROR, "Your vehicle already has a full tank of fuel!");
- return 1;
- }
- new Total;
- Total = 100-Fuel;
- Total = Total*55;
- if(PInfo[playerid][Vip] == 1) { Total=Total/100; Total=Total*75; }
- if(PInfo[playerid][Money] < Total)
- {
- SendClientMessage(playerid, COLOR_ERROR, "You cannot afford to refuel your vehicle!");
- return 1;
- }
- PInfo[playerid][Money] = PInfo[playerid][Money]-Total;
- GivePlayerMoney(playerid, -Total);
- format(string,sizeof(string),"You have refueled your vehicle for a total of {1B8AE4}$%d.", Total);
- SendClientMessage(playerid, COLOR_WHITE, string);
- new amtearn[24];
- format(amtearn,sizeof(amtearn),"-$%d", Total);
- GameTextCostumeForPlayer(playerid,amtearn,3,2,COLOR_ERROR); //style 2, 3 seconds, $1,250 (text)!
- vfuel[id] = 100;
- new engine, lights, alarm, doors, bonnet, boot, objective;
- GetVehicleParamsEx(id, engine, lights, alarm, doors, bonnet, boot, objective);
- SetVehicleParamsEx(id, 1, lights, alarm, doors, bonnet, boot, objective);
- PayLog(PlayerName(playerid), Total, "Refueled Vehicle", "Server", "N/A");
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not at a refueling zone! (Refueling zones are at a few main airports)");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not in a vehicle !");
- return 1;
- }
- }
- if(strcmp(cmd, "/r", true) == 0 || strcmp(cmd, "/reply", true) == 0)
- {
- new giveplayerid, giveplayer[MAX_PLAYER_NAME];
- if(IsPlayerConnected(playerid))
- {
- if(LastPMER[playerid] == INVALID_PLAYER_ID)
- {
- SendClientMessage(playerid, COLOR_ERROR, "No one has recently PMed you!");
- return 1;
- }
- if(PlayerLogged[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not logged in !");
- return 1;
- }
- giveplayerid = LastPMER[playerid];
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_ERROR, "You cant PM yourself!"); return 1; }
- if(PInfo[giveplayerid][sPM] == 1 && PInfo[playerid][AdminLevel] == 0) { SendClientMessage(playerid, COLOR_ERROR, "This player has disabled private messages!"); return 1; }
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- new length = strlen(cmdtext);
- while ((idx < length) && (cmdtext[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[96];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = cmdtext[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- if(!strlen(result))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /r (text)");
- return 1;
- }
- format(string, sizeof(string), "%s(%d) PMED: %s", sendername, playerid, (result));
- SendClientMessage(giveplayerid, COLOR_RANDOMMSG, string);
- format(string, sizeof(string), "PM to %s(%d): %s", giveplayer, giveplayerid, (result));
- SendClientMessage(playerid, COLOR_RANDOMMSG, string);
- format(string, sizeof(string), "%s(%d) TO %s(%d) [%s]",sendername,playerid,giveplayer,giveplayerid, (result));
- SendHiddenMessage(string);
- LastPMER[giveplayerid] = playerid;
- return 1;
- }
- }
- else
- {
- format(string, sizeof(string), "Player %d not online.", giveplayerid);
- SendClientMessage(playerid, COLOR_ERROR, string);
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/pm", true) == 0)
- {
- new giveplayerid, giveplayer[MAX_PLAYER_NAME];
- if(IsPlayerConnected(playerid))
- {
- if(PlayerLogged[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not logged in !");
- return 1;
- }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /pm (playername/id) (text)");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_ERROR, "You cant PM yourself!"); return 1; }
- if(PInfo[giveplayerid][sPM] == 1 && PInfo[playerid][AdminLevel] == 0) { SendClientMessage(playerid, COLOR_ERROR, "This player has disabled private messages!"); return 1; }
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- new length = strlen(cmdtext);
- while ((idx < length) && (cmdtext[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[96];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = cmdtext[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- if(!strlen(result))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /pm (playername/id) (text)");
- return 1;
- }
- format(string, sizeof(string), "%s(%d) PMED: %s", sendername, playerid, (result));
- SendClientMessage(giveplayerid, COLOR_RANDOMMSG, string);
- format(string, sizeof(string), "PM to %s(%d): %s", giveplayer, giveplayerid, (result));
- SendClientMessage(playerid, COLOR_RANDOMMSG, string);
- format(string, sizeof(string), "%s(%d) TO %s(%d) [%s]",sendername,playerid,giveplayer,giveplayerid, (result));
- SendHiddenMessage(string);
- LastPMER[giveplayerid] = playerid;
- return 1;
- }
- }
- else
- {
- format(string, sizeof(string), "Player %d not online.", giveplayerid);
- SendClientMessage(playerid, COLOR_ERROR, string);
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/changepass", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(PlayerLogged[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not logged in !");
- return 1;
- }
- //new tmppass[128];
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /changepass (new password)");
- return 1;
- }
- format(string, sizeof(string), "You have changed your account password to %s.", tmp);
- PlayerNotice(playerid, string);
- SendClientMessage(playerid, COLOR_WHITE, string);
- strmid(PInfo[playerid][Password], tmp, 0, strlen(tmp), 128);
- }
- return 1;
- }
- if(strcmp(cmd, "/changeemail", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(PlayerLogged[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not logged in !");
- return 1;
- }
- SendClientMessage(playerid, COLOR_ERROR, "Linking emails in-game has been disabled.");
- return 1;
- }
- return 1;
- }
- if(strcmp(cmd, "/changecallsign", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(PlayerLogged[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_ERROR, "You are not logged in !");
- return 1;
- }
- //new tmppass[128];
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /changecallsign (new callsign)");
- return 1;
- }
- format(string, sizeof(string), "You have changed your callsign to: %s.", tmp);
- PlayerNotice(playerid, string);
- SendClientMessage(playerid, COLOR_WHITE, string);
- strmid(PInfo[playerid][Callsign], tmp, 0, strlen(tmp), 64);
- PInfo[playerid][CallsignSet] = 1;
- }
- return 1;
- }
- if(strcmp(cmd, "/l", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new length = strlen(cmdtext);
- while ((idx < length) && (cmdtext[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[96];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = cmdtext[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- if(!strlen(result))
- {
- SendClientMessage(playerid, COLOR_ERROR, "Syntax: /l [local chat]");
- return 1;
- }
- format(string, sizeof(string), "[LOCAL] %s(%d): %s", PlayerName(playerid), playerid, result);
- new Float:pX, Float:pY, Float:pZ;
- GetPlayerPos(playerid, pX, pY, pZ);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerInRangeOfPoint(i, 30.0, pX, pY, pZ))
- {
- SendClientMessage(i, COLOR_WHITE, string);
- }
- }
- SendHiddenMessage(string);
- return 1;
- }
- return 1;
- }
- if(strcmp(cmd, "/help", true) == 0 || strcmp(cmd, "/h", true) == 0)
- {
- if(PlayerLogged[playerid] == 0) { SendClientMessage(playerid, COLOR_ERROR, "You are not logged in !"); return 1; }
- new text[128];
- text = strtok(cmdtext, idx);
- if(!strlen(text)) {
- SendClientMessage(playerid, COLOR_BLUE, "* Please type /help [topic name] for specific commands and information.");
- SendClientMessage(playerid, COLOR_WHITE, "[/help Account • General • Class • Role • VIP • Chat • Vehicles • Skins • Airlines • Houses • Admin]");
- return 1;
- }
- else if(strcmp(text,"vip",true) == 0)
- {
- if(PInfo[playerid][Vip] == 0) { SendClientMessage(playerid, COLOR_ERROR, "You are not a VIP and these commands will be unavailable for you to use!"); }
- SendClientMessage(playerid, COLOR_BLUE, "[__________VIP Help__________]");
- if(PInfo[playerid][Vip] == 1) { SendClientMessage(playerid, COLOR_VIP, "The LoF team thanks you greatly for donating. We hope you enjoy the benefits."); }
- SendClientMessage(playerid, COLOR_WHITE, "[/help vip] - /v • /vipmenu");
- return 1;
- }
- else if(strcmp(text, "skins",true) == 0)
- {
- SendClientMessage(playerid, COLOR_BLUE, "[________Skins Help_______]");
- if(PInfo[playerid][OwnedSkin] > 0) { format(text,sizeof(text),"[/help skins] You currently own skin ID %d.", PInfo[playerid][OwnedSkin]); SendClientMessage(playerid, COLOR_WHITE, text); }
- SendClientMessage(playerid, COLOR_WHITE, "[/help skins] - /buyskin • /previewskin • /sellskin");
- return 1;
- }
- else if(strcmp(text,"vehicles",true) == 0)
- {
- SendClientMessage(playerid, COLOR_BLUE, "[______Vehicles Help________]");
- SendClientMessage(playerid, COLOR_WHITE, "[/help vehicles] - /myvehicles • /parkvehicle • /colourvehicle • /respawnmyvehicles • /marketplace • /repair • /refuel");
- SendClientMessage(playerid, COLOR_WHITE, "[/help vehicles] - /trunk • /hood • /headlights");
- return 1;
- }
- else if(strcmp(text,"houses",true) == 0)
- {
- SendClientMessage(playerid, COLOR_BLUE, "[_______House Help___________]");
- SendClientMessage(playerid, COLOR_WHITE, "[/help houses] - /buyhouse • /myhouses [Press ~k~~PED_SPRINT~ to enter/exit a house]");
- return 1;
- }
- else if(strcmp(text,"account",true) == 0)
- {
- SendClientMessage(playerid, COLOR_BLUE, "[________Account Help________]");
- SendClientMessage(playerid, COLOR_WHITE, "[/help account] - /changepass • /changecallsign • /changeemail");
- return 1;
- }
- else if(strcmp(text,"airlines",true) == 0)
- {
- SendClientMessage(playerid, COLOR_BLUE, "[________Airlines Help________]");
- SendClientMessage(playerid, COLOR_WHITE, "[/help airlines] - /uniform • /leaveairline • /invite • /yes • /no • /a • /myairline • /airlines • /parkfleet • /respawnfleet • /airlinespawn");
- SendClientMessage(playerid, COLOR_WHITE, "[/help airlines] - /colourfleet");
- return 1;
- }
- else if(strcmp(text,"class",true) == 0)
- {
- SendClientMessage(playerid, COLOR_BLUE, "[________Class Help________]");
- if(gTeam[playerid] == TEAM_CPILOT) { SendClientMessage(playerid, COLOR_WHITE, "{008000}[Pilot] {FFFFFF}- /respawn • /reclass • (/w)ork • /cancel"); }
- return 1;
- }
- else if(strcmp(text,"role",true) == 0)
- {
- SendClientMessage(playerid, COLOR_BLUE, "[________Role Help________]");
- if(gTeam[playerid] == TEAM_MILITARY) { SendClientMessage(playerid, COLOR_WHITE, "{B2DD5D}[Military] {FFFFFF}- /respawn • /reclass • (/w)ork • /cancel"); }
- return 1;
- }
- else if(strcmp(text,"chat",true) == 0)
- {
- SendClientMessage(playerid, COLOR_BLUE, "[________Chat Help________]");
- SendClientMessage(playerid, COLOR_WHITE, "[/help chat] - /pm • /report • /afk • /afklist • /a • @ • /me • /l");
- return 1;
- }
- else if(strcmp(text,"general",true) == 0)
- {
- SendClientMessage(playerid, COLOR_BLUE, "[________General Help________]");
- SendClientMessage(playerid, COLOR_WHITE, "[/help general] - /stats • /rules • /help • /respawn • /reclass • /admins • /credits • /kill • /forums • (/w)ork • /cancel • /settings");
- SendClientMessage(playerid, COLOR_WHITE, "[/help general] - /airlines • /givecash • /advertisement • /viplist • /donate • /at400 • /radio • /quickplay • /cancelradio • /tickets");
- return 1;
- }
- else if(strcmp(text,"admin",true) == 0)
- {
- if(PInfo[playerid][AdminLevel] == 0) { SendClientMessage(playerid, COLOR_ERROR, "You are not an administrator !"); return 1; }
- SendClientMessage(playerid, COLOR_BLUE, "[________Administrator Help________]");
- if(PInfo[playerid][AdminLevel] >= 1) { SendClientMessage(playerid, COLOR_WHITE, "[Moderator] - /ac • /ban • /kick • /warn • /mute • /spec • /cc • /check • /adminroom • /respawnvehicles • /viewban"); }
- if(PInfo[playerid][AdminLevel] >= 2) { SendClientMessage(playerid, COLOR_WHITE, "[Junior Admin] - /teletome • /teleto • /televeh • /teleintoveh • /healall • /announce • /owarn • /giveticket • /spymode"); }
- if(PInfo[playerid][AdminLevel] >= 3) { SendClientMessage(playerid, COLOR_WHITE, "[Senior Admin] - /unban • /oban • /omute • /setname • /jetpack • /namechanges"); }
- if(PInfo[playerid][AdminLevel] >= 4) { SendClientMessage(playerid, COLOR_WHITE, "[Head Admin] - /restartserver • /veh • /giveveh • /destroyvehicles • /refuelvehicles • /setmotd"); }
- if(PInfo[playerid][AdminLevel] >= 5) { SendClientMessage(playerid, COLOR_WHITE, "[Server Owner] - /addvehicle • /updatevehicle • /deletevehicle • /deleteaccount • /makeadmin • /myvehicle • /reloadairline"); }
- if(PInfo[playerid][AdminLevel] >= 5) { SendClientMessage(playerid, COLOR_WHITE, "[Server Owner] - /reloadhouse • /movehouse • /reloadhouses • /reloadvehicles • /addradiostation • /deleteradiostation • /reloadstuff"); }
- if(PInfo[playerid][AdminLevel] >= 5) { SendClientMessage(playerid, COLOR_WHITE, "[Server Owner] - /addmapicon • /deletemapicon • /killplayer"); }
- if(!strcmp(PlayerName(playerid), "Pacoz")) { SendClientMessage(playerid, COLOR_WHITE, "[Developer] - /crashplayer • /addplayervehicle • /createhouse • /deletehouse • /gimmeadmin • /deleteairline"); }
- return 1;
- }
- }
- if(strcmp(cmd, "/respawn", true) == 0)
- {
- RespawnPlayer(playerid);
- return 1;
- }
Add Comment
Please, Sign In to add comment