19.11.2012, 08:16
(
Последний раз редактировалось Kethrios; 19.11.2012 в 22:19.
)
Hello guys,
Since days I'm looking for a way to get some sirens on undercover cop cars.
When I saw that in fact I already had one in my script, the command is /gyro. But the siren does not appear, not even for a second.
Can you guys help me finding out what the problem is here ? It is suppose to work like a charm ^^
Here is my code :
Since days I'm looking for a way to get some sirens on undercover cop cars.
When I saw that in fact I already had one in my script, the command is /gyro. But the siren does not appear, not even for a second.
Can you guys help me finding out what the problem is here ? It is suppose to work like a charm ^^
Here is my code :
pawn Код:
else if(strcmp(subcmd, "gyrophare", true) == 0 || strcmp(subcmd, "gyro", true) == 0)
{
new vehicleid = GetPlayerVehicleID(playerid);
new model = GetVehicleModel(vehicleid);
if(PlayerInfo[playerid][pRank] < 4)
{SendClientMessage(playerid, COLOR_COPS, "{FF6600}[Police]{11BB00} Il vous faut le rang 4 minimum pour cette commande."); return 1;}
if(!OnDuty[playerid])
{SendClientMessage(playerid, COLOR_COPS, "{FF6600}[Police]{11BB00} Vous devez кtre en service."); return 1;}
if(!IsPlayerInAnyVehicle(playerid) || (model != 405 && model != 475 && model != 540 && model != 506 && model != 589 && model != 560 && model != 431 && model != 413 && model != 459 && model != 602 && model != 415 && model != 507 && model != 451 && model != 525))
{SendClientMessage(playerid, COLOR_COPS, "{FF6600}[Police]{11BB00} Ces vйhicules ne sont pas compatibles."); return 1;}
if(car_sirene[vehicleid] == 0 && car_sirene2[vehicleid] == 0)
{
format(proxy_msg, sizeof(proxy_msg), "%s active le gyrophare de son vйhicule.", playername);
car_sirene[vehicleid] = CreateDynamicObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
car_sirene2[vehicleid] = CreateDynamicObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
if(model == 405) AttachObjectToVehicle(car_sirene[vehicleid], vehicleid, -0.300000, -0.100000, 0.790000, 0.000000, 0.000000, 0.000000);
else if(model == 475 || model == 540) AttachObjectToVehicle(car_sirene[vehicleid], vehicleid, -0.375000, -0.225000, 0.764999, 0.000000, 0.000000, 0.000000);
else if(model == 506) AttachObjectToVehicle(car_sirene[vehicleid], vehicleid, -0.400000, -0.500000, 0.620000, 0.000000, 0.000000, 0.000000);
else if(model == 589) AttachObjectToVehicle(car_sirene[vehicleid], vehicleid, -0.400000, -0.300000, 1.120000, 0.000000, 0.000000, 0.000000);
else if(model == 560) AttachObjectToVehicle(car_sirene[vehicleid], vehicleid, 0.300000, 0.824999,0.375000, -0.000005, 0.000000, 0.000000);
else if(model == 413) AttachObjectToVehicle(car_sirene[vehicleid], vehicleid, 0.000000, 1.605000, 0.485000, 0.000000, 0.000000, 0.000000);
else if(model == 459) AttachObjectToVehicle(car_sirene[vehicleid], vehicleid, 0.000000, 1.500000, 0.495000, 0.000000, 0.000000, 0.000000);
else if(model == 602) AttachObjectToVehicle(car_sirene[vehicleid], vehicleid, -0.509999, -0.225000, 0.749999, 0.000000, 0.000000, 0.000000);
else if(model == 415) AttachObjectToVehicle(car_sirene[vehicleid], vehicleid, 0.020000, 0.654999, 0.185000, 0.000000, 0.000000, 0.000000);
else if(model == 507) AttachObjectToVehicle(car_sirene[vehicleid], vehicleid, 0.300000, 0.804999, 0.365000, 0.000000, 0.000000, 0.000000);
else if(model == 451) AttachObjectToVehicle(car_sirene[vehicleid], vehicleid, 0.449999, 0.524999, 0.164999, 0.000000, 0.000000, 0.000000);
else if(model == 431)
{
AttachObjectToVehicle(car_sirene[vehicleid], vehicleid, 0.000000, -3.975001, 2.300000, 0.000000, 0.000000, 0.000000);
AttachObjectToVehicle(car_sirene2[vehicleid], vehicleid, -0.010000, 3.975001, 2.240000, 0.000000, 0.000000, 0.000000);
}
else if(model == 525)
{
AttachObjectToVehicle(car_sirene[vehicleid], vehicleid, 0.599999, -0.469999, 1.435000, 0.000000, 0.000000, 0.000000);
AttachObjectToVehicle(car_sirene2[vehicleid], vehicleid, -0.599999,-0.469999,1.400000,0.000000,0.000000,0.000000);
}
SendClientMessage(playerid, COLOR_COPS, "{FF6600}[Police]{11BB00} Vous avez mit la sirene civil.");
}
else
{
format(proxy_msg, sizeof(proxy_msg), "%s йteint le gyrophare de son vйhicule.", playername);
DestroyObject(car_sirene[vehicleid]);
car_sirene[vehicleid] = 0;
DestroyObject(car_sirene2[vehicleid]);
car_sirene2[vehicleid] = 0;
SendClientMessage(playerid, COLOR_COPS, "{FF6600}[Police]{11BB00} Vous enlevez le gyrophare de votre vйhicule.");
}
proxy_sendMsg(playerid, proxy_msg);
return 1;
}