Where is the problem? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Where is the problem? (
/showthread.php?tid=508075)
Where is the problem? -
Dziugsas - 20.04.2014
PHP код:
public OnEmptyVehicleDamage(vehicleid,playerid,exems)
{
if(GetPlayerWeapon(playerid) >= 0)
{
if(VehicleSecurity[vehicleid] == 1)
{
ToggleAlarm(vehicleid, VEHICLE_PARAMS_ON);
SetTimerEx("StopAlarm", ALARM_TIME, false, "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?
Re: Where is the problem? -
Bingo - 20.04.2014
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.
Respuesta: Re: Where is the problem? -
Xabi - 20.04.2014
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?
Re: Where is the problem? -
xVIP3Rx - 20.04.2014
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 ?