Where is the problem?
#1

PHP код:
public OnEmptyVehicleDamage(vehicleid,playerid,exems)
{
    if(
GetPlayerWeapon(playerid) >= 0)
    {
           if(
VehicleSecurity[vehicleid] == 1)
        {
            
ToggleAlarm(vehicleidVEHICLE_PARAMS_ON);
            
SetTimerEx("StopAlarm"ALARM_TIMEfalse"d"vehicleid);
        }
    }
    return 
1;

OnEmptyVehicleDamage only works if i punch the car ,but when i hit it with weapon alarm does not start.
Where is the problem?
Reply
#2

pawn Код:
public OnEmptyVehicleDamage(vehicleid,playerid,exems)
{
    if(GetPlayerWeapon(playerid) >= 0&& VehicleSecurity[vehicleid] == 1)
        {
            ToggleAlarm(vehicleid, VEHICLE_PARAMS_ON);
            SetTimerEx("StopAlarm", ALARM_TIME, false, "d", vehicleid);
        }
    }
    return 1;
}
Correct me if i am wrong.
Edit:- ) removed.
Reply
#3

Quote:
Originally Posted by Bingo
Посмотреть сообщение
pawn Код:
public OnEmptyVehicleDamage(vehicleid,playerid,exems)
{
    if(GetPlayerWeapon(playerid) >= 0) && VehicleSecurity[vehicleid] == 1)
        {
            ToggleAlarm(vehicleid, VEHICLE_PARAMS_ON);
            SetTimerEx("StopAlarm", ALARM_TIME, false, "d", vehicleid);
        }
    }
    return 1;
}
Correct me if i am wrong.
That's the same code, and still, you have an extra ) after GetPlayerWeapon(playerid) >= 0.

About the callback, how is it defined? Maybe is a callback issue that only detects an attack with fists?
Reply
#4

pawn Код:
public OnEmptyVehicleDamage(vehicleid,playerid,exems)
{
    if(GetPlayerWeapon(playerid) >= 0 && VehicleSecurity[vehicleid] == 1)
    {
        ToggleAlarm(vehicleid, VEHICLE_PARAMS_ON);
        SetTimerEx("StopAlarm", ALARM_TIME, false, "d", vehicleid);
    }
    return 1;
}
The problem isn't on that script, It's when it's called.. Do you use that include ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)