18.10.2010, 16:48
Okay so the thing is i mapped a dealership for planes/helis
and added some buyable Planes and Helicopters
but you can hotwire the dealership vehicles :/..
if(!strcmp(cmd, "/hotwire", true)) { if(engineOn[GetPlayerVehicleID(playerid)]) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Engine already started!"); if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Your key Please"); if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Only the driver can do this!"); if(IsAtDealership(playerid)) return SendClientMessage(playerid, COLOR_DARKRED, "You can't hotwire this vehicle!"); if(pveh == 510) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "You don't need to start a bike!"); if(pveh == 462) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "You don't need to start a bike!"); if(idcar == 59 || idcar == 60) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Access denied!"); if(IsAtCarrental(playerid)) return SendClientMessage(playerid, COLOR_DARKRED, "You can't hotwire this vehicle!"); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "* %s tries to hotwire the car", sendername); ProxDetector(30.0, playerid, string, COLOR_LIGHT_BLUE,COLOR_LIGHT_BLUE,COLOR_LIGHT_BLUE,COLOR_PURPLE,COLOR_PURPLE); SetTimerEx("StartingTheVehicle",7000,0,"i",playerid); GameTextForPlayer(playerid, "~w~Hotwiring The Vehicle...",3500,3); gEngine[playerid] = 1; return 1;
public IsAtDealership(playerid) { if(IsPlayerConnected(playerid)) { if(PlayerToPoint(25.0,playerid,2128.0864,-1135.3912,25.5855) || PlayerToPoint(50,playerid,537.3366,-1293.2140,17.2422) || PlayerToPoint(35,playerid,2521.5544,-1524.4504,23.8365) || PlayerToPoint(50,playerid,2155.0146,-1177.3333,23.8211) || PlayerToPoint(50,playerid,299.1723,-1518.6627,24.6007)) { return 1; }
Код:
public IsAtDealership(playerid) { if(IsPlayerConnected(playerid)) { if(PlayerToPoint(25.0,playerid,2128.0864,-1135.3912,25.5855) || PlayerToPoint(50,playerid,537.3366,-1293.2140,17.2422) || PlayerToPoint(35,playerid,2521.5544,-1524.4504,23.8365) || PlayerToPoint(50,playerid,2155.0146,-1177.3333,23.8211) || PlayerToPoint(50,playerid,299.1723,-1518.6627,24.6007)) { return 1; } |
if(!strcmp(cmd, "/hotwire", true)) { if(engineOn[GetPlayerVehicleID(playerid)]) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Engine already started!"); if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Your key Please"); if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Only the driver can do this!"); //if(IsAtDealership(playerid)) return SendClientMessage(playerid, COLOR_DARKRED, "You can't hotwire this vehicle!"); if(pveh == 510) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "You don't need to start a bike!"); if(pveh == 462) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "You don't need to start a bike!"); if(idcar == 59 || idcar == 60) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Access denied!"); if(IsAtCarrental(playerid)) return SendClientMessage(playerid, COLOR_DARKRED, "You can't hotwire this vehicle!"); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "* %s tries to hotwire the car", sendername); ProxDetector(30.0, playerid, string, COLOR_LIGHT_BLUE,COLOR_LIGHT_BLUE,COLOR_LIGHT_BLUE,COLOR_PURPLE,COLOR_PURPLE); SetTimerEx("StartingTheVehicle",7000,0,"i",playerid); GameTextForPlayer(playerid, "~w~Hotwiring The Vehicle...",3500,3); gEngine[playerid] = 1; return 1;
Should work now. |