30.03.2014, 12:50
Hi there, so i got little problem with my filterscript after puting it into GM is not working fully, it is doing everything right, but is not creating the flashing object as i should to.
CODE
CODE
PHP код:
CMD:flash(playerid, params[])
{
new vehicleid,panels2,doors2,lights2,tires2;
vehicleid = GetPlayerVehicleID(playerid);
if(PlayerLogged[playerid] == 0) return 1;
if(!IsACop(playerid)) return SendClientMessage(playerid, COLOR_GREY, YouCanNot);
if(!Flasher[vehicleid])
{
if (GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
{
return SendClientMessage(playerid, COLOR_GREY, "**Tu neesi vaditajs**");
}
if (!GetVehicleModel(vehicleid)) return SendClientMessage(playerid, COLOR_GREY, "** Tu neesi automasina **");
if (IsValidObject(obj[vehicleid]) || IsValidObject(obj2[vehicleid]))
{
SendClientMessage(playerid, COLOR_GREY, "Tu izsledzi bakugunis."), DestroyObject(obj[vehicleid]), DestroyObject(obj2[vehicleid]);
GetVehicleDamageStatus(vehicleid,panels2,doors2,lights2,tires2);
if(LightPwr[vehicleid] == 1)
UpdateVehicleDamageStatus(vehicleid, panels2, doors2, 0, tires2);
else
UpdateVehicleDamageStatus(vehicleid, panels2, doors2, 5, tires2);
Flasher[vehicleid] = 0;
}
switch (GetVehicleModel(vehicleid))
{
case 596:
{
obj[vehicleid] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
obj2[vehicleid] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AttachObjectToVehicle(obj[vehicleid], vehicleid, 0.599999,-0.375000,0.899999,0.000000,0.000000,0.000000);
AttachObjectToVehicle(obj2[vehicleid], vehicleid, -0.599999,-0.375000,0.899999,0.000000,0.000000,0.000000);
GetVehicleDamageStatus(vehicleid,panels2,doors2,lights2,tires2);
Flasher[vehicleid] = 1;
}
case 597:
{
obj[vehicleid] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
obj2[vehicleid] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AttachObjectToVehicle(obj[vehicleid], vehicleid, 0.599999,-0.375000,0.899999,0.000000,0.000000,0.000000);
AttachObjectToVehicle(obj2[vehicleid], vehicleid, -0.599999,-0.375000,0.899999,0.000000,0.000000,0.000000);
GetVehicleDamageStatus(vehicleid,panels2,doors2,lights2,tires2);
Flasher[vehicleid] = 1;
}
case 598:
{
obj[vehicleid] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
obj2[vehicleid] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AttachObjectToVehicle(obj[vehicleid], vehicleid, 0.524999, -0.300000, 0.899999, 0.000000, 0.000000, 0.000000);
AttachObjectToVehicle(obj2[vehicleid], vehicleid, -0.524999, -0.300000, 0.899999, 0.000000, 0.000000, 0.000000);
GetVehicleDamageStatus(vehicleid,panels2,doors2,lights2,tires2);
Flasher[vehicleid] = 1;
}
case 599:
{
obj[vehicleid] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
obj2[vehicleid] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AttachObjectToVehicle(obj[vehicleid], vehicleid, 0.524999,0.000000,1.125000,0.000000,0.000000,0.000000);
AttachObjectToVehicle(obj2[vehicleid], vehicleid, -0.524999,0.000000,1.125000,0.000000,0.000000,0.000000);
GetVehicleDamageStatus(vehicleid,panels2,doors2,lights2,tires2);
Flasher[vehicleid] = 1;
}
case 541://bullet
{
obj[vehicleid] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AttachObjectToVehicle(obj[vehicleid], vehicleid, 0.375000,0.524999,0.375000,0.000000,0.000000,0.000000);
GetVehicleDamageStatus(vehicleid,panels2,doors2,lights2,tires2);
Flasher[vehicleid] = 1;
}
case 426://premier
{
obj[vehicleid] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AttachObjectToVehicle(obj[vehicleid], vehicleid, 0.524999,0.749999,0.375000,0.000000,0.000000,0.000000);
GetVehicleDamageStatus(vehicleid,panels2,doors2,lights2,tires2);
Flasher[vehicleid] = 1;
}
case 427://enforcer
{
GetVehicleDamageStatus(vehicleid,panels2,doors2,lights2,tires2);
Flasher[vehicleid] = 1;
}
case 416://Ambulance
{
GetVehicleDamageStatus(vehicleid,panels2,doors2,lights2,tires2);
Flasher[vehicleid] = 1;
}
case 407://FireTruck
{
GetVehicleDamageStatus(vehicleid,panels2,doors2,lights2,tires2);
Flasher[vehicleid] = 1;
}
case 560://sultan
{
obj[vehicleid] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AttachObjectToVehicle(obj[vehicleid], vehicleid, 0.225000,0.750000,0.449999,0.000000,0.000000,0.000000);
GetVehicleDamageStatus(vehicleid,panels2,doors2,lights2,tires2);
Flasher[vehicleid] = 1;
}
case 490://FBI
{
obj[vehicleid] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AttachObjectToVehicle(obj[vehicleid], vehicleid, 0.000000,1.125000,0.599999,0.000000,0.000000,0.000000);
GetVehicleDamageStatus(vehicleid,panels2,doors2,lights2,tires2);
Flasher[vehicleid] = 1;
}
}
return SendClientMessage(playerid, -1, "Bakugunis ieslegtas");
}
else
{
if (IsValidObject(obj[vehicleid]) || IsValidObject(obj2[vehicleid])) {
SendClientMessage(playerid, -1, "Tu izsledzi bakugunis"), DestroyObject(obj[vehicleid]), DestroyObject(obj2[vehicleid]);
}
GetVehicleDamageStatus(vehicleid,panels2,doors2,lights2,tires2);
if(LightPwr[vehicleid] == 1)
UpdateVehicleDamageStatus(vehicleid, panels2, doors2, 0, tires2);
else
UpdateVehicleDamageStatus(vehicleid, panels2, doors2, 5, tires2);
Flasher[vehicleid] = 0;
}
return 1;
}