error 029
#1

pawn Код:
C:\Users\Stefan Dorst\Desktop\Volcom Rp\gamemodes\SRP.pwn(16246) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
pawn Код:
command(flash, playerid, params[])
{
    new vehicleid,panels,doors,lights,tires;
    if(Groups[Player[playerid][Group]][CommandTypes] == 1)
    if (GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
    {
    return SendClientMessage(playerid, -1, "* You are not the driver!");
    }
    new pveh = GetPlayerVehicleID(playerid);
    if (!GetVehicleModel(pveh)) return SendClientMessage(playerid, -1, "* You are not in a vehicle!");
    if (IsValidObject(obj[pveh]) || IsValidObject(obj2[pveh])) return SendClientMessage(playerid, -1, "You switched off the lights."), DestroyObject(obj[pveh]), DestroyObject(obj2[pveh]);
    vehicleid = GetPlayerVehicleID(playerid);
    GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
    if(LightPwr[vehicleid] == 1)
    {
        UpdateVehicleDamageStatus(vehicleid, panels, doors, 0, tires);
        else// error line <<<<<<<<<<<<<<<<<<<<<<<<
        UpdateVehicleDamageStatus(vehicleid, panels, doors, 5, tires);
        Flasher[vehicleid] = 0;
    }
    switch (GetVehicleModel(pveh))
    {
    case 596:
    {
        obj[pveh] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
        obj2[pveh] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
        AttachObjectToVehicle(obj[pveh], pveh, 0.599999,-0.375000,0.899999,0.000000,0.000000,0.000000);
        AttachObjectToVehicle(obj2[pveh], pveh, -0.599999,-0.375000,0.899999,0.000000,0.000000,0.000000);
        vehicleid = GetPlayerVehicleID(playerid);
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        Flasher[vehicleid] = 1;
    }
    case 597:
    {
        obj[pveh] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
        obj2[pveh] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
        AttachObjectToVehicle(obj[pveh], pveh, 0.599999,-0.375000,0.899999,0.000000,0.000000,0.000000);
        AttachObjectToVehicle(obj2[pveh], pveh, -0.599999,-0.375000,0.899999,0.000000,0.000000,0.000000);
        vehicleid = GetPlayerVehicleID(playerid);
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        Flasher[vehicleid] = 1;
    }
    case 598:
    {
        obj[pveh] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
        obj2[pveh] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
        AttachObjectToVehicle(obj[pveh], pveh, 0.524999, -0.300000, 0.899999, 0.000000, 0.000000, 0.000000);
        AttachObjectToVehicle(obj2[pveh], pveh, -0.524999, -0.300000, 0.899999, 0.000000, 0.000000, 0.000000);
        vehicleid = GetPlayerVehicleID(playerid);
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        Flasher[vehicleid] = 1;
    }
    case 599:
    {
        obj[pveh] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
        obj2[pveh] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
        AttachObjectToVehicle(obj[pveh], pveh, 0.524999,0.000000,1.125000,0.000000,0.000000,0.000000);
        AttachObjectToVehicle(obj2[pveh], pveh, -0.524999,0.000000,1.125000,0.000000,0.000000,0.000000);
        vehicleid = GetPlayerVehicleID(playerid);
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        Flasher[vehicleid] = 1;
    }
    case 541://bullet
    {
        obj[pveh] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
        AttachObjectToVehicle(obj[pveh], pveh, 0.375000,0.524999,0.375000,0.000000,0.000000,0.000000);
        vehicleid = GetPlayerVehicleID(playerid);
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        Flasher[vehicleid] = 1;
    }
    case 426://premier
    {
        obj[pveh] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
        AttachObjectToVehicle(obj[pveh], pveh, 0.524999,0.749999,0.375000,0.000000,0.000000,0.000000);
        vehicleid = GetPlayerVehicleID(playerid);
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        Flasher[vehicleid] = 1;
    }
    case 427://enforcer
    {
        vehicleid = GetPlayerVehicleID(playerid);
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        Flasher[vehicleid] = 1;
    }
    case 560://sultan
    {
        obj[pveh] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
        AttachObjectToVehicle(obj[pveh], pveh, 0.225000,0.750000,0.449999,0.000000,0.000000,0.000000);
        vehicleid = GetPlayerVehicleID(playerid);
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        Flasher[vehicleid] = 1;
    }
    case 490://FBI
    {
        obj[pveh] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
        AttachObjectToVehicle(obj[pveh], pveh, 0.000000,1.125000,0.599999,0.000000,0.000000,0.000000);
        vehicleid = GetPlayerVehicleID(playerid);
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        Flasher[vehicleid] = 1;
    }
    default:
    {
        return SendClientMessage(playerid, -1, "You are not in a CODE 2 compatible police vehicle!");
        }
    }
    return SendClientMessage(playerid, -1, "Lights on, you are now in a CODE 2 run!");
}
Reply
#2

You need brackets and a preceding if statement.
Reply
#3

I think it should be like this :
pawn Код:
...
if(LightPwr[vehicleid] == 1)
{
    UpdateVehicleDamageStatus(vehicleid, panels, doors, 0, tires);
}
else // the error line
{
     UpdateVehicleDamageStatus(vehicleid, panels, doors, 5, tires);
     Flasher[vehicleid] = 0;
}
...
Reply
#4

pawn Код:
command(flash, playerid, params[])
{
    new vehicleid,panels,doors,lights,tires;
    if(Groups[Player[playerid][Group]][CommandTypes] == 1)
    if (GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
    {
    return SendClientMessage(playerid, -1, "* You are not the driver!");
    }
    new pveh = GetPlayerVehicleID(playerid);
    if (!GetVehicleModel(pveh)) return SendClientMessage(playerid, -1, "* You are not in a vehicle!");
    if (IsValidObject(obj[pveh]) || IsValidObject(obj2[pveh])) return SendClientMessage(playerid, -1, "You switched off the lights."), DestroyObject(obj[pveh]), DestroyObject(obj2[pveh]);
    vehicleid = GetPlayerVehicleID(playerid);
    GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
    if(LightPwr[vehicleid] == 1)
    {
        UpdateVehicleDamageStatus(vehicleid, panels, doors, 0, tires);
        else// error line <<<<<<<<<<<<<<<<<<<<<<<<
        UpdateVehicleDamageStatus(vehicleid, panels, doors, 5, tires);
        Flasher[vehicleid] = 0;
    }
    switch (GetVehicleModel(pveh))
    {
    case 596:
    {
        obj[pveh] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
        obj2[pveh] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
        AttachObjectToVehicle(obj[pveh], pveh, 0.599999,-0.375000,0.899999,0.000000,0.000000,0.000000);
        AttachObjectToVehicle(obj2[pveh], pveh, -0.599999,-0.375000,0.899999,0.000000,0.000000,0.000000);
        vehicleid = GetPlayerVehicleID(playerid);
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        Flasher[vehicleid] = 1;
    }
    case 597:
    {
        obj[pveh] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
        obj2[pveh] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
        AttachObjectToVehicle(obj[pveh], pveh, 0.599999,-0.375000,0.899999,0.000000,0.000000,0.000000);
        AttachObjectToVehicle(obj2[pveh], pveh, -0.599999,-0.375000,0.899999,0.000000,0.000000,0.000000);
        vehicleid = GetPlayerVehicleID(playerid);
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        Flasher[vehicleid] = 1;
    }
    case 598:
    {
        obj[pveh] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
        obj2[pveh] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
        AttachObjectToVehicle(obj[pveh], pveh, 0.524999, -0.300000, 0.899999, 0.000000, 0.000000, 0.000000);
        AttachObjectToVehicle(obj2[pveh], pveh, -0.524999, -0.300000, 0.899999, 0.000000, 0.000000, 0.000000);
        vehicleid = GetPlayerVehicleID(playerid);
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        Flasher[vehicleid] = 1;
    }
    case 599:
    {
        obj[pveh] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
        obj2[pveh] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
        AttachObjectToVehicle(obj[pveh], pveh, 0.524999,0.000000,1.125000,0.000000,0.000000,0.000000);
        AttachObjectToVehicle(obj2[pveh], pveh, -0.524999,0.000000,1.125000,0.000000,0.000000,0.000000);
        vehicleid = GetPlayerVehicleID(playerid);
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        Flasher[vehicleid] = 1;
    }
    case 541://bullet
    {
        obj[pveh] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
        AttachObjectToVehicle(obj[pveh], pveh, 0.375000,0.524999,0.375000,0.000000,0.000000,0.000000);
        vehicleid = GetPlayerVehicleID(playerid);
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        Flasher[vehicleid] = 1;
    }
    case 426://premier
    {
        obj[pveh] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
        AttachObjectToVehicle(obj[pveh], pveh, 0.524999,0.749999,0.375000,0.000000,0.000000,0.000000);
        vehicleid = GetPlayerVehicleID(playerid);
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        Flasher[vehicleid] = 1;
    }
    case 427://enforcer
    {
        vehicleid = GetPlayerVehicleID(playerid);
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        Flasher[vehicleid] = 1;
    }
    case 560://sultan
    {
        obj[pveh] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
        AttachObjectToVehicle(obj[pveh], pveh, 0.225000,0.750000,0.449999,0.000000,0.000000,0.000000);
        vehicleid = GetPlayerVehicleID(playerid);
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        Flasher[vehicleid] = 1;
    }
    case 490://FBI
    {
        obj[pveh] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
        AttachObjectToVehicle(obj[pveh], pveh, 0.000000,1.125000,0.599999,0.000000,0.000000,0.000000);
        vehicleid = GetPlayerVehicleID(playerid);
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        Flasher[vehicleid] = 1;
    }
    default:
    {
        return SendClientMessage(playerid, -1, "You are not in a CODE 2 compatible police vehicle!"); // You added an Un-needed Bracket, I deleted it now.
    }
    return SendClientMessage(playerid, -1, "Lights on, you are now in a CODE 2 run!");
}
Reply
#5

Doesnt work...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)