pawn Код:
if(targetstate == PLAYER_STATE_ONFOOT && playerstate == PLAYER_STATE_ONFOOT || targetstate == PLAYER_STATE_DRIVER && playerstate == PLAYER_STATE_PASSENGER || targetstate == PLAYER_STATE_PASSENGER && playerstate == PLAYER_STATE_DRIVER ||targetstate == PLAYER_STATE_PASSENGER && playerstate == PLAYER_STATE_PASSENGER)
{
//heal the player
}
else
{
if(playerstate == PLAYER_STATE_ONFOOT && targetstate == PLAYER_STATE_DRIVER || playerstate == PLAYER_STATE_ONFOOT && targetstate == PLAYER_STATE_PASSENGER)
{
SendClientMessage(playerid, COLOR_WHITE, "Error: This player is in a vehicle, you must be in his vehicle to be able to heal him.");
}
else
{
if(playerstate == PLAYER_STATE_DRIVER && targetstate == PLAYER_STATE_ONFOOT || playerstate == PLAYER_STATE_PASSENGER && targetstate == PLAYER_STATE_ONFOOT)
{
SendClientMessage(playerid, COLOR_WHITE, "Error: This player is onfoot, you must be in the same state to be able to heal him.");
}
}
return 1;
}