Seatbelt & player hit
#1

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?
Reply
#2

Help please!
Reply
#3

Stop bumping your thread after short minutes.
Reply
#4

abide to the Forum Rules. I don't see how could we help you without any codes!
Reply
#5

Код:
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
Reply
#6

Remove

pawn Код:
AffectVehicleDamageToPlayer(playerid,idcar,1);
Maybe?
Reply
#7

Quote:
Originally Posted by Logitech90
Посмотреть сообщение
Remove

pawn Код:
AffectVehicleDamageToPlayer(playerid,idcar,1);
Maybe?
no, he'd wanna ensure that variable is set to 0.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)