21.06.2010, 03:37
Be honest, you counted a million key presses?
Quote:
Originally Posted by Kar
hey i made this and when you enter one of the buses you can do press 2 a million times and the bus driver mission will start? i dont want that. and when i get to the second checkpoint nothing happens D: (o and when i entervehicle its surpose to say the gametext but it doesn't>?)
Код:
#include <a_samp> #define COLOR_DARKGOLD 0x808000AA #define COLOR_RED 0xFF0000AA #define COLOR_YELLOW 0xFFFF00AA #define YELLOW 0xFFFF00AA #define LIME 0x00FF00FF #define PRESSED(%0) \ (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) #define HOLDING(%0) \ ((newkeys & (%0)) == (%0)) #define RELEASED(%0) \ (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0))) #define buspoint1 -1998.7400,174.6382,27.6473 #define buspoint2 -1805.8813,600.1848,34.8620 #define buspoint3 -1601.1205,726.2743,11.1720 #define buspoint4 -1612.7714,857.1121,7.6761 #define buspoint5 -1766.0300,935.1175,24.8755 #define buspoint6 -1904.0560,811.3516,36.1556 #define buspoint7 -2648.9529,570.7150,14.5943 #define buspoint8 -2614.7012,215.6137,5.2519 #define buspoint9 -2150.6584,148.2724,35.3053 #define buspoint10 -2061.5159,-74.0719,34.8552 new bus1; new bus2; new bus3; new busdriver = 0; public OnFilterScriptInit() { bus1 = AddStaticVehicle(431,-1988.7975,192.1375,27.6358,359.7323,75,59); // bus1 bus2 = AddStaticVehicle(431,-1988.8607,178.5440,27.6378,359.7324,75,59); // bus2 bus3 = AddStaticVehicle(431,-1988.9200,165.7481,27.6426,359.7370,75,59); // bus3 } public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/start", cmdtext, true, 10) == 0) { new veh = GetPlayerVehicleID(playerid); if(veh == bus3 || veh == bus2 || veh == bus1) { busdriver = 1; SetPlayerCheckpoint(playerid, buspoint1, 3.0); GameTextForPlayer(playerid, "~g~Bus Driver Started!", 3000, 3); new name[MAX_PLAYER_NAME], string[48]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "%s Is Now A Bus Driver!.", name ); SendClientMessageToAll(COLOR_RED, string); return 1; } SendClientMessage(playerid, COLOR_RED,"You have to be in a busdriver van to start the job"); } if (strcmp("/busdriverinfo", cmdtext, true, 10) == 0) { SendClientMessage(playerid, COLOR_YELLOW, "."); SendClientMessage(playerid, COLOR_YELLOW, "."); SendClientMessage(playerid, COLOR_YELLOW, "."); SendClientMessage(playerid, COLOR_YELLOW, "!"); return 1; } return 0; } public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if (PRESSED(KEY_SUBMISSION)) { new veh = GetPlayerVehicleID(playerid); if(veh == bus3 || veh == bus2 || veh == bus1) { busdriver = 1; SetPlayerCheckpoint(playerid, buspoint1, 3.0); GameTextForPlayer(playerid, "~g~Bus Driver Started!", 3000, 3); new name[MAX_PLAYER_NAME], string[48]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "%s Is Now A Bus Driver!.", name ); SendClientMessageToAll(LIME, string); return 1; } SendClientMessage(playerid, COLOR_RED,"You Have To Be In A Bus To Start The Mission!"); } return 0; } public OnPlayerEnterCheckpoint(playerid) { new veh = GetPlayerVehicleID(playerid); if(veh == bus3 || veh == bus2 || veh == bus1) { if (IsPlayerInRangeOfPoint(playerid, 10.0,buspoint1)) { SetPlayerCheckpoint(playerid, buspoint2, 10.0); SendClientMessage(playerid, LIME,"Arrived At The San Fierro Train Station, Received 500$"); GivePlayerMoney(playerid, 500); } if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint2)) { SetPlayerCheckpoint(playerid, buspoint3, 10.0); SendClientMessage(playerid, LIME,"Arrived At The Cluckin Bell, Received 500$"); GivePlayerMoney(playerid, 500); } if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint3)) { SetPlayerCheckpoint(playerid, buspoint4, 10.0); SendClientMessage(playerid, LIME,"Arrived At The Police Station, Received 500$"); GivePlayerMoney(playerid, 500); } if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint4)) { SetPlayerCheckpoint(playerid, buspoint5, 10.0); SendClientMessage(playerid, LIME,"Arrived At The San Fierro Bank, Received 500$"); GivePlayerMoney(playerid, 500); } if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint5)) { SetPlayerCheckpoint(playerid, buspoint6, 10.0); SendClientMessage(playerid, LIME,"Arrived At The Burger Shot, Received 500$"); GivePlayerMoney(playerid, 500); } if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint6)) { SetPlayerCheckpoint(playerid, buspoint7, 10.0); SendClientMessage(playerid, LIME,"Arrived At Ammunation, Received 500$"); GivePlayerMoney(playerid, 500); } if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint7)) { SetPlayerCheckpoint(playerid, buspoint8, 10.0); SendClientMessage(playerid, LIME,"Arrived At The , Received 500$"); GivePlayerMoney(playerid, 500); } if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint8)) { SetPlayerCheckpoint(playerid, buspoint9, 10.0); SendClientMessage(playerid, LIME,"Arrived At , Received 500$"); GivePlayerMoney(playerid, 500); } if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint9)) { SetPlayerCheckpoint(playerid, buspoint10, 10.0); SendClientMessage(playerid, LIME,"Arrived At The Don's RubberShop, Received 500$"); GivePlayerMoney(playerid, 500); } if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint10)) { SendClientMessage(playerid, LIME,"Type /Start Again To Start The BusDriver Mission!"); GivePlayerMoney(playerid, 500); DisablePlayerCheckpoint(playerid); busdriver = 0; } } } public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { new veh = GetPlayerVehicleID(playerid); if(veh == bus3 || veh == bus2 || veh == bus1) { SendClientMessage(playerid, YELLOW, "START THE BUS MISSION BY PRESSING 2"); GameTextForPlayer(playerid, "~y~START THE BUS DRIVER MISSION BY~n~~b~PRESSING 2!",3000,3); } return 0; } public OnPlayerExitVehicle(playerid, vehicleid) { if((busdriver) == 1) { busdriver= 0; SendClientMessage(playerid, COLOR_RED, "You left your Busbehind, get in again if you want to continue your job."); }else if((busdriver) == 0){ //Nothing } } public OnPlayerDeath(playerid, killerid, reason) { DisablePlayerCheckpoint(playerid); busdriver = 0; return 1; } |