Seatbelt & player hit - 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: Seatbelt & player hit (
/showthread.php?tid=353673)
Seatbelt & player hit -
PaulDinam - 24.06.2012
I'm working on a RP mode.
When the player is without a seatbelt his hp got lower when he hits something.
How do i disable this?
Re: Seatbelt & player hit -
PaulDinam - 24.06.2012
Help please!
Re: Seatbelt & player hit -
JaKe Elite - 24.06.2012
Stop bumping your thread after short minutes.
Re: Seatbelt & player hit -
[KHK]Khalid - 24.06.2012
abide to the
Forum Rules. I don't see how could we help you without any codes!
Re: Seatbelt & player hit -
PaulDinam - 24.06.2012
Код:
if(strcmp(cmd,"/seatbelt",true)==0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
new carid = GetPlayerVehicleID(playerid);
if(IsABike(carid) || IsAPizzabike(carid) || IsAPlane(carid) || IsABoat(carid) || IsASweeper(carid) || IsAHarvest(carid) || IsADrugHarvest(carid) || pveh == 523 || pveh == 539 || pveh == 572 || pveh == 571 || pveh == 530 || pveh == 457)
return SendClientMessage(playerid, COLOR_GREY, " There is no seatbelt in this vehicle!");
if(SeatBelt[playerid]==false)
{
format(string, sizeof(string), "* %s buckles his/her seat belt", sendername);
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SeatBelt[playerid]=true;
AffectVehicleDamageToPlayer(playerid,idcar,0);
}
else if(SeatBelt[playerid]==true)
{
SeatBelt[playerid]=false;
AffectVehicleDamageToPlayer(playerid,idcar,1);
format(string, sizeof(string), "* %s unbuckles his/her seat belt", sendername);
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
else return SendClientMessage(playerid, COLOR_GREY, " You are not in a vehicle!");
}
return 1;
}
This is for seatbelt.
But how can i disable when player inside the car and if he hits something his hp getting lower
Re: Seatbelt & player hit -
Face9000 - 24.06.2012
Remove
pawn Код:
AffectVehicleDamageToPlayer(playerid,idcar,1);
Maybe?
Re: Seatbelt & player hit -
Rob_Maate - 24.06.2012
Quote:
Originally Posted by Logitech90
Remove
pawn Код:
AffectVehicleDamageToPlayer(playerid,idcar,1);
Maybe?
|
no, he'd wanna ensure that variable is set to 0.