siren
#1

pawn Код:
if(strcmp(cmd, "/siren", true, 10) == 0)
    {
            if(IsPlayerInAnyVehicle(playerid))
        {
        new vehicleid = GetPlayerVehicleID(playerid);
        if(Lamp[vehicleid] == 1) return OnPlayerCommandText(playerid, "/sirenoff");
        if(IsPlayerConnected(playerid))
        {
            new Float:x, Float:y, Float:z, Float:angle;
            if(IsPlayerInVehicle(playerid, 579))
            {
                GetPlayerPos(playerid, x, y, z);
                GetPlayerFacingAngle(playerid, angle);
                IsSpu[vehicleid] = 1;
                Lamp[vehicleid] = 1;
                light[vehicleid] = CreateObject(19419, 10.0, 10.0, 10.0, 0.0, 0.0, 0.0);
                AttachObjectToVehicle(light[vehicleid], GetPlayerVehicleID(playerid), 0.000000, 0.074999, 1.214999, 0.000000, 0.000000, 0.000000);
            }
            else if(IsPlayerInVehicle(playerid, 426))
            {
                GetPlayerPos(playerid, x, y, z);
                GetPlayerFacingAngle(playerid, angle);
                IsSpu[vehicleid] = 1;
                Lamp[vehicleid] = 1;
                light[vehicleid] = CreateObject(19419, 10.0, 10.0, 10.0, 0.0, 0.0, 0.0);
                AttachObjectToVehicle(light[vehicleid], GetPlayerVehicleID(playerid), 0.000000, -1.664998, 0.329999, 0.000000, 0.000000, 0.000000);
            }
            else if(IsPlayerInVehicle(playerid, 402))
            {
                GetPlayerPos(playerid, x, y, z);
                GetPlayerFacingAngle(playerid, angle);
                IsSpu[vehicleid] = 1;
                Lamp[vehicleid] = 1;
                light[vehicleid] = CreateObject(19419, 10.0, 10.0, 10.0, 0.0, 0.0, 0.0);
                AttachObjectToVehicle(light[vehicleid], vehicleid, -0.599999, -0.329999, 0.829999, 0.000000, 0.000000, 0.000000);
            }
            else if(IsPlayerInVehicle(playerid, 482))
            {
                GetPlayerPos(playerid, x, y, z);
                GetPlayerFacingAngle(playerid, angle);
                IsSpu[vehicleid] = 1;
                Lamp[vehicleid] = 1;
                light[vehicleid] = CreateObject(18646, 10.0, 10.0, 10.0, 0.0, 0.0, 0.0);
                AttachObjectToVehicle(light[vehicleid], vehicleid, -0.489999, 0.734999, 0.969999, 0.000000, 0.000000, 0.000000);
            }
            else if(IsPlayerInVehicle(playerid, 523))
            {
                GetPlayerPos(playerid, x, y, z);
                GetPlayerFacingAngle(playerid, angle);
                IsSpu[vehicleid] = 1;
                Lamp[vehicleid] = 1;
                light[vehicleid] = CreateObject(18646, 10.0, 10.0, 10.0, 0.0, 0.0, 0.0);
                AttachObjectToVehicle(light[vehicleid], vehicleid, 0.000000, -0.959999, 0.689999, 0.000000, 0.000000, 0.000000);
            }
            else if(IsPlayerInVehicle(playerid, 528))
            {
                GetPlayerPos(playerid, x, y, z);
                GetPlayerFacingAngle(playerid, angle);
                IsSpu[vehicleid] = 1;
                Lamp[vehicleid] = 1;
                light[vehicleid] = CreateObject(19419, 10.0, 10.0, 10.0, 0.0, 0.0, 0.0);
                AttachObjectToVehicle(light[vehicleid], vehicleid, 0.000000, 0.314999, 1.059999, 0.000000, 0.000000, 0.000000);
            }
            else if(IsPlayerInVehicle(playerid, 421))
            {
                GetPlayerPos(playerid, x, y, z);
                GetPlayerFacingAngle(playerid, angle);
                IsSpu[vehicleid] = 1;
                Lamp[vehicleid] = 1;
                light[vehicleid] = CreateObject(18646, 10.0, 10.0, 10.0, 0.0, 0.0, 0.0);
                AttachObjectToVehicle(light[vehicleid], vehicleid, -0.379999, 0.159999, 0.759999, 0.000000, 0.000000, 0.000000);
            }
            else if(IsPlayerInVehicle(playerid, 415))
            {
                GetPlayerPos(playerid, x, y, z);
                GetPlayerFacingAngle(playerid, angle);
                IsSpu[vehicleid] = 1;
                Lamp[vehicleid] = 1;
                light[vehicleid] = CreateObject(18646, 10.0, 10.0, 10.0, 0.0, 0.0, 0.0);
                AttachObjectToVehicle(light[vehicleid], vehicleid, -0.379999, -0.414999, 0.664999, 0.000000, 0.000000, 0.000000);
                print("WORKS!");
            }
            else if(IsPlayerInVehicle(playerid, 541))
            {
                GetPlayerPos(playerid, x, y, z);
                GetPlayerFacingAngle(playerid, angle);
                IsSpu[vehicleid] = 1;
                Lamp[vehicleid] = 1;
                light[vehicleid] = CreateObject(18646, 10.0, 10.0, 10.0, 0.0, 0.0, 0.0);
                AttachObjectToVehicle(light[vehicleid], vehicleid, -0.454999, 0.064999, 0.694999, 0.000000, 0.000000, 0.000000);
            }
        return 1;
        }
        }
        return 1;
    }
what's wrong with this code? It doesn't create a siren.
Reply


Messages In This Thread
siren - by barbarbar1 - 13.03.2013, 10:14
Re: siren - by LarzI - 13.03.2013, 10:25
Re: siren - by barbarbar1 - 13.03.2013, 10:37
Re: siren - by LarzI - 13.03.2013, 10:44
Re: siren - by barbarbar1 - 13.03.2013, 10:55

Forum Jump:


Users browsing this thread: 1 Guest(s)