25.01.2011, 10:48
(
Последний раз редактировалось BizzyD; 26.01.2011 в 08:50.
)
SOLVED!
pawn Код:
CODE DELETED!
CODE DELETED!
SOLVED - DELETE PLZ
this is my new code:
pawn Код:
and it still dosent work. |
if(strcmp(cmd, "/engine", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
return 1;
}
if(engineon[playerid] == 0)
{
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID) {
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "*%s turns the ignition and starts the vehicle.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
SendClientMessage(playerid, COLOR_YELLOW, " Your vehicle started succesfully!");
engineon[playerid] = 1;
return 1;
}
else if (engineoff[playerid] == 1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "*%s turns the ignition and turns off the vehicle", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
if(vid != INVALID_VEHICLE_ID) {
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
engineon[playerid] = 0;
}
}
}
}
}
}
if(strcmp(cmd, "/engine", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
return 1;
}
if(engineon[playerid] == 0)
{
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID) {
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "*%s turns the ignition and starts the vehicle.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
SendClientMessage(playerid, COLOR_YELLOW, " Your vehicle started succesfully!");
engineon[playerid] = 1;
return 1;
}
else if (engineoff[playerid] == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "*%s turns the ignition and turns off the vehicle", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
if(vid != INVALID_VEHICLE_ID) {
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
engineon[playerid] = 0;
}
}
}
}
}
}
if(strcmp(cmd, "/engine", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
return 1;
}
if(engineon[playerid] == 0)
{
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID) {
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "*%s turns the ignition and starts the vehicle.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
SendClientMessage(playerid, COLOR_YELLOW, " Your vehicle started succesfully!");
engineon[playerid] = 1;
return 1;
}
else if (engineon[playerid] == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "*%s turns the ignition and turns off the vehicle", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
if(vid != INVALID_VEHICLE_ID) {
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
engineon[playerid] = 0;
}
}
}
}
}
}
if(!strcmp(cmd, "/engine", true))
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(!engineOn[GetPlayerVehicleID(playerid)])
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
return 1;
}
if(IsAnOwnableCar(idcar))
{
if(PlayerInfo[playerid][pPcarkey] == idcar) { }
else if(PlayerInfo[playerid][pPcarkey2] == idcar) { }
else if(PlayerInfo[playerid][pPcarkey3] == idcar) { }
else { return 1; }
}
if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509)
{
return 1;
}
if(idcar == 59 || idcar == 60)
{
return 1;
}
if(idcar >= 135 && idcar <= 154)
{
if(HireCar[playerid] != idcar)
{
return 1;
}
}
if(IsAPlane(idcar))
{
return 1;
}
if(IsAHarvest(idcar))
{
return 1;
}
if(IsADrugHarvest(idcar))
{
return 1;
}
if(IsASweeper(idcar))
{
return 1;
}
if(gEngine[playerid] == 1) { return 1; }
new playerveh = GetPlayerVehicleID(playerid);
PutPlayerInVehicle(playerid, playerveh, 0);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s spins a key and tries to start vehicle engine.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetTimerEx("StartingTheVehicle",3500,0,"i",playerid);
GameTextForPlayer(playerid, "~w~Starting vehicle engine...",3500,3);
gEngine[playerid] = 1;
return 1;
}
if(engineOn[GetPlayerVehicleID(playerid)])
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
return 1;
}
if(IsAnOwnableCar(idcar))
{
if(PlayerInfo[playerid][pPcarkey] == idcar) { }
else if(PlayerInfo[playerid][pPcarkey2] == idcar) { }
else if(PlayerInfo[playerid][pPcarkey3] == idcar) { }
else { return 1; }
}
if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509)
{
return 1;
}
if(idcar == 59 || idcar == 60)
{
return 1;
}
if(idcar >= 135 && idcar <= 154)
{
if(HireCar[playerid] != idcar)
{
return 1;
}
}
if(IsAHarvest(idcar))
{
return 1;
}
if(IsADrugHarvest(idcar))
{
return 1;
}
if(IsAPlane(idcar))
{
return 1;
}
if(IsASweeper(idcar))
{
return 1;
}
engineOn[GetPlayerVehicleID(playerid)] = false;
//RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 0);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s spins the vehicle key and turns off the engine.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
gEngine[playerid] = 0;
return 1;
}
}
}
return 1;
}
pawn Код:
|